Can’t work out how I’ve got this wrong, which I clearly have.
There’s a group called doors_windows, and I’m trying to create a sensor which tells me how many are open. Getting a “KeyError:” in the Developer Tools.
# Doors and Windows Open
- platform: template
sensors:
door_count:
value_template: >
{{ states.group.doors_windows|selectattr('state','equalto','open')|list|length }}
Any help much appreciated! Thanks!