HI folks,
please help me out. My card won’t show the correct large night icon:
ive made an extra dedicated template sensor to check if the icon exists:
which it obviously does.
this is the code in the card for the icon:
get weatherIcons() {
return {
'clear-day': 'day',
'clear-night': 'night',
'rain': 'rainy-5',
'snow': 'snowy-6',
'sleet': 'rainy-6',
'wind': 'cloudy',
'fog': 'cloudy',
'cloudy': 'cloudy',
'partly-cloudy-day': 'cloudy-day-3',
'partly-cloudy-night': 'cloudy-night-3',
'hail': 'rainy-7',
'lightning': 'thunder',
'thunderstorm': 'thunder',
'windy-variant': `cloudy-day-3`,
'exceptional': '!!',
}
}
and this is what I use for the extra sensor:
weather_rsd_icon:
friendly_name_template: >
{{states('sensor.dark_sky_icon')|title|replace('-',' ')}}
value_template: >
{{states('sensor.dark_sky_icon')|title|replace('-',' ')}}
entity_picture_template: >
{% set mapper =
{ 'Breezy': 'cloudy',
'Clear Night': 'night',
'Clear': 'day',
'Mostly Clear': 'day',
'Clear Day': 'day',
'Cloudy': 'cloudy',
'Fog': 'cloudy',
'Hail': 'rainy-7',
'Lightning': 'thunder',
'Mostly Cloudy': 'cloudy',
'Partly Cloudy': 'cloudy-day-3',
'Partly Cloudy Day': 'cloudy-day-2',
'Partly Cloudy Night': 'cloudy-night-3',
'Rain': 'rainy-4',
'Scattered Showers': 'rainy-3',
'Showers': 'rainy-6',
'Snow': 'snowy-6',
'Mostly Sunny': 'day',
'Sunny': 'day',
'Windy': 'cloudy'} %}
{% set state = states('sensor.dark_sky_icon')|title|replace('-',' ') %}
{% set weather = mapper[state] if state in mapper else 'weather' %}
{% set path = '/local/weather/animated/' %}
{% set ext = '.svg'%}
{{[path,weather,ext]|join('')|lower}}