Continuing the discussion from Custom Images not shown on moon sensor:
HI,
i have a sensor with an entity_picture template:
entity_picture_template: >
{{ '/local/tiles/family/m_' + states('sensor.m_life360_state') +'.png'}}
works beautifully, except for the state of the life360 sensor which hasn’t got a dedicated picture.
I’ve tried to add an existence checker:
entity_picture_template: >
{% if '/local/tiles/family/m_' + states('sensor.m_life360_state') +'.png' %}
{{ '/local/tiles/family/m_' + states('sensor.m_life360_state') +'.png'}}
{% else %}
/local/tiles/family/m_zoning.png
{% endif %}
but that simply checks alright, even when it doesn’t exist…
Can we check for the existence of an actual file in a template like this?
thx,
M