Instead of using the yaml-based groups i added all groups as helper groups.
In node-red i was using the “get-entities” to get all e.g. lights that are on using the “in group” option.
How can i achieve the same with the helper groups?
Instead of using the yaml-based groups i added all groups as helper groups.
In node-red i was using the “get-entities” to get all e.g. lights that are on using the “in group” option.
How can i achieve the same with the helper groups?
hi,
I have also tried this and found the following solution:
{% set groupname = 'switch.switch_group_1_camera_internet_access' %}
my group is:
+ {{ groupname }}
state of (helper-)group switch:
+ {{ states(groupname) }}
extended list of group members:
+ {{ expand(groupname) }}
list1 of group member entity_ids
+ {{ expand(groupname) | selectattr('state','eq','on') | map(attribute='entity_id') | list }}
list2 of group member entity_ids
{% for memb in expand(groupname) | selectattr('state','eq','on') | map(attribute='entity_id') | list %}
+ {{ memb }}
{% endfor %}
this is what I tested with the template editor.
I started here: https://community.home-assistant.io/t/how-to-iterate-through-a-list-of-entities-and-call-service-on-each-entity/383535/10