#Smart plug turn off after power draw exceeds 500W for 5Hr & 15mins
1 messages · Page 1 of 1 (latest)
Please see #best-posting-practices message for posting automations.
But at first glance, I see noting wrong. Although I'm missing a usable time scale on the graph, the pulses seem long enough... But do note it will not work is HA is restarted of the devices become unavilable/unknown within that 5:15
agreed however it has not seemed to trigger yet.
also how can I get a power time history with a time scale? I can zoom in but it's not exact....
I think I figured it out. Michael pointed out this person's smart plug (https://discord.com/channels/330944238910963714/1395480398804553778) may need to use a numerical state trigger instead - will try that as well
No idea why it doesn't work with power changes trigger.
Yeah, I also like state triggers way more then device triggers. But they should do exactly the same.
And please please, have a read about posting yaml instead of stupid images 🙂
And for the graph, was this a graph card? You could look at it, as zoomed in as possible, via History. When I select a range of around a day I also have thicks every 6 hours.
It was just history - just measured it like so:
description: ""
triggers:
- trigger: numeric_state
entity_id:
- sensor.test1_power
for:
hours: 5
minutes: 15
seconds: 0
above: 500
- type: power
device_id: 07b72353de8d5ec2f88e874f0e223d8f
entity_id: aa28683df7e33663b8a62fe30772a7db
domain: sensor
trigger: device
above: 500
for:
hours: 5
minutes: 15
seconds: 0
enabled: false
conditions: []
actions:
- type: turn_off
device_id: 07b72353de8d5ec2f88e874f0e223d8f
entity_id: 7a626317c5aa0b9ab2b788f0bf5f3756
domain: switch
mode: single
ah I see one thing that is strange - it is still showing up as test1 when I renamed it to Water Distiller after my initial configuration
I see the actual issue I think - I am getting a restart every time my home assistant is choosing to backup right in the middle of my water distiller shutoff automation checking for power within that 5 hours and 15 minutes.
@clever gate I was hoping you could give a suggestion on backup not interrupting the automation? I am thinking I need another automation for daily backup to wait until any pending automations are done and finish before any daily automations are scheduled
Are you using the HA backup? Or external (like Docker or VM backup)?
This is within HA
Not running docker atm will eventually on a more robust hardware (currently just the pi5)
Use a history stats helper to sum the total time on since midnight.
or something like that
One way I can think of is to use the automaton to set the switch to on and a helper to indicate the date / time to turn it off. You then have a second automation that runs periodically and checks if the helper date/time has expired (ie. < now()).
you could set it to 5 hours and 5 minutes and if it's 100%, trigger (or above 99%)
hmmm I'll think about these things - I didn't want our switch being on to be a condition to turn it off you know. I've never used a helper though so I may be missing something.
I was thinking of setting backup to check each individual automation I have running that would run through the night and then if nothing is triggered allow backup if not wait til it finishes for backup
But that would get painful for new over night automations - just keeping track of it etc
I could use tags I guess.
can I check if a tag has an automation pending somehow?
Let me look into helpers in the mean time.
So a bit of research later - I get it now - so helpers allow you to store variables in HAOS which you can then call in automation. Good stuff!
Ok going to test it tonight! TY guys! Both of your answered helped a lot, may try the history approach next time 😛
1 created a helper to store the date and time after a minute of the distiller being over 500W
2 made my automation two automations.
1 to store the date and time now()
2 the second to compare the stored value and shutoff the plug