I’m using HA since around 1 1/2 years, nevertheless I’m quite new to stuff like automation.
I’ve some of them running now and they’re doing their job well, however, this time I’m struggling.
What I want to achieve is the following:
A device connected to a Shelly Plug S shall be switched off automatically once the measured power consumption is below a certain value (e.g. 14W) for a certain amount of time (e.g. 30 minutes).
On the contrary, it shall not switch off when its power consumption is above that value.
Since the “For” option in an automation would not survive a restart of HA, which is likely to happen in my case, I need some alternative and I think it can be managed by using a template.
But I’ve no clue yet how to do it, even after reading about this stuff.
There are some other posts with temp store=ing values and they seem to point to : store this in input_number but I am not sure what precisely you think to loose from a restart unless you want to be very exact on the 30 mins and how often you restart (why?)
I thought that such a “For” timer would not survive any restart of HA.
But if that’s not the case and it would be only skipped in case HA gets restarted in the moment of where such a timer would countdown, then it’s OK for me.
Usually my HA only reboots during late night three times a week because of automated backup job.
Just to be clear, I do understand that automations are cancelled/restarted but… in this case my assumption (!) is that it would still be able to identify how long the state was set. So, with a restart, it would find the state ‘on’(example) and still be able to deduct it was on before the restart…as the last_update/changed does not alter with a restart
Just setup my dev-env + restart and I indeed stand corrected (so: THANKS) and regardless of my use/expectations … my only ‘excuse’ is that I never had a need for this situation…not sure how to deal with this now as I also restart HA a couple if times a week when new stuff arises…will contemplate anew