Last active
February 17, 2022 10:55
-
-
Save alphasixtyfive/59e9f806d1135b34797295cc1a569255 to your computer and use it in GitHub Desktop.
Homeassistant - Count open windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template: | |
- binary_sensor: | |
- name: Open windows | |
icon: mdi:window-open-variant | |
state: >- | |
{{ states.binary_sensor | selectattr('attributes.device_class', 'eq', 'door') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | map('area_name') | list | count > 0 }} | |
attributes: | |
areas: >- | |
{{ states.binary_sensor | selectattr('attributes.device_class', 'eq', 'door') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | map('area_name') | unique | list }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment