I have a Samsung Robot vac that I can schedule (natively) to run at X time daily. The flaw here is that I’d prefer it run while I’m away…if that happens (I work from home - even pre-COVID), but need to force it at some point (even if I am home).
I started creating rules for this but ultimately I need to know if the house hasn’t been vacuumed in X hours. I can see the state of the vac, and if it stays “charging” for 18 hours (for example) run through the other criteria. This would work except any deviation from normal (briefly including turning off the power to clean the filter, a weekly job) throws that off as the value changes.
So I started thinking I could compare the last time one of these rules ran (since none of the properties I can get to from Sharptools definitively say that the unit is done with a cleaning) by writing that to a variable.
Problem 1 is that the only thing I’ve found that has anything like the current time is my Ecobee, and I can’t get to that key in order to set it as a variable. If Sharptools could have a global variable (for example) that always showed the time/date, or a variable type with the current time (from which I could select a format), that would help.
Problem 2 is that even if I have the time set as a variable, and I use that to “timestamp” when the vac runs, I don’t have logic to compare one time to another.
Another possible solution would be rule logic to determine if something has stayed X for X time. In other words, I can now look for stays state == charging for 8 hours, but I can’t look for stays state == charging for 8 hours in past 10 hours.
I know this one is complicated, so I am hoping someone has a better idea than I do, as the user story is pretty reasonable:
As the resident I want to the vacuum to run if it hasn’t completed a cleaning in the past X hours.