I have this sensor template to show different icons related to moon phases, but the frontend doesn’t shows any icon…
- platform: template
sensors:
moonphases:
entity_id: sensor.moon
friendly_name: 'Moon'
value_template: '{{ states.sensor.moon.state }}'
entity_picture_template: >
{% if is_state('sensor.moon', 'New moon') %}
/local/moonphases/NNewMoon.jpg
{% elif is_state('sensor.moon', 'Waxing crescent') %}
/local/moonphases/NWaxingCrescent.jpg
{% elif is_state('sensor.moon', 'First quarter') %}
/local/moonphases/NFirstQuarter.jpg
{% elif is_state('sensor.moon', 'Waxing gibbous') %}
/local/moonphases/NWaxingGibbous.jpg
{% elif is_state('sensor.moon', 'Full moon') %}
/local/moonphases/NFullMoon.jpg
{% elif is_state('sensor.moon', 'Waning gibbous') %}
/local/moonphases/NWaningGibbous.jpg
{% elif is_state('sensor.moon', 'Last quarter') %}
/local/moonphases/NLastQuarter.jpg
{% elif is_state('sensor.moon', 'Waning crescent') %}
/local/moonphases/NWaningCrescent.jpg
{% endif %}
The path to the icons is correct…
Where is the error?