lua for enabling or disabling a scene

IS there and what would the correct lua code be for enabling a scene using lua code, for examble scene number 31?

Could someone give me the correct lua command which i can try in the lua code test box?


It seems that it needs poking directly into the user_data.scenes variable. This can be tricky if done wrong. Make a backup of your system first. But user_data.scenes[32].paused=1 may do it.

I have not tested my self. I’d rather add a the proper trigger conditions or a little bit of LUA if that does not help.

Cheers Rene

Do it the easy way: Set up a virtual switch that is then tested at the beginning of the Scene’s LUA code. You can then just set the switch to enable/disable the scene.

Search “Virtual Switch” for info.

Here’s a bit of code I use to call a scene

-- call to run scene #62
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1","RunScene",{ SceneNum="62" }, 0)

Obviously, change the scene number to suit.
Can’t say if it’s compatible on all systems but works on Ui4