I am quite new to all this, so sorry if it is a basic error! I have spent a few days looking and can not find a solution to my problem. :-[
I am using Vera Plus UI7 (1.7.4001) and AltUI (2.29.2418).
All I want to do is create a scene that is manually triggered and will run a simple LUA code and nothing else.
I can not get any code to work within a scene, it does work when I test the code outwith the scene.
For an example of the issue I have used some code from the wiki pages which should turn on a device, wait 2 seconds, then turn off the device. When I run the code in the ‘LUA code test’ it runs fine and performs as expected. However when I copy that same code into the LUA code section within a new scene, and trigger the scene manually, it does not work. What am I doing wrong??
Here is the code, identical to how I paste it into the ‘LUA scene code’ box withing the scene;
local device = 34
– Switch on device 34:
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetTarget”,{ newTargetValue=“1” },device)
luup.call_delay( ‘switch_off’, 2) – Call the switch off function after a delay of 2 seconds
function switch_off()
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetTarget”,{ newTargetValue=“0” },device)
end