Continuous 30 min average

Hi

I have, in my opinion, simple need, which does not seem to have a simple implementation:

Scenario: When the average wattage draw over the last 30 minutes is below threshold, switch off.

I encoutered the site templating yet it seems a bit of an overkill to me - is there a simpler way to achieve this?

If you could point me in the direction of “simplicity”, I would be greatful.
thx

Use time moving simple average

1 Like

there is also an “average” sensor available in HACS that I use for pretty much the same use case (turn off a battery charger when the average power is below a value) and it works well.

Hi

Thanks for the help. I discovered the trigger on numeric_state which has a timer… It does not calculate the average but when the threshold is a bit higher to include peaks, it should work too.

trigger:  
 - platform: numeric_state
    entity_id: sensor.schalt_mess_steckdose_power
    for:
      hours: 0
      minutes: 20
      seconds: 0
    below: 75

Not sure why I missed this one the first time…

Thank you anyway!

Be aware that if you restart HA at any time in that 20 minute window the automation will not run.

I never use delay, for, etc in HA for longer than 5 minutes (acceptable fault tolerance) for anything that is important.

Wow what an interesting integration!! thanks PeteRage!
The caveat on non-time based windows coupled with longer retention periods is well noted!