Followed the instructions from:
Added this (from the bottom of above website) to my configuration.yaml:
template:
- trigger:
- platform: time_pattern
hours: /1
action:
- service: weather.get_forecasts
data:
type: hourly
target:
entity_id: weather.home
response_variable: hourly
sensor:
- name: Temperature forecast next hour
unique_id: temperature_forecast_next_hour
state: "{{ hourly['weather.home'].forecast[0].temperature }}"
unit_of_measurement: °C
My configuration.yaml looks like this:
weather: !include config_weather.yaml
My config_weather.yaml looks like this:
template:
- trigger:
- platform: time_pattern
hours: /1
action:
- service: weather.get_forecasts
data:
type: hourly
target:
entity_id: weather.home
response_variable: hourly
sensor:
- name: Temperature forecast next hour
unique_id: temperature_forecast_next_hour
state: "{{ hourly['weather.home'].forecast[0].temperature }}"
unit_of_measurement: °C
Get this error:
Invalid config for 'template' from integration 'weather' at config_weather.yaml, line 12: 'template' is an invalid option for 'weather.template', check: template
What am I doint wrong?