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:
- Update the polling interval of forecasts to every 15 mins
- 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”.