Okay, no luck. Same as reported - it will commence the next zone after it has redocked.
Has anyone managed to get zone cleaning to work with IFTTT with # amounts of cleaning?
Like this guide for example https://hackernoon.com/how-i-set-up-room-cleaning-automation-with-google-home-home-assistant-and-xiaomi-vacuum-cleaner-9149e0267e6d
I have followed the guide and the google assistant responds with the correct phrase but it does not start the cleaning. The logbook says Error while executing automation automation.ifttt. Invalid data for call_service at pos 1: Service does not match format <domain>.<name>
that guide is based on old IFTTT method
i think you are using webhooks and IFTTT integration? then the commands are different
@ciB is “we cannot use lists (which the coordinates are) in templates.” that still the case ? I mean now that xiaomi_clean_zone
has been added to HASS or that has nothing to do with it ? I am just trying to figure out how much is still the case so i can start making my zones.
Since the coords are still passed through the data field, this rule still applies - unless they have added that templates can actually render lists (as far as I know they still only return Strings).
Looking at the document i see they provide the coordinates on the data_template : https://www.home-assistant.io/components/vacuum.xiaomi_miio/ but i guess that still does not make a difference ?
Can you give an example of what you want to achieve?
I have tried your solution, i know it’s a long time but for me the vacuum cleaner goes back to the dock after first zone cleanup instead moving to the next zone, i thought it was because the state was never set to Returning home
but it does but the wait_template
does not react to it for some reason. The first wait_template
where it checks for idle
works fine since it continues.
test_clean:
alias: "Vacuum kitchen"
sequence:
# Go to starting point
- service: vacuum.send_command
data:
entity_id: vacuum.xiaomi_vacuum_cleaner
command: app_goto_target
params: [24950,25500]
#Wait untill done
- wait_template: "{{ states.vacuum.xiaomi_vacuum_cleaner.attributes.status == 'Idle'}}"
#clean room
- service: vacuum.send_command
data:
entity_id: vacuum.xiaomi_vacuum_cleaner
command: app_zoned_clean
params: [[23961,27821,24461,28321,1]]
#Wait untill done
- wait_template: "{{ states.vacuum.xiaomi_vacuum_cleaner.attributes.status == 'Returning home'}}"
- service: vacuum.send_command
data:
entity_id: vacuum.xiaomi_vacuum_cleaner
command: app_zoned_clean
params: [[24803,27020,25303,27520,1]]
Any ideas why it doesn’t work ?
While the vacuum is returning home it will not accept any New zoned clean ups. Try stopping it first, that might work. What you can do anyway is to add and pass all the zones in one list, the vacuum will then automatically do all the zones one after the other.
@ciB thank you, Yes i was thinking it might be because of that, i will try. The reason i wanted to do this was to see how far i can get automating / scripting a specific way the vacuum should do things also to help it with app_goto_target
since i did see that in some cases it would give up on some zones but it would work i used app_goto_target
to a point close to the zone then ask it to do clean up zone.
- Out of curiosity do you know if the vacuum respects the order the zones are given or it does it random ?
- Also do you know when given multiple zones does it then return back to the dock or does it continue to next zone ?
@ciB
I tried to send the vacuum.stop
after the wait_template
that checks for Returning home
but it doesn’t care. It just goes back to the dock.
So i got it to work i thought using vacuum.pause
for a moment but then when i tried again the script it failed to pause so it went back to the dock. I think it’s Xiaomi API that for most of the times it fails.
I have been using the multiple zoned cleaning for months via Node-RED without any problem. The key is the catching of the robot during paused state. e1miran also uses the Node-RED with other way on hihger level.
The working of my solution is the following: first I select the rooms after it start the zoned cleanup.
In this way the robot has a short break during paused state because of the HA discovery (0-10 s).
I am unsure exactly what it is but i have indeed tried with timeout to give it some time like this :
script
test_clean:
alias: "Vacuum kitchen"
sequence:
# Go to starting point
- service: vacuum.send_command
data:
entity_id: vacuum.xiaomi_vacuum_cleaner
command: app_goto_target
params: [24950,25500]
- service: input_number.set_value
data:
entity_id: input_number.vaccum_progress
value: 1
#Wait untill done
- wait_template: "{{ states.vacuum.xiaomi_vacuum_cleaner.attributes.status == 'Idle'}}"
- service: input_number.set_value
data:
entity_id: input_number.vaccum_progress
value: 2
#clean room
- service: vacuum.send_command
data:
entity_id: vacuum.xiaomi_vacuum_cleaner
command: app_zoned_clean
params: [[22572,28094,23072,28594,1]]
- service: input_number.set_value
data:
entity_id: input_number.vaccum_progress
value: 3
#Wait until done
- wait_template: "{{ states.vacuum.xiaomi_vacuum_cleaner.attributes.status == 'Returning home'}}"
timeout: '00:00:30'
continue_on_timeout: 'false'
- service: input_number.set_value
data:
entity_id: input_number.vaccum_progress
value: 4
#Stop going home so we can tell it to clean next zone
- service: vacuum.pause
data:
entity_id: vacuum.xiaomi_vacuum_cleaner
- service: input_number.set_value
data:
entity_id: input_number.vaccum_progress
value: 5
#Wait untill done
- wait_template: "{{ states.vacuum.xiaomi_vacuum_cleaner.attributes.status == 'Paused'}}"
timeout: '00:00:30'
continue_on_timeout: 'false'
- service: input_number.set_value
data:
entity_id: input_number.vaccum_progress
value: 6
- service: vacuum.send_command
data:
entity_id: vacuum.xiaomi_vacuum_cleaner
command: app_zoned_clean
params: [[24803,27020,25303,27520,1]]
- service: input_number.set_value
data:
entity_id: input_number.vaccum_progress
value: 7
As far as i can see the robot does change it’s state in HASS since i am looking at the state during the script run but when HASS tells it to stop
or pause
it’s ignoring it so i don’t believe it to be a problem that the state is delayed.
I don’t know what is the problem with HA automations. But I know that my solution is working. I guess this is enough and the most important thing if I’d like to use the multiple zoned cleanup.
It has to be considered that we want to try to control the automation of the robot with an other HA automation.
Ok i found the problem, now it works. The problem was that i had the timeout: '00:00:30'
seconds which i had interpreted in wrong way since wait_template
will start counting the timeout as soon as the command app_zoned_clean
is sent so it counts including the clean time. I have them increased the timeout so big it should not run into this issue but still cancel the script at some point if everything fails.
could you use two seprate wait_templates, or just use “delay”? I have never used them, but could this work/fix your problem?
#Wait until done
- wait_template: "{{ states.vacuum.xiaomi_vacuum_cleaner.attributes.status == 'Returning home'}}"
continue_on_timeout: 'false'
#wait 30 seconds
- delay: '00:00:30'
Regarding your earlier questions, yes the vacuum respects the order of the zones given, so the first zone in the list is always the zone it starts with. It also automatically just moves to the next zone after it has finished one (seemlessly, so no sound or anything).
Yes that is another solution but if you do that and the vacuum does not get to that state then the script will hang forever and may cause issues next time or if you want to reload scripts so i prefer the one with long timeout.
Great that it takes into account the zones order. Some more questions which you may know the answer to :
- If one mounts the mop container and tells the vacuum to vacuum and NOT mop will it lift the mop up to not touch the floors ?
- If one asks the vacuum to mop i assume it also vacuums at the same time right ?
- no, with the attached mob it will always mob (the robot does not even know its mobbing)
- only if you set the fan speed to mobbing it will turn off the vacuum (I believe, never actually tested it) - I usually just let it vacuum and mob at the same time, see no reason why not to.
lol i was not aware of that, good to know
Oh i see then yes you are right, it might as well just vacuum at the same time.
Thank for the reply