I am using a condition to get some information about the weather and a forecast but now it started showing an error:
2022-04-29 13:08:45 WARNING (MainThread) [homeassistant.helpers.template] Template warning: ‘strptime’ got invalid input ‘2022-05-04T12:00:00’ when rendering template ’ {{as_timestamp(strptime(state_attr(‘weather.smhi_home’, ‘forecast’)[5].datetime, ‘%Y-%m-%d %H:%M:%S’)) | timestamp_custom("%a %-d") }}
<ha-icon icon={{states(‘sensor.weather_smhi_icon5’)}}>
{{state_attr(‘weather.smhi_home’, ‘forecast’)[5].temperature}} / {{state_attr(‘weather.smhi_home’, ‘forecast’)[5].templow}} ’ but no default was specified. Currently ‘strptime’ will return ‘2022-05-04T12:00:00’, however this template will fail to render in Home Assistant core 2022.1
This is what I’ve added to configuration.yaml a long time ago:
{% set state = state_attr(‘weather.smhi_home’,‘forecast’)[5].condition %}
{% set weather = mapper[state] if state in mapper else ‘sunny-alert’ %}
mdi:weather-{{weather}}
1 post - 1 participant