I am upgrading HA and all my automations.
In 2022.4 the method of creating GROUPS was changed to use the UI.
I have created a few GROUPS in the UI, but am unsure how to use them.
For instance. I have an automation that tells me if a door is open at a certain time.
I created a GROUP called DOORS in the UI and entered all my door binary sensors.
I am unsure on what I need to do to rewrite the automation.
Here is what I had used.
condition:
condition: template
value_template: >
{{ states | selectattr('entity_id', 'in', state_attr('group.5123_door_sensors_contact','entity_id')) | selectattr('state','in',['on','open']) | list | length >= 1 }}
With a twist: The UI doesn’t create group entities. Those are still created exclusively via YAML and now referred to as “legacy groups”.
The UI creates lets you create a binary_sensor that’s a group of other binary_sensors. It can also do this for other domains as well such as |cover, lock, fan`, etc.