Can't get Weather "get_forecasts" to work

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?

You are including the template integration inside the weather integration.

So your !includes resolve to this:

configuration.yaml

weather:
  template:
    - trigger:
        - platform: time_pattern
          hours: etc...

When it should look like this:

weather:  # weather integrations go here

template: # template integrations go here
  - trigger:
      - platform: time_pattern
        hours: etc...

Thank you. That worked.

I couldn‘t get it to work because it‘s not possible to extract that in a Sub-YAML-Configuration-File. Reason are the indents.