Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
1.5 kB
6
Indexable
Never
        - layout: icon|name_state
          name: ⌂ {{ states('sensor.temperature_interieure') }}°C
          state: '{{ state_attr(''weather.openweathermap'',''temperature'') }}°F'
          image: |
            {% set mapper =
              { 'breezy':'cloudy',
                'clear-night':'night',
                'clear':'day',
                'mostly-clear':'day',
                'clear-day':'day',
                'cloudy':'cloudy',
                'fog':'fog',
                'hail':'rainy-7',
                'haze':'haze',
                'lightning':'thunder',
                'mostly-cloudy':'cloudy',
                'partlycloudy':'cloudy-day-3',
                'partly-cloudy-day':'partly-cloudy-day',
                'partly-cloudy-night':'partly-cloudy-night',
                'rain':'rainy-4',
                'scattered-showers':'rainy-3',
                'showers':'rainy-6',
                'sleet':'sleet',
                'snow':'snowy-6',
                'mostly-sunny':'day',
                'sunny':'day',
                'thunderstorm':'thunder',
                'tornado':'tornado',
                'wind':'wind',
                'windy':'wind'} %}
            {% set state = states('weather.maison_2') %}
            {% set weather = mapper[state] if state in mapper else 'weather' %}
            {% set path = '/local/icons/weather_icons/animated/' %}
            {% set ext = '.svg'%}
              {{[path,weather,ext]|join('')}}
Leave a Comment