Hi,
I want a automation condition which enumerates not closed windows:
id: testnotification
initial_state: 'on'
trigger:
- platform: state
entity_id: group.anwesenheit_alle
to: 'off'
condition:
- condition: template
value_template: >-
{% for item in states.group.fenster_und_tueren.attributes.entity_id if states(item) == 'closed' or states(item) == 'off' %}
{% if loop.first %}
{{loop.length}} < 13
{% endif %}
{% endfor %}
action:
- service: notify.ios_iphone
data_template:
message: testmessage
the enumeration is working correct, but the mathematical operation “<13” is not working. Any hints how to solve it?