@brad999 wrote:
I’m trying to setup a sensor to show the count of my open windows. I’ve setup a group with all my window binary sensors and am trying to count the ones that are “on” with the following sensor. I put this together after going through several iterations of examples on the forum but none are working for me. This current example will work with a count of up to “1” but even with more than one open it still just shows “1”.
Any help would be greatly appreciated as these templates are rather confusing to me.
window_count: value_template: >- {{ states | selectattr('entity_id', 'in', state_attr('group.windows', 'entity_id')) | selectattr('state', 'eq', 'on') | list | count | int }}
Posts: 1
Participants: 1