something weird is happening. I have created the following scene that will turn on 2 lights consecutively and return them back to the original state after some time
( i used the generic vera UI scene creator before , the event was working but left sometimes lights on because of polling issues)
When called manually, the scene behaves sublimely as expected. When I try to add an event for it, On Door Open ( Tripped = true) and open the door nothing happens.
luup.call_action(“urn:micasaverde-com:serviceId:HaDevice1”,“Poll”,{},14)
luup.call_action(“urn:micasaverde-com:serviceId:HaDevice1”,“Poll”,{},36)
os.execute(“sleep 2”)
local light1 = luup.variable_get(“urn:upnp-org:serviceId:SwitchPower1”,“Status”,14)
local light2 = luup.variable_get(“urn:upnp-org:serviceId:SwitchPower1”,“Status”,36)
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetTarget”,{ newTargetValue=“1” },14)
os.execute(“sleep 5”)
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetTarget”,{ newTargetValue=“1” },36)
os.execute(“sleep 5”)
if(light1==“0”)
then
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetTarget”,{ newTargetValue=“0” },14)
end
if(light2==“0”)
then
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetTarget”,{ newTargetValue=“0” },36)
end
any thoughts?
UPDATE when i open the door, i am getting visual confirmation on the UI4 that the lights are only turned off ( they are turned off already), when i test the scene manually everything works fine
UPDATE! I am starting to feel that os.execute(“sleep 5”) or luup.sleep(5) is getting ignored within a scene