@venture wrote:
I’m having a problem getting the length of a loop to show one time. I’m guessing it’s a syntax issue. Here’s my code:
{% for l in config.entities %} {% if ("state.l.entity", 'on') %} Lights on: {{ loop.length }} {% endif %} {% endfor %} {% for l in config.entities if ("state.l.entity", 'on') %} {{ l.name }} {%- endfor %}
Why is the length repeating? Sorry, first time Python, and new to Home Assistant. I read the Jinja and Markdown Card docs and still can’t seem to figure it out. Thanks to anyone who can point me in the right direction.
Posts: 1
Participants: 1