Get the hourly weather forecast in an automation trigger

Hello,

I want to trigger an action when there is snow in weather forecast. Just to stress, not when it’s currently snowing, but when it is going to snow.

I have a weather entity tuned to the Norwegian weather bureau, and when I click it in the overview dashboard I can see the daily and hourly forecast with the future weather icons.

If I got to the source of the weather forecast data from the rule engine and was able to run regexps, as a former programmer I’d manage to trigger the automation, but as a Home Assistant beginner I have no idea how to do it.

Or is there an official rule editor GUI buttons somewhere to browse the hourly forecast to use in a trigger?

look at the state and attribute info for that weather entity. go to dev-tools->states to find it. see if you can find the forecast in there or in any of your entities. if you don’t see it there, you might end up needing to create a forecast sensor.

when when you find it, then you trigger off that state or attribute. in the gui, create and automation, choose trigger state. fill that out…

so first, take a look in dev tools and see what you can find. then circle back here and we can take the next step…

The Met.no integration does not break out forecast data to sensors, so you will need to use the weather.get_forecasts action to retrieve it. If you do a search for that action on these forums, you will find plenty of examples.

To accomplish your goal you have two main options:

  1. As @armedad posted above, create a trigger-based template sensor whose state can act as your trigger for the automation.
  2. Use a time pattern trigger in your automation, run the weather.get_forecasts action and parse it’s response in a template condition to decide if the desired action is executed.