Hourly Forecast Average as Automation Trigger

Hi,
I’m new to HA, and I’ve been wrecking my brain on how to get an automation to work.
On a certain time of the day, I want the average hourly temperature from sunrise to trigger My Boiler if it is under a certain threshold.

Nothing I’ve tried works, so I’m basically starting fresh.
Any Ideas?

You can do that by creating a statistics sensor.

I have created something similar myself based on the average outdoor temperature over the last four hours:

sensor:
  - platform: statistics
    name: "Outdoor temperature average"
    entity_id: sensor.thermostaat_wk_outdoor_temperature
    unique_id: sensor.thermostaat_wk_outdoor_temperature_average
    state_characteristic: average_linear
    max_age:
        hours: 4

There is documentation on how to do this, somewhere :wink: . There you can find out if it is possible to use sunrise as a limit for the average. It may require some jinja template programming.

Testing against the threshold can be done in the automation.

Thanks, but I think I need a little more help.
I think once I figure out how to create a sensor which will average the relevant weather readings, the rest will be pretty easy.

The code I provided is the definition of the sensor that provides a 4 hour average. You can include it in your config file, preceded by the ‘sensor:’ line. The ‘entity_id:’ should refer to the input sensor in your system that provides the outside temperature reading. In my system for example, this outside temperature reading is provided by the Honeywell thermostat integration.

You may want to look into the documentation for the ‘Statistics’ Integration.