akrea
(Akrea)
January 2, 2023, 11:04pm
1
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
finity
January 3, 2023, 3:32am
3
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.
akrea
(Akrea)
January 3, 2023, 11:03pm
4
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!
finity
January 4, 2023, 1:05pm
5
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.
ncd
February 27, 2024, 11:46pm
6
Wow what an interesting integration!! thanks PeteRage!
The caveat on non-time based windows coupled with longer retention periods is well noted!