I am trying to get a count (number) of all my entities that contain the word tmpl in the entity_id
I suffix all my template sensors with tmpl to distinguish them from the normal sensors.
I found this code and modified a bit. It returns all the entities as a list.
{%-for state in states
if (
(state.entity_id.endswith("tmpl"))
) -%}
{%- if loop.first -%}{% elif loop.last -%} {% else -%} {% endif -%}
{{state.name}} {% if state.name.endswith('tmpl')%} {%else%} {%endif%}
{% endfor%}
Now my question is; how do I count them?