Hi Expert
I am trying to write the above however I hit error when testing the Luup code from if onwards.
Anyone able to advise?
It seems stating a variable cannot have any formula e.g.
local brightness = tonumber(luup.variable_get(“urn:micasaverde-com:serviceId:LightSensor:1”,“CurrentLevel”,sensorID))
local lightID = 292
local sensorID = 205
local dim = 4
local status =luup.variable_get(“urn:upnp-org:serviceId:SwitchPower1”, “Status”, lightID)
local brightness = luup.variable_get(“urn:micasaverde-com:serviceId:LightSensor:1”,“CurrentLevel”,sensorID)
local isNight = luup.is_night()
local bright = tonumber(brightness)
if status == “0” then
if bright < dim or isNight then
return true
end
else
return false
end
end