I/m working to get a luup code to get the light variables, but whenever it runs it sending the variable as a zero. In the below code I have it to trigger if its below 20 but its triggering no matter what the level actually is. Any help would be greatly appreciated.
Douglas
local LOW_LEVEL = 20 – the light level threshold for night
local DEVICE_NO = 48 – the light sensor device number
local LS_SID = “urn:schemas-micasaverde-com:device:LightSensor:1” – the LightSensor service ID
local currentLevel = luup.variable_get (LS_SID, “CurrentLevel”, DEVICE_NO) or 0
currentLevel = tonumber(currentLevel)
if currentLevel <= LOW_LEVEL then
luup.call_action(“urn:upnp-org:serviceId:IOSPush1”, “SendPushOverNotification”,{ Title= “Light”, Message=currentLevel, Priority=1, URL=“”, URLTitle=“”, Sound=“Siren”}, 18)
else
return false
end