List all open doors and windows
Home Assistant Template
- type: conditional
conditions:
- entity: sensor.total_open_windows_doors
state_not: '0'
card:
type: 'custom:flex-table-card'
clickable: true
strict: true
entities:
include:
- binary_sensor.*win*
- binary_sensor.*door*
sort: friendly_name+
columns:
- name: The following are open
data: friendly_name
- data: state
name: ' '
modify: '(x == "off") ? null : " "'
The above uses the custom:flex-table-card and the sensor below to show any open doors and windows.
Template Sensor in Sensors.yaml
total_open_windows_doors:
friendly_name: Open Windows/Doors
icon_template: "mdi:door-open"
value_template: "{{ states.binary_sensor | selectattr('state', 'eq', 'on') | rejectattr('attributes.device_class', 'ne', 'opening') | list | count }}"