groups are a powerful shortcut in setup and automation, however
putting a group among the entities of another group does not work. If you have a motion sensor group
you can put it in an alarm group with another sensor (door opening) but the activation of the alarm group
motion sensor will not trigger the activation of the alarm group. We have to repeat the sensors in the
2 groups.
You can create groups in groups. It seems like your feature request should be named differently. Something like “Nested group trigger.” Possibly a new trigger type for group that will trigger off any entity (or entities) in the group, with modifiers like “all entities”, “one entity”, “no entities” with a state field attached.
Hmm, I think I see what you mean. I will rename.
The goal is to get the state of the groups like any other groups and not to add a new trigger, in fact if a subgroup toggle on, the main groups should toggle on too like it do if an entity of group toggle on (if flags all is not all)
The behavior of groups will never change. This has been tried many times but there are technical reasons why it has never changed. You’re welcome to continue down but I doubt anything will come out of it.
I don’t want to change the behavior of groups, absolutely not, just apply same rules for all entities of the groups, even if this entity is a group too…
Can you give more details about technical reasons?
Groups state is based on what lies in the group and there is a hierarchy related to that. Groups can contain many different state types, not just on/off. Depending on what’s in the group, that will affect the groups state. This is not configurable, it’s done naturally. Then when you try to nest this behavior it gets extremely complicated for little reward.
Well the goal is not too change, just use entities group state to the state of group too like any other entitites of the group, the main difficult is to manage circular dependencies, this need a check. For the reward, it will more simple to create powerful scripts with less mistakes. You can manage by group without repeating entities, think ‘ansible’ tool for example, the powerful come from the ability to precisely target the actors
again, the problem is that group states are not simply on and off. adding this in will change the behavoir and make it complicated. It’s not simply adding the group domain into the check.
To further clarify, this is why the expand() function exists in templates. It will recursively grab all entities inside groups and place them into a list without duplicates.
Then you must not understand how a groups state changes. A groups state will be on if any entity is on. The state will not change if one is on and another turns on. Meaning, a trigger will not occur.