Hello!
Can you help with one small problem?
I’m using HA + RaspPi1+ IFTTT to control my Xiaomi vacuum through the Google Home.
I’ve created some scripts to clean specific parts of my first floor (kitchen, hall, etc.).
From time to time I’m taking the vacuum to the second floor - after this my map is recreated and when I come back to first floor I need to recreate the map again.
Because my first floor is mainly open I want to create a script (or rather sequence):
1.start cleaning (vacuum.start)
2. stop/pause cleaning after 2 minutes (?)
3. go back to the dock (vacuum.return_to_base)
This will create a sufficient map to perform spot cleaning through Google Home.
That can work, but you can probably do it a lot easier in a script with a delay. I don’t know the specifics for steps 1 & 3, but it would look something like this:
The steps of a script sequence are executed in the order specified. So the first service (vacuum.start) is started, then the delay starts, and after the delay completes, the second service (vacuum.return_to_base) is started. Does that answer your question?
What determines when the vacuum finishes? And is that when you want to start the delay, or do you want the delay to start once the vacuum has started?
Again, the steps of a sequence happen in, well, sequence. The delay will not start until the service call from the previous step has completed. It depends on the particular service whether or not it completes before or after the call completes. In many cases there is at least some portion of the service (or side effect of the service) that continues in parallel with the script after the call completes. I suspect in this particular case, the call completes almost immediately, whereas the vacuuming (initiated by the service call) continues for some time.
BTW, if you wanted to wait until the vacuuming finished, you could probably do that, too, via a wait_template.