I have been experimenting with adding local variables to a working piece of luup code to make it more accesible for other users.
After studying the Wiki on luup, particularly these pages:
http://wiki.micasaverde.com/index.php/Luup_Variables &
http://wiki.micasaverde.com/index.php/Lua_tips
I came as far as this with the variables (without using global variables) using the “hold on to your locals” tips
The working code is:
function ScreenOpen()
luup.call_action("urn:upnp-org:serviceId:WindowCovering1","Up",{ },27)
end
function ScreenStop()
luup.call_action("urn:upnp-org:serviceId:WindowCovering1","Stop",{ },27)
end
luup.call_timer("ScreenOpen", 1 ,"1","","")
luup.call_timer("ScreenStop", 1 ,"24","","")
But now im stuck and the code wont run (scene kicks off, message sent, no reaction from the z-wave device)
Not working (test) code;
do
local DeviceNumber1 = 27
local Delay1 = "1"
local Delay2 = "24"
function ScreenOpen()
luup.call_action("urn:upnp-org:serviceId:WindowCovering1","Up",{ },Devicenumber1)
end
function ScreenStop()
luup.call_action("urn:upnp-org:serviceId:WindowCovering1","Stop",{ },Devicenumber1)
end
luup.call_timer("ScreenOpen", 1 ,Delay1,"","")
luup.call_timer("ScreenStop", 1 ,Delay2,"","")
end
What am i doing wrong? Any help would be appreciated