I’m trying to create a template sensor to extract weather forecast data, and I can’t seem to get the actual sensor values anywhere.
What I want is to have sensor.forecast_data
with the attributes described below available at all times and updated once an hour.
My template sensor looks like this:
template:
- trigger:
- platform: time_pattern
hours: "/1"
action:
- service: weather.get_forecasts
data:
type: daily
target:
entity_id: weather.home
response_variable: daily
sensor:
- name: Weatherman Data
unique_id: forecast_data
state: "{{ now().isoformat() }}"
attributes:
weather_condition_0: >
{{ daily["weather.home"].forecast[0].condition }}
weather_temperature_0: >
{{ daily["weather.home"].forecast[0].temperature | round }}
However, this does not work; even after an hour, when the trigger fires, I cannot refer to sensor.forecast_data
in any card or via esphome.
What am I doing wrong?