I created a template sensor. All sub entities (temperature, temperature_unit, etc) would result in correct value except the one for “forecast”, which result in unknown. In the templating sheet it does work.
Could the problem be the value starting in the next line?
This is the template sensor and the value of the sensor for templating
- sensor:
- name: frankfurr_forecast
state: >-
"{{state_attr('weather.frankfurt_hourly','forecast')}}"
-------
temperature: 12.4
temperature_unit: °C
pressure: 1013.6
pressure_unit: hPa
wind_bearing: 109
wind_speed: 19
wind_speed_unit: km/h
visibility_unit: km
precipitation_unit: mm
forecast:
- datetime: '2023-04-28T10:00:00+00:00'
custom_dwd_ww: 3
condition: cloudy
cloud_cover: 83
precipitation_probability: 9
wind_bearing: 109
temperature: 12.4
pressure: 1013.6
wind_speed: 19
precipitation: 0
- datetime: '2023-04-28T11:00:00+00:00'
custom_dwd_ww: 3
condition: cloudy
cloud_cover: 86
precipitation_probability: 8
wind_bearing: 110
temperature: 12.9
pressure: 1013.1
wind_speed: 17
precipitation: 0
- datetime: '2023-04-28T12:00:00+00:00'
custom_dwd_ww: 3
condition: cloudy
cloud_cover: 88
precipitation_probability: 15
wind_bearing: 111
temperature: 13.1
pressure: 1012.8
wind_speed: 17
precipitation: 0