it all depends on which states the weather component you use takes, and which icon is mapped to that.
The Darksky weather integration (so not the sensor) doesn’t use the night-partly-cloudy icon, that’s why I made this template to use the icons I like to see in my setup, if the condition arises.
weather_icon:
entity_id: sensor.dark_sky_icon, weather.home_darksky, weather.woensdrecht
friendly_name_template: >
{{states('sensor.weather_icon').split('weather')[1]|replace('-',' ')|title}}
value_template: >
{% set mapper_icon =
{'partly-cloudy-night': 'night-partly-cloudy'} %}
{% set mapper_br =
{'pouring': 'pouring',
'lightning-rainy': 'lightning-rainy',
'snowy-rainy': 'snowy-rainy'} %}
{% set mapper_ds =
{'sunny': 'sunny',
'clear-night': 'night',
'rainy': 'rainy',
'snowy': 'snowy',
'snowy-rainy': 'snowy-rainy',
'windy': 'windy',
'fog': 'fog',
'cloudy': 'cloudy',
'partlycloudy': 'partly-cloudy',
'hail': 'hail',
'lightning':'lightning'} %}
{% set icon = states('sensor.dark_sky_icon') %}
{% set woensdrecht = states('weather.woensdrecht') %}
{% set dark = states('weather.home_darksky') %}
{% set weather = mapper_icon[icon] if icon in mapper_icon else
mapper_br[woensdrecht] if woensdrecht in mapper_br else
mapper_ds[dark] if dark in mapper_ds else 'sunny-alert' %}
mdi:weather-{{weather}}
icon_template: >
{{states('sensor.weather_icon')}}
weather.woensdrecht is using the buienradar integration.
these 3 have a set of icons that complement each other nicely.
You can then use that sensor in the CH template as follows:
button_text:
options: >-
{{ time }} -<ha-icon icon='{{states('sensor.weather_icon')}}'></ha-icon> {{states('sensor.temp_current') }}°
I do think it is not vertically centered as it should, but maybe Ryan can have a look at that if and when time allows
ps my template above can even be a bit more compressed:
{% set mapper_icon =
{'partly-cloudy-night': 'night-partly-cloudy'} %}
{% set mapper_br =
{'pouring': 'pouring',
'lightning-rainy': 'lightning-rainy',
'snowy-rainy': 'snowy-rainy'} %}
{% set mapper_ds =
{'clear-night': 'night',
'partlycloudy': 'partly-cloudy'} %}
{% set icon = states('sensor.dark_sky_icon') %}
{% set woensdrecht = states('weather.woensdrecht') %}
{% set dark = states('weather.home_darksky') %}
{% set weather = mapper_icon[icon] if icon in mapper_icon else
mapper_br[woensdrecht] if woensdrecht in mapper_br else
mapper_ds[dark] if dark in mapper_ds else
dark if dark in
['sunny','rainy','snowy','snowy-rainy','windy','fog','cloudy','hail','lightning']
else 'sunny-alert' %}
mdi:weather-{{weather}}
do make sure the template sensor changes on the state changes of the individual integrations by adding the entity_id’s to the sensor config:
weather_icon:
entity_id: sensor.dark_sky_icon, weather.home_darksky, weather.woensdrecht
value_template:
etc