Trig automation when weather forecast is predicting - degrees

Hello,
I am looking for a simple way to trigg automation when the weather forecast predicts a pre-defined temperature. The reason is that I need to heat water with a fire stove a bit in advance.
Is there are simple way to achieve this for a noob like myself?

You have to first integrate a weather entity. If you have any specific weather prediction service, you can look up for that in HA integrations. Check this link for the services available.


If you are done with this, there will be entities with weather details, one will be with temperature. Then we can start with automation. This is simple in UI. First go to configuration> automations>create new automation.
Give it a name
then in trigger tab select numeric state as the trigger type. Select the entity that gives the temperature and select target temperature.
Fill the actions tab for what tasks to perform when the automation is triggered.

I know its may not be so comprehensive but you can always ask if you want more help.

Thanks a lot.
I have added the SMHI integration and like to trigg automation when forecast attribute is below 0.
In the developer tools I can see this below for a few days.
I like ti trigger the automation if forecast is below zero.
Can this easily be done?
The best would be to trigg on the “day after tomorrow” so I get a bit of heads up :slight_smile:

temperature: 1
humidity: 76
pressure: 1014
wind_bearing: 202
wind_speed: 17
visibility: 50
attribution: Swedish weather institute (SMHI)
forecast:
  - datetime: '2021-01-18T16:00:00'
    temperature: 1
    templow: 0
    precipitation: 0.1
    condition: cloudy
  - datetime: '2021-01-19T12:00:00'
    temperature: 3
    templow: 0
    precipitation: 5.5

Just use this a template for triggering the automation.

{{ state_attr('weather.smhi_sweden', 'forecast')[2]['temperature'] <= 0}}

Please change the entity id(weather.smi_sweden) to your entity_id. This template will check if the temperature forecast for day after tomorrow is below or equal to 0. If today is 18th, this will check if the temperature of the 20th. Hope you can build your automation now. If you need help just let me know.

Thanks a lot mate - I got it to work in the developer tool template but cant figure how to put this in the automation UI.
I tried this but pure guessing…


Can I use template directly from the UI?
Again thanks for great support!

You have to select template as trigger style. check this image
image

Also if you dont give any condition for time, the automation will trigger at mid night as the data change of the sensor might happen at midnight.

1 Like

Thanks a lot.
This was very helpful and now I think I am good to go :smiley:
Again thanks!