Hi All,
I want to change the color of my pool led spot with a zwave switch. The manual way is to switch on then off and on (Between the last off and on the time is short)
I do this luup script but don’t work. Any one has got an idea ?
the device #12 is my switch.
local test_light=luup.variable_get("urn:upnp-org:serviceId:SwitchPower1","Status",12)
-- I test if my light is off, if it's true I continue
if (test_light == "0") then
local pool_light_on=luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{newTargetValue="1"},12)
luup.call_timer("pool_light_on", 1, "1", "", "")
local pool_light_off=luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{newTargetValue="0"},12)
luup.call_timer("pool_light_off", 1, "1", "", "")
luup.call_timer("pool_light_on", 1, "1", "", "")
-- normaly the colour is changed, but in that case it doesn't work.
else
-- the led is on, so I'v just had to do off then on
local pool_light_off=luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{newTargetValue="0"},12)
luup.call_timer("pool_light_off", 1, "1", "", "")
local pool_light_on=luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{newTargetValue="1"},12)
luup.call_timer("pool_light_on", 1, "1", "", "")
end
I think it’s possible to do it because I can do it manualy by pressing directly on the dashboard.
Futzle are you somewhere …?
Gilles.