Is it possible to nest scenes?

For ease of setup and manageability I want to build up a scene and place that within a scene.

Something like the following.

Scenes within Scene

Is this possible or possibly a feature request?

To my knowledge, this not possible, so it would have to be a feature request.

You can make it work indirectly with a few extra pieces, however. If you add a proxy switch for each scene that is turn on by the scene itself, then you can have a rule which is triggered by the proxy item which in turn activates the next scene in the chain.

I’ll put in an enhancement request then.

Unless you are sneaky :smiling_imp: (you can manually add a trigger from the code tab), scenes tend not to be triggered directly. They are called from other rules or from MainUI Widgets directly.

You can achieve this by having a rule that calls all the Scenes you want called.

In other words, build your hierarchy in the Rules that call your Scenes.

For example, your Home On rule would call the Living On and Study On rules. The Living On rule would call the Front Lights On and Back Lights On Scenes.

Also don’t forget that there are Groups and Groups can be called from a Scene and any command sent to a Group gets sent to all members of the Group. Groups could be used here as well, in some circumstances.

Because a Scene is just a special type of Rule, any hierarchy is going to be built by having Rules higher in the hierarchy call other Rules lower in the hierarchy, and we already have that feature available to us.

You might even be able to promote(? demote?) a generic rule to become a Scene by adding the “Scene” tag but I suspect that will break the Scenes setting page on MainUI, at least for these Rules. Assuming that that did work though, if having these controlling rules higher up in the hierarchy shown on the Scenes page, you could move it over there by adding the “Scene” tag. Just don’t try to edit it over there.

Thanks for the suggestion. Having a rule that calls all the scenes I want is feasible for the moment. However cumbersome when you have a number of scenes that could be reused as a child of another scene. Because for every scene I also need a rule, which undermines the maintainability. For the three scenario’s I would have 10 scenes and 10 rules. Where only 3 rules and 10 scenes could do the trick if the scenes could have been set up recursively.

I have elaborated a bit on the sample in the drawing below.

My intent was not to have scenes trigger themselves, but use the rules capability.

A Scene is a Rule. You’d need separate rules anyway, whether they are listed under “Rules” or listed under “Scenes”.

No. The Scenes would be at the lowest level, the rules that only command Items (Outside Off, Outside ON, Front Lights Off, Front Lights On, Back Lights Off, Back Lights ON). Again a Scene is a Rule. So 6 scenes.

The generic Rules would be at the higher levels, the modules that call each other or call the Scenes (Daytime, Evening, Night, Living Off, Living Eventing). So that’s 4 generic rules.

Total is 10 rules, 6 scenes and 4 generic, given the drawing.

With the proxy item approach you would need 1 rule per proxy item if you wanted to use UI configuration of each action.

If you were willing to write your own script action then it would require 1 single rule to associate the rule(s) to be run when any of the proxy items are changed (I personally would use metadata to do it, but a single switch statement would be sufficient).

There are indeed several other ways to implement a hierarchy like this. Ultimately, most users who use scenes extensively would probably end up needing to use a combination of approaches using Scenes, Groups, and proxy Items with metadata.

In the documentation on scenes it indeed says: Scene: A special type of rule that allows to send multiple item actions at the same time.

Hmmm. Something to ponder on.