Hello,
I followed Simon42’s video to create weather forecast entities and I want to write information into the attributes. My code is below.
Unfortunately, no values are found, and all attributes are displayed as “unknown.”
Does anyone have an idea where my mistake is? The “Location” attribute is displayed correctly - I filled that one statically.
Thank you,
Moritz
template:
- trigger:
- platform: time_pattern
hours: /1
action:
- service: weather.get_forecasts
target:
entity_id:
- weather.forecast_home
data:
type: daily
response_variable: tagesvorhersage
- sensor:
- name: Wettervorhersage (heute)
unique_id: wettervorhersage_heute
state: "{{ now().isoformat() }}"
icon: mdi:weather-partly-rainy
attributes:
location: "Home"
datetime: "{{ tagesvorhersage['weather.forecast_home'].forecast[0].datetime }}"
condition: "{{ tagesvorhersage['weather.forecast_home'].forecast[0].condition }}"
temperature: "{{ tagesvorhersage['weather.forecast_home'].forecast[0].temperature }}"
templow: "{{ tagesvorhersage['weather.forecast_home'].forecast[0].templow }}"