Hi:
I have some routine that I’d like to automate with Home Assistant. One example of schedule my vacuum robot with the steps below:
Start vacuum the house
With for the vacuum completes and return the charge station
Wait for charging to 85% or until 12:30
Start mopping and wait for complete
Send notification when all is done.
I only want to do mopping when the full house vacuum was done previously, hence the script is “stateful”. The questions is, is it good idea to use script for the long running task like this? The cleaning takes 8 hours and if HA restart in between does the script continues or reset?
Many thanks in advance!
Best practice is “not”. Have two automations (or two triggers in the same automation): one to start things off, and one to recognise when done and close things down.
You can maintain entities to track state: perhaps an Input Text or Input Number.
Thanks for your advice! I need to rethink how this could be implemented. It’s like a state machine, do A then B and C, C should not start unless A and B are done. I think using a helper track state seems to be the easiest solution. Thanks again!
Ok I think one way to do so without introducing helper is to have automation to control A, B and C. If A runs, enable B and C etc. Turn off B and C at daily basis.