Help converting weather forecast Entity to Sensor, and changing update interval?

Hi all, this I think is my first post. Been using HA about a year and this is really my first time diving into YAML configs. I’ve been trying for about 2 hours to get this to work and idk what I’m doing wrong.

Basically I have a need coming up to trigger something if wind speed exceeds a certain threshold. To do this without buying wind speed sensors (the need is not precise), I figured I would use the Meteorologisk institutt integration that I already have been, as well as have a histogram of wind speed as a sensor card on my dashboard. This leads me to two tasks, neither of which is working properly:

  1. Update the polling interval of forecasts to every 15 mins
  2. Use templating to convert the wind speed entity to a sensor.

For #1 I have:

  • disabled automatic polling for the forecast entities.
  • double checked automation trace to confirm update.
  • Used the following YAML:
alias: Update Forecast Every 15mins
description: ""
triggers:
  - trigger: time_pattern
    minutes: /15
actions:
  - action: weather.get_forecasts
    target:
      entity_id: weather.forecast_home
    data:
      type: hourly
    response_variable: hourly_forecast
mode: single

Result: The trace comes back successfully as long as I have a variable defined, but it does not update the entities or the card.

hourly_forecast:
  weather.forecast_home:
    forecast:
      - condition: sunny
        datetime: '2025-06-29T00:00:00+00:00'
        wind_bearing: 291.7
        cloud_coverage: 0
        uv_index: 1.9
        temperature: 104
        wind_speed: 12.05
        precipitation: 0
        humidity: 11
      - condition: sunny
        datetime: '2025-06-29T01:00:00+00:00'
        wind_bearing: 274.8
        cloud_coverage: 0
        uv_index: 0.6
        temperature: 103
        wind_speed: 12.3
        precipitation: 0
        humidity: 11

etc....

For #2 I have:

  • Added template: !include templates.yaml to configuration.yaml
  • Confirmed there are not issues upon reboot in accessing this file
  • ‘templates.yaml’ contains the following, of which I copied the state portions from a different post. I do not really understand where to see the various forecast entities in the HA UI, as the State only seems to contain [0], or the present value. I cannot find the other [1-11] hours or whatever unless I run the automation and look at the trace.
- sensor:
  - name: "Wind Speed"
    unique_id: hourly_wind_speed
    unit_of_measurement: "mph"
    state: "{{ 'weather.forecast_home'.forecast[0].wind_speed }}"  

- sensor:    
  - name: "Wind Direction"
    unique_id: hourly_wind_direction
    state: "{{ 'weather.forecast_home'.forecast[0].wind_bearing }}"

Result: The sensor is able to be found as “sensor.wind_speed” (I’m not really sure why since shouldn’t this be “sensor.hourly_wind_speed”?) but the data just says “unavailable”.

I think you have confused a few things.

There is no connection between your automation and the sensors… You need a trigger-based template sensor that includes the weather.get_forecasts action for your sensors. Since they are both using the same trigger and response data it’s best to configure them both under the same sensor key.

#template.yaml
  - triggers:
      - trigger: time_pattern
        minutes: /15
    actions: 
      - action: weather.get_forecasts
        target:
          entity_id: weather.forecast_home
        data:
          type: hourly
        response_variable: hourly_forecast
      - variables:
          forecasts: "{{ hourly_forecast['weather.forecast_home'].forecast }}"
    sensor:      
      - name: "Wind Speed"
        unique_id: hourly_wind_speed
        unit_of_measurement: "mph"
        state: "{{ forecasts[0].wind_speed }}"  
      - name: "Wind Direction"
        unique_id: hourly_wind_direction
        state: "{{ forecasts[0].wind_bearing }}"

However, AFAIK calling weather.get_forecasts will not cause the integration to send an API request and update the data, it just retrieves locally cached data.