I am finding this to be rather challenging, as it seems that HA changed the way weather forecasts are handled behind the scenes recently.
I simply want to plot this data:
As a line chart in a custom plotly card.
I have read through the documentations and numerous forum posts and have added the following to my configuration.yaml:
template:
- trigger:
- platform: time_pattern
minutes: "/30"
action:
- service: weather.get_forecasts
data:
type: daily
target:
entity_id: weather.pirateweather
response_variable: daily
sensor:
- name: Pirate Weather Daily
unique_id: pirateweather_daily
state: "{{ daily['weather.pirateweather'].forecast[0].condition }}"
attributes:
forecast: "{{ daily['weather.pirateweather'].forecast }}"
- trigger:
- platform: time_pattern
minutes: "/30"
action:
- service: weather.get_forecasts
data:
type: hourly
target:
entity_id: weather.pirateweather
response_variable: hourly
sensor:
- name: Pirate Weather Hourly
unique_id: pirateweather_hourly
state: "{{ hourly['weather.pirateweather'].forecast[0].condition }}"
attributes:
forecast: "{{ hourly['weather.pirateweather'].forecast[:24] }}"
This results in some sensors, but they have no data, so I do not know what to add to my card’s YAML now.
Wow… actually, as I was typing this it seems like the sensors populated finally… I guess my question now is how should I have triggered that without needing to wait a while???