Hi,
I have a lot of issues to do following script in a scene:
1/I do the folowing script in luup of the scene (with night condition to test it at first)
if (luup.is_night()) then
local service_id = “urn:upnp-org:serviceId:Dimming1”
local dim_status = luup.variable_get(service_id,“LoadLevelStatus”, 118)
if (tonumber(dim_status) > 51) then
luup.call_action(service_id, “SetLoadLevelTarget”, {newLoadlevelTarget = “50”}, 118)
return true
else
return false
end
end
2/ In the event: trigger when the switch 118 go on et command the 118 set level to 50%
3/ All works but only one time at the beginning of the scene with switch on, go to 100% and dimme immediatly to 50%
How can I do to watch the change of the dimmer value if it is over 51% then trigger the scene?
I dont want to watch only the swith but the dimmervalue because it can be change with a remote control
I try this in the event luup code:
local dim_status = luup.variable_get(service_id,“LoadLevelStatus”, 118)
if (tonumber(dim_status) > 51) then
return true
else
return false
end
but it doesnt work…
Thanks for help,