maurizio53
(Maurizio Fabiani)
February 4, 2025, 10:33am
1
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?
Hellis81
(Hellis81)
February 4, 2025, 10:38am
2
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
maurizio53
(Maurizio Fabiani)
February 4, 2025, 10:40am
3
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
maurizio53
(Maurizio Fabiani)
February 4, 2025, 10:45am
5
So, in this way how to show the state icon?
give me a minute, that method may work with a small adjustment…
Hellis81:
{{ state }}.svg
This will work
/local/icons/weather_icons/animated/{{states(entity)}}.svg
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.