I have a pool robot that gets stuck on the stairs sometimes and I’d like to either power it off or receive a notification so that I can give it a nudge as quickly as possible to get it working again.
The good news is, when looking at the power pattern it’s easy to detect - for me as a human, that is.
From the image below it’s easy to see that the robot got stuck at around 10:21, and as soon as it did, it desperately tried to ‘free itself’ by franticly moving back and forth - without success. It just stayed in the same spot until the 2h of cleaning time ran out.
I already added a statistics sensor that looks at the average power usage over the last 5 minutes, but it doesn’t seem to be the right way to look at this because the value is not really outside the ordinary, it’s just more consistent at the top end of the normal values.
What you want is the inverse of a missing pulse detector. I don’t know how I would do it in an automation, but I could in Node Red.
Basically, every pulse above 125W would restart a timer. The timeout on the timer would be 2X the period between the pulses when the sweeper is stuck. In normal operation that timer would be off most of the time. If it is stuck then the timer would be true most of the time. So if it’s true for 3X or 4X of the timeout period, then the sweeper is stuck.
If you do figure it out in an automation, please share it.
Edit.
If you average the power over a few minutes, it will be higher if the sweeper is stuck.
The way I’d do this is to count the number of times the power usage goes over 120-something within a 5 minute interval. If more than x times (experimentally determined, 6 could be a starting point), then the thingy is stuck.
No clue how to do this with a HA automation or with Jinja. But with something like pyscript it’s trivial.
Thanks for the suggestions - it would probably easier to check if the value drops below 25W; looks like when the robot is stuck, it doesn’t do that at all.
This might result in a numeric trigger with an above 25 value - still, finding the right ‘for’ value might be a challenge.
Thanks - this might lead to a quicker discovery than the ‘below 25W’ approach.
I’ve set it up and will keep an eye on it - might take a while, though, because sometimes the PoolBot runs a week without getting stuck
Just set up the template sensor (had to change state: "{{ on }}" to state: 'on' for it to work) but once it got above 120W and the binary_sensor changed its state, it didn’t go back to ‘off’ - so I guess I either need another template sensor to turn it back off.
Unless there’s a way to get an ‘else’ into the existing one to turn it back off once the power consumption falls below 120W.
This also means, of course, that the counter got stuck at 1and never increased or decreased again.