Author Topic: Scenes within scenes  (Read 1375 times)

Offline Chapin

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +1/-4
Scenes within scenes
« on: February 19, 2017, 06:41:49 pm »
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.

Offline Z-Waver

  • Master Member
  • *******
  • Posts: 4437
  • Karma: +247/-120
Re: Scenes within scenes
« Reply #1 on: February 19, 2017, 06:48:52 pm »
Put this in the LUUP tab of the master scene to have it run scene number 5

Code: [Select]
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = "5"}, 0)
Wiki - Luup Scenes Events

Offline Chapin

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +1/-4
Re: Scenes within scenes
« Reply #2 on: February 19, 2017, 06:56:18 pm »
Put this in the LUUP tab of the master scene to have it run scene number 5

Code: [Select]
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = "5"}, 0)
Wiki - Luup Scenes Events

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

Offline akbooer

  • Master Member
  • *******
  • Posts: 6043
  • Karma: +264/-69
  • "Less is more"
Re: Scenes within scenes
« Reply #3 on: February 20, 2017, 03:14:17 am »
...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.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline Z-Waver

  • Master Member
  • *******
  • Posts: 4437
  • Karma: +247/-120
Re: Scenes within scenes
« Reply #4 on: February 20, 2017, 07:48:05 am »
It's Monday, I'm struggling to understand your meaning here. Are you referring to an aliasing function like:

Code: [Select]
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?

Offline akbooer

  • Master Member
  • *******
  • Posts: 6043
  • Karma: +264/-69
  • "Less is more"
Re: Scenes within scenes
« Reply #5 on: February 20, 2017, 08:07:43 am »
It's Monday, I'm struggling to understand your meaning here. Are you referring to an aliasing function like:

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

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



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

« Last Edit: February 20, 2017, 09:26:08 am by akbooer »
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Online rafale77

  • Hero Member
  • *****
  • Posts: 1185
  • Karma: +54/-22
Re: Scenes within scenes
« Reply #6 on: February 20, 2017, 12:43:43 pm »
That's pretty brilliant... wish I had thought about it sooner. Already created all my scenes.
openLuup (97 devices, 134 scenes, 20 apps) controlling HomeAss + VeraPlus (134 zwave nodes, 8 Zigbee nodes, 200 devices, 20 scenes , 2 app) Bridged to Homekit and Alexa. VeraPlus ExtRooted!