How to configure the action in an OH3 rule so that it turns off all lights from one hierarchy level and down? I have defined House as one level in the Scemantic Model and then floors with rooms beneath.
Is this possible or do I have to manually add all lights to a group and then act on that group?
It’s possible but it’s probably not going to be any simpler than adding the Group. And an advantage of adding the Group is you can put it into the model so you have a switch at that higher level to control all the lights as part of your model. Just be sure to tag is as a Point, not Equipment or Location.
But if you don’t want to create this without the Group, you’ll need a rule. Something needs to trigger the rule which means you’ll have to create a proxy Item anyway. When triggered,
getAllMembers from the Location Item. This will get all direct members and all members of subgroups. You then need to filter those for just those Items that are tagged with the Point/Property tags you are looking for (e.g. Switch/Light). Then forEach on the filtered list and send the command to each of those Items.
See Design Pattern: Working with Groups in Rules for details on working with Group members.