Badge Weather with dynamic Icon and temperature in label


I’d like to do this Weather badge like in this picture (4th), with the dynamic icon based on weather and the temperature in a label.

Thanks for your help :slight_smile: @Mariusthvdb


sure, here you go:

its a template sensor:

        friendly_name_template: >
          {{states('sensor.dark_sky_forecast_icon')|capitalize|replace('-',' ')}}
        value_template: >
          {{states('sensor.dark_sky_forecast_icon')|capitalize|replace('-',' ')}}
        entity_picture_template: >
          {% set mapper =
            { 'breezy':'cloudy',
              'windy':'wind'} %}
          {% set state = states('sensor.dark_sky_icon') %}
          {% set weather = mapper[state] if state in mapper else 'weather' %}
          {% set path = '/local/weather/animated/' %}
          {% set ext = '.svg'%}

using the Amcharts animated icons

the badge label (used for unit_of_measurement) is customized, and in this case with custom-ui.

        unit_of_measurement: >
          if (entities['sensor.temp_current'])
          return entities['sensor.temp_current'].state +' °C';
          return 'Initializing';


we might ask @Ildar_Gabdullin whether our journey with card-mod’ing the badges also enables the template for the temperature in the label.

card-mod is a modern way of modding the HA frontend.

Cannot check it by myself since I have not installed Custom_UI so far…
But here there is a description of styling badges - and I think this will work with templates as well, need to try.

Hey @Mariusthvdb,

So i have been trying to set this badge.
I put the animated icons in the /local/weather/animated folder
And when i restarted home assistant sensor.weather_animated_icon is Unknown.
I haven’t setup custom yet.
Best regards