having a full checkup of the templates, I was experimenting with this
icon_template: >
{% if states.persistent_notification|count > 0 %} mdi:message-bulleted
{% else %} mdi:message-bulleted-off
{% endif %}
is the regular form I use all over, but given the two options, could be shortened:
{{'mdi:message-bulleted-off' if states.persistent_notification|count == 0 else 'mdi:message-bulleted'}}
now, I can even take out the ‘mdi:message-bulleted-’ bit and try something like this
mdi:message-bulleted{{'-off' if states.persistent_notification|count == 0}}
which works for now. Not perfectly sure though this is a guarded enough template.
Thoughts on the matter are appreciated.
thanks
1 post - 1 participant