Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 111312

Sensor to count open windows

$
0
0

@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

Read full topic


Viewing all articles
Browse latest Browse all 111312

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>