I’ve just written an automation so that when the house is empty, the vacuum with clean a predefined set of rooms. So in the example below it will clean the toilet, porch and kitchen for me. Before cleaning each room it will check it has 20% battery left and after cleaning the room it will update a date time helper for me so that I know what the room was last automatically cleaned
I’m struggling however to add in conditions that it only cleans a specific room if it’s not been cleaned within the last x hours.
There is an automation that will return the vacuum to dock of we come back home. So if it has cleaned the toilet and porch, then we return home. If we leave again for period later on, the automation should check the last time the toilet and porch were cleaned and ignore these, since they are already clean, but it should start from the kitchen and clean this for us.
After a few more tweaks, I have got my automation just how I want it so im sharing the final code below
I added in some extra bits and bobs - it will now try and trigger hourly, as well as when we go out. However, the condition that we are out is added also so it doesnt bother us if at home. I did this so that if we went out early and it had cleaned witin the last 12 hours, it will not run, but will then recheck on the hour.
I also updated an input_text with the rooms cleaned and then format and send this when we come home so that we know which rooms have been cleaned.