So I have a couple of pumps on automation that switch on and off after a specified duration.
The switches are all Tuya devices and I am using LocalTuya. LocalTuya seems to be having some issues as some switches are constantly cycling between unavailable and available.
One of my pumps became unavailable a couple of seconds before it was supposed to switch off and it was on till the next pump automation time kicked in.
I want a master kill automation that switches the pump off if it’s on for beyond x minutes.
This is the automation I have created, any inputs are welcome
I’m sorry, I meant to say, the device cycles every 30 secs between available and unavailable. In case the off call coincides with the unavailable time, will it reset the counter for 3 mins?
When the switch turned on, the automation wait for 3 mins to switch the switch off again.
What you can try to do is, when the device toggles between available and unavailable, add “unavailable” to the “to:” state.
Every time when the switch goes to “on” or “unavailable” the automation will start and will wait 3 mins before it switched off the switch.
Thus, in case the off call coincides with the unavailable time, it will restart the counter for 3 mins.
You could also implement a wait, which waits for 1 minute if the pump is unavailable and continue if it gets on again.
Not sure about the on in the wait template, you have to look which state it has when it is available.