Icons not visible in template

I am trying to use this template to show the actual weather icon based on the state of the weather entity, but surely i am wrong in something as i cannot see the related icon.

type: custom:mushroom-template-card

primary: "{{ state_attr(entity, 'temperature') | int}} °C"

secondary: "{{ states(entity, 'weather.openweathermap_daily') }}"

icon: " "

entity: weather.openweathermap_daily

picture: /local/icons/weather_icons/animated/{{ state }}.svg

Where is the error?

type: custom:mushroom-template-card

primary: "{{ state_attr(entity, 'temperature') | int}} °C"

secondary: "{{ states(entity, 'weather.openweathermap_daily') }}"

icon: " "

entity: weather.openweathermap_daily

picture: "/local/icons/weather_icons/animated/{{ state }}.svg"

double quotes missing

Sorry, i already tried this but without success…

type: custom:mushroom-template-card
primary: |
 {{ state_attr(entity, 'temperature') | int(0)}} °C
secondary: |
 {{ states(entity, 'weather.openweathermap_daily') }}
icon: " "
entity: weather.openweathermap_daily

picture is not an option in the method you provided

So, in this way how to show the state icon?

give me a minute, that method may work with a small adjustment…

This will work

/local/icons/weather_icons/animated/{{states(entity)}}.svg

Yes, it works… Thanks!

so please tag the solution to Icons not visible in template - #6 by LiQuid_cOOled

in stead of your own confirmation?

1 Like

icon: field isn’t required. Just delete it.