Scenes within scenes

How do I run scenes within a scene?

I set up an “All Off” scene that I want to trigger with other scenes. How do I do this?

Thanks.

Put this in the LUUP tab of the master scene to have it run scene number 5

luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = "5"}, 0)

Wiki - Luup Scenes Events

[quote=“Z-Waver, post:2, topic:195556”]Put this in the LUUP tab of the master scene to have it run scene number 5

luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = "5"}, 0)

Wiki - Luup Scenes Events[/quote]

Kick ass. This should be easier, but there it is.

…or you can simply define a global function in Startup Lua which can be called by any scene. No need to make the code you want to share a scene itself.

It’s Monday, I’m struggling to understand your meaning here. Are you referring to an aliasing function like:

function ExecScene (SceneNum) luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = "SceneNum"}, 0) end

Then use ExecScene(5) wherever you need to? Or are you meaning something else?

Almost. You just need to leave off the quotes around the SceneNum parameter…

function ExecScene (SceneNum)
    luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = SceneNum}, 0)
end

[hr]

Edit: …although it wouldn’t have to call a scene, it could just contain the code that was in the scene.

That’s pretty brilliant… wish I had thought about it sooner. Already created all my scenes.