Howto: Xiaomi vacuum zoned cleaning

I believe that it passes the first command (in your case, go to coordinates) and immediately checks for the wait condition. The vacuum status remains as idle for several seconds after you pass the first command - I guess booting up and so forth - and so the wait is immediately satisfied and it passes the next command. At least, that’s what I worked out. Making a double wait command solved it (wait for idle after waiting for returning) but obviously your timeout fix works too.

- wait_template: "{{(is_state('vacuum.xiaomi_vacuum_cleaner', 'returning'))}}"
- wait_template: "{{ (is_state('vacuum.xiaomi_vacuum_cleaner', 'paused')) or (is_state('vacuum.xiaomi_vacuum_cleaner', 'idle')) or (is_state('vacuum.xiaomi_vacuum_cleaner', 'docked'))}}"
- service: vacuum.send_command

I’ve tried the two wait_template instructions in a script used to reconstruct the map with go_to_target commands. Some times it doesn’t work when the vacuum reach the target in less than 10 seconds (according to my experience). In this case the status is never set to cleaning and the first wait_template is never true.

I never found a clean way of doing it.

I’m looking for your experiences. Now I’ve a lot of scripts to manage a daily sequence of zones cleaning. Sometime the vacuum pause the current zone to charge on the dock and resume after reaching 80% of battery.
Have you a way to differentiate when “the vacuum is docked because the previous task is completed” or “the vacuum is docked to charge the battery with current task not yet completed” ?

The wait_template instruction base on docked states is not efficient in this case.

the battery status of the vacuum is saved as an attribut of the vacuum entity. You could check its battery level via a template - I’m not sure when the vacuum actually returns to the base (you would have to figure this out), but let’s assume at 20%, then you could use a template like this:

{% if states.vacuum.[vacuum_name].attributes.battery_level > 20 %}
Not going to charge
{% else %}
Going to charge
{% endif %}

I will try something like that. From my experiences, triggers are:

  • < 20% interrupt current task and go to docking station
  • > 80% can resume previous task

Hello,
would you mind share your code for multiple selection of rooms and then execute with start button?
Thanks

Incase anybody else is looking for how to think with the coordinates:
Let me empty my head:

      params: [[28000,14000,30000,18000,1]]

28000 = first x value (left side of your box)
14000 = first y value (bottom of your box)
30000 = second x value (right side of your box)
18000 = second y value (top of your box)

1 Like

It’s more bottom left corner of your box and top right corner of the box, but whatever works best for you :slight_smile:

1 Like

Yeah couldnt get my head around the corner business so after alot of trial and error i found a way for me to understand better :slight_smile:

1 Like

@krovachek can you paste the JSON of your Node Red flow? I am going to set mine up the same way by selecting rooms the clean, but don’t want it to do the “clean” fuction where it deletes the map.

My config is available on GitHub.
I’m working on the wiki to give some detailed explanations. I will do a dedicated post on the forum when the wiki is mature enough.

The entry point of my automation is in launch_vacuum_each_workday.yaml file

2 Likes

masterfink, # Ev_Gueni this is the code:

[{"id":"e6609cb9.e55cd","type":"server-state-changed","z":"d79d6bcd.489e88","name":"start","server":"820ae6a6.7f40a8","entityidfilter":"input_boolean.zone_cleaning","entityidfiltertype":"substring","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"x":110,"y":260,"wires":[["613c23f4.ed50ec"]]},{"id":"613c23f4.ed50ec","type":"switch","z":"d79d6bcd.489e88","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":290,"y":260,"wires":[["8fedb0f.648f15","fb5ce93a.a72d28","19a800b8.43e87f","a33838fc.59e268","aa845e5c.06c0e","cb540a1.2a556f8","be57288d.6dffe8"]]},{"id":"aa845e5c.06c0e","type":"api-current-state","z":"d79d6bcd.489e88","name":"living room on?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.living_room_cleaning","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":560,"y":160,"wires":[["3c26a1f0.014cbe"],[]]},{"id":"3c26a1f0.014cbe","type":"api-call-service","z":"d79d6bcd.489e88","name":"living room cleaning","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"xiaomi_clean_zone","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"repeats\":\"1\",\"zone\":[[21575,24539,26125,29889],[25331,24711,28131,28561],[20257,23807,25857,24707]]}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":780,"y":160,"wires":[[]]},{"id":"2df68177.7a74ae","type":"api-call-service","z":"d79d6bcd.489e88","name":"bedroom off","server":"820ae6a6.7f40a8","service_domain":"input_boolean","service":"turn_off","data":"{\"entity_id\":\"input_boolean.bedroom_cleaning\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":1270,"y":160,"wires":[[]]},{"id":"71586ac1.9f2d04","type":"api-call-service","z":"d79d6bcd.489e88","name":"bedroom cleaning","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"xiaomi_clean_zone","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"repeats\":\"1\",\"zone\":[[18720,19114,21770,23514]]}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":770,"y":220,"wires":[[]]},{"id":"cb540a1.2a556f8","type":"api-current-state","z":"d79d6bcd.489e88","name":"bedroom on?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.bedroom_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":550,"y":220,"wires":[["71586ac1.9f2d04"],[]]},{"id":"5e171e48.95fe8","type":"trigger-state","z":"d79d6bcd.489e88","name":"paused?","server":"820ae6a6.7f40a8","entityid":"vacuum.xiaomi_vacuum_cleaner","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"id":"pq55xe30min","targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"paused"}],"constraintsmustmatch":"all","outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","x":120,"y":180,"wires":[["8e2573b9.7fe2c"],[]]},{"id":"8e2573b9.7fe2c","type":"change","z":"d79d6bcd.489e88","name":"send on","rules":[{"t":"set","p":"payload","pt":"msg","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":180,"wires":[["613c23f4.ed50ec"]]},{"id":"e22d9464.5cf5a8","type":"api-call-service","z":"d79d6bcd.489e88","name":"girls room cleaning","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"xiaomi_clean_zone","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"repeats\":\"1\",\"zone\":[[25014,19161,28214,23761]]}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":770,"y":280,"wires":[[]]},{"id":"3ceb4ea2.8a5332","type":"api-call-service","z":"d79d6bcd.489e88","name":"girls room off","server":"820ae6a6.7f40a8","service_domain":"input_boolean","service":"turn_off","data":"{\"entity_id\":\"input_boolean.girls_room_cleaning\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":1270,"y":220,"wires":[[]]},{"id":"a33838fc.59e268","type":"api-current-state","z":"d79d6bcd.489e88","name":"girls room on?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.girls_room_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":560,"y":280,"wires":[["e22d9464.5cf5a8"],[]]},{"id":"b9fc0a4c.a46b98","type":"api-current-state","z":"d79d6bcd.489e88","name":"living room off?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.living_room_cleaning","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1040,"y":160,"wires":[["2df68177.7a74ae","7939bec8.81c8b"],[]]},{"id":"7939bec8.81c8b","type":"api-current-state","z":"d79d6bcd.489e88","name":"bedroom off?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.bedroom_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":1030,"y":220,"wires":[["3ceb4ea2.8a5332","c293ec04.e9ddf"],[]]},{"id":"c293ec04.e9ddf","type":"api-current-state","z":"d79d6bcd.489e88","name":"girls room off?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.girls_room_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":1040,"y":280,"wires":[["1b074923.da4807","9fcebf3b.24213"],[]]},{"id":"d1d342d5.20c8a","type":"api-call-service","z":"d79d6bcd.489e88","name":"zone off","server":"820ae6a6.7f40a8","service_domain":"input_boolean","service":"turn_off","data":"{\"entity_id\":\"input_boolean.zone_cleaning\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":1260,"y":460,"wires":[[]]},{"id":"93d5ab01.9642d8","type":"api-call-service","z":"d79d6bcd.489e88","name":"middle room cleaning","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"xiaomi_clean_zone","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"repeats\":\"1\",\"zone\":[[21848,19087,24798,23587]]}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":780,"y":340,"wires":[[]]},{"id":"19a800b8.43e87f","type":"api-current-state","z":"d79d6bcd.489e88","name":"middle room on?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.middle_room_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":570,"y":340,"wires":[["93d5ab01.9642d8"],[]]},{"id":"1b074923.da4807","type":"api-call-service","z":"d79d6bcd.489e88","name":"middle room off","server":"820ae6a6.7f40a8","service_domain":"input_boolean","service":"turn_off","data":"{\"entity_id\":\"input_boolean.middle_room_cleaning\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":1280,"y":280,"wires":[[]]},{"id":"9fcebf3b.24213","type":"api-current-state","z":"d79d6bcd.489e88","name":"middle room on?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.middle_room_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":1050,"y":340,"wires":[["413b2a12.76b764","a1c74b48.6865d8"],[]]},{"id":"1006e52a.8e9bfb","type":"api-call-service","z":"d79d6bcd.489e88","name":"bathroom cleaning","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"xiaomi_clean_zone","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"repeats\":\"1\",\"zone\":[[18710,24972,21460,28072]]}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":770,"y":400,"wires":[[]]},{"id":"8fedb0f.648f15","type":"api-current-state","z":"d79d6bcd.489e88","name":"bathroom on?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.bathroom_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":560,"y":400,"wires":[["1006e52a.8e9bfb"],[]]},{"id":"413b2a12.76b764","type":"api-call-service","z":"d79d6bcd.489e88","name":"bathroom off","server":"820ae6a6.7f40a8","service_domain":"input_boolean","service":"turn_off","data":"{\"entity_id\":\"input_boolean.bathroom_cleaning\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":1270,"y":340,"wires":[[]]},{"id":"a1c74b48.6865d8","type":"api-current-state","z":"d79d6bcd.489e88","name":"bathroom off?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.bathroom_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":1040,"y":400,"wires":[["231081e8.acec7e","2babfe2f.500e52"],[]]},{"id":"c7cad44e.a5bfa8","type":"api-call-service","z":"d79d6bcd.489e88","name":"entrance cleaning","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"xiaomi_clean_zone","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"repeats\":\"1\",\"zone\":[[26041,23630,28341,24880]]}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":770,"y":460,"wires":[[]]},{"id":"fb5ce93a.a72d28","type":"api-current-state","z":"d79d6bcd.489e88","name":"entrance on?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.entrance_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":550,"y":460,"wires":[["c7cad44e.a5bfa8"],[]]},{"id":"2babfe2f.500e52","type":"api-current-state","z":"d79d6bcd.489e88","name":"entrance off?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.entrance_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":1030,"y":460,"wires":[["d1d342d5.20c8a","20e6fd74.854152"],[]]},{"id":"231081e8.acec7e","type":"api-call-service","z":"d79d6bcd.489e88","name":"entrance off off","server":"820ae6a6.7f40a8","service_domain":"input_boolean","service":"turn_off","data":"{\"entity_id\":\"input_boolean.entrance_cleaning\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":1280,"y":400,"wires":[[]]},{"id":"d827821d.9a9ba","type":"api-call-service","z":"d79d6bcd.489e88","name":"Return to base","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"return_to_base","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":1280,"y":520,"wires":[[]]},{"id":"20e6fd74.854152","type":"api-current-state","z":"d79d6bcd.489e88","name":"zone off?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.entrance_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":1020,"y":520,"wires":[["d827821d.9a9ba"],[]]},{"id":"be57288d.6dffe8","type":"stoptimer","z":"d79d6bcd.489e88","duration":"5","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":560,"y":100,"wires":[["3c724a78.5a9436"],[]]},{"id":"b9eee24f.0502a","type":"api-call-service","z":"d79d6bcd.489e88","name":"living room off","server":"820ae6a6.7f40a8","service_domain":"input_boolean","service":"turn_off","data":"{\"entity_id\":\"input_boolean.living_room_cleaning\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":1280,"y":100,"wires":[[]]},{"id":"3c724a78.5a9436","type":"api-current-state","z":"d79d6bcd.489e88","name":"living room?","server":"820ae6a6.7f40a8","outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.living_room_cleaning","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1030,"y":100,"wires":[["b9fc0a4c.a46b98","b9eee24f.0502a"]]},{"id":"fd954381.81f97","type":"trigger-state","z":"d79d6bcd.489e88","name":"cleaning?","server":"820ae6a6.7f40a8","entityid":"vacuum.xiaomi_vacuum_cleaner","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"id":"3p107e8yejh","targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"returning"},{"id":"vk9pzh79rgp","targetType":"entity_id","targetValue":"input_boolean.zone_cleaning","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"on"}],"constraintsmustmatch":"all","outputs":2,"customoutputs":[],"outputinitially":true,"state_type":"str","x":120,"y":340,"wires":[["a9f6733d.05191"],[]]},{"id":"a9f6733d.05191","type":"api-call-service","z":"d79d6bcd.489e88","name":"roberta stop","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"send_command","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"command\":\"app_pause\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":310,"y":340,"wires":[[]]},{"id":"820ae6a6.7f40a8","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]

Please wait with this, something goes wrong since the node-red updated. Or if you try it and solve the problem please inform me!

@masterfink, @Ev_Gueni I think this code is working now with the Node-RED version 3.1.2.
I recreated some setup (there are inversed now because of changed rules) and I guess it must be setup in order the sequences somehow, therefore I gave a sequence number to the input booleans and the names but I’m not sure what was needed for in this case.

`[{"id":"14a99751.6d8c99","type":"server-state-changed","z":"d79d6bcd.489e88","name":"start","server":"820ae6a6.7f40a8","version":1,"entityidfilter":"input_boolean.zone_cleaning","entityidfiltertype":"substring","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"x":150,"y":200,"wires":[["4e45ec2b.c119e4"]]},{"id":"4e45ec2b.c119e4","type":"switch","z":"d79d6bcd.489e88","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"false","repair":false,"outputs":1,"x":330,"y":200,"wires":[["65fc7b9f.9cbdf4","2a4758e2.2bd698","8c85761.64ce788","957f80a4.92d82","a1fc78a5.571e28","20c8cc3d.d47aa4","7f63bd3e.1b9174"]]},{"id":"2a4758e2.2bd698","type":"api-current-state","z":"d79d6bcd.489e88","name":"1_living room on?","server":"820ae6a6.7f40a8","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.1_living_room_cleaning","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":610,"y":100,"wires":[["31557cab.7e9f54"],[]]},{"id":"31557cab.7e9f54","type":"api-call-service","z":"d79d6bcd.489e88","name":"living room cleaning","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"xiaomi_clean_zone","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"repeats\":\"1\",\"zone\":[[25389,25195,28139,28495],[21711,24621,25361,29621],[20217,23635,25917,24635]]}","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":820,"y":100,"wires":[[]]},{"id":"abcc4162.11051","type":"api-call-service","z":"d79d6bcd.489e88","name":"bedroom off","server":"820ae6a6.7f40a8","service_domain":"input_boolean","service":"turn_off","data":"{\"entity_id\":\"input_boolean.2_bedroom_cleaning\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":1350,"y":100,"wires":[[]]},{"id":"13328114.44b0ef","type":"api-call-service","z":"d79d6bcd.489e88","name":"bedroom cleaning","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"xiaomi_clean_zone","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"repeats\":\"1\",\"zone\":[[18610,19205,21660,23655]]}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":810,"y":160,"wires":[[]]},{"id":"8c85761.64ce788","type":"api-current-state","z":"d79d6bcd.489e88","name":"2_bedroom on?","server":"820ae6a6.7f40a8","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.2_bedroom_cleaning","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":600,"y":160,"wires":[["13328114.44b0ef"],[]]},{"id":"4cffc8ae.bd2678","type":"trigger-state","z":"d79d6bcd.489e88","name":"paused?","server":"820ae6a6.7f40a8","entityid":"vacuum.xiaomi_vacuum_cleaner","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"id":"pq55xe30min","targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"paused"}],"constraintsmustmatch":"all","outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","x":160,"y":120,"wires":[["d8f5ad39.ab2c4"],[]]},{"id":"d8f5ad39.ab2c4","type":"change","z":"d79d6bcd.489e88","name":"send on","rules":[{"t":"set","p":"payload","pt":"msg","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":120,"wires":[["4e45ec2b.c119e4"]]},{"id":"efe170f7.e6dd3","type":"api-call-service","z":"d79d6bcd.489e88","name":"girls room cleaning","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"xiaomi_clean_zone","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"repeats\":\"1\",\"zone\":[[25014,19161,28214,23761]]}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":810,"y":220,"wires":[[]]},{"id":"288ab840.1471c8","type":"api-call-service","z":"d79d6bcd.489e88","name":"girls room off","server":"820ae6a6.7f40a8","service_domain":"input_boolean","service":"turn_off","data":"{\"entity_id\":\"input_boolean.3_girls_room_cleaning\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":1350,"y":160,"wires":[[]]},{"id":"957f80a4.92d82","type":"api-current-state","z":"d79d6bcd.489e88","name":"3_girls room on?","server":"820ae6a6.7f40a8","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.3_girls_room_cleaning","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":610,"y":220,"wires":[["efe170f7.e6dd3"],[]]},{"id":"c326d2fd.e442a","type":"api-current-state","z":"d79d6bcd.489e88","name":"living room off?","server":"820ae6a6.7f40a8","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.1_living_room_cleaning","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1120,"y":100,"wires":[[],["abcc4162.11051","d10e2d0e.dd9a6"]]},{"id":"d10e2d0e.dd9a6","type":"api-current-state","z":"d79d6bcd.489e88","name":"bedroom off?","server":"820ae6a6.7f40a8","version":"1","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.2_bedroom_cleaning","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1110,"y":160,"wires":[[],["288ab840.1471c8","b47b274c.f32808"]]},{"id":"b47b274c.f32808","type":"api-current-state","z":"d79d6bcd.489e88","name":"girls room off?","server":"820ae6a6.7f40a8","version":"1","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.3_girls_room_cleaning","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1120,"y":220,"wires":[[],["3a474091.6ffbf","e9ab48e4.36ceb8"]]},{"id":"206eac8b.16ba04","type":"api-call-service","z":"d79d6bcd.489e88","name":"zone off","server":"820ae6a6.7f40a8","service_domain":"input_boolean","service":"turn_off","data":"{\"entity_id\":\"input_boolean.zone_cleaning\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":1340,"y":400,"wires":[[]]},{"id":"d3ee2090.23d47","type":"api-call-service","z":"d79d6bcd.489e88","name":"middle room cleaning","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"xiaomi_clean_zone","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"repeats\":\"1\",\"zone\":[[21848,19087,24798,23587]]}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":820,"y":280,"wires":[[]]},{"id":"a1fc78a5.571e28","type":"api-current-state","z":"d79d6bcd.489e88","name":"4_middle room on?","server":"820ae6a6.7f40a8","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.4_middle_room_cleaning","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":610,"y":280,"wires":[["d3ee2090.23d47"],[]]},{"id":"3a474091.6ffbf","type":"api-call-service","z":"d79d6bcd.489e88","name":"middle room off","server":"820ae6a6.7f40a8","service_domain":"input_boolean","service":"turn_off","data":"{\"entity_id\":\"input_boolean.4_middle_room_cleaning\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":1360,"y":220,"wires":[[]]},{"id":"e9ab48e4.36ceb8","type":"api-current-state","z":"d79d6bcd.489e88","name":"middle room on?","server":"820ae6a6.7f40a8","version":"1","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.4_middle_room_cleaning","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1130,"y":280,"wires":[[],["65f41b24.e539c4","69a7e659.cc7f98"]]},{"id":"d7193a0a.139e28","type":"api-call-service","z":"d79d6bcd.489e88","name":"bathroom cleaning","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"xiaomi_clean_zone","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"repeats\":\"1\",\"zone\":[[18805,25050,21455,28150]]}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":810,"y":340,"wires":[[]]},{"id":"20c8cc3d.d47aa4","type":"api-current-state","z":"d79d6bcd.489e88","name":"5_bathroom on?","server":"820ae6a6.7f40a8","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.5_bathroom_cleaning","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":600,"y":340,"wires":[["d7193a0a.139e28"],[]]},{"id":"65f41b24.e539c4","type":"api-call-service","z":"d79d6bcd.489e88","name":"bathroom off","server":"820ae6a6.7f40a8","service_domain":"input_boolean","service":"turn_off","data":"{\"entity_id\":\"input_boolean.5_bathroom_cleaning\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":1350,"y":280,"wires":[[]]},{"id":"69a7e659.cc7f98","type":"api-current-state","z":"d79d6bcd.489e88","name":"bathroom off?","server":"820ae6a6.7f40a8","version":"1","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.5_bathroom_cleaning","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1120,"y":340,"wires":[[],["8be37710.5352c8","736f5708.9811c8"]]},{"id":"88095109.2d4b3","type":"api-call-service","z":"d79d6bcd.489e88","name":"entrance cleaning","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"xiaomi_clean_zone","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"repeats\":\"1\",\"zone\":[[26041,23630,28341,24880]]}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":810,"y":400,"wires":[[]]},{"id":"7f63bd3e.1b9174","type":"api-current-state","z":"d79d6bcd.489e88","name":"6_entrance on?","server":"820ae6a6.7f40a8","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.6_entrance_cleaning","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":600,"y":400,"wires":[["88095109.2d4b3"],[]]},{"id":"736f5708.9811c8","type":"api-current-state","z":"d79d6bcd.489e88","name":"entrance off?","server":"820ae6a6.7f40a8","version":"1","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.6_entrance_cleaning","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1110,"y":400,"wires":[[],["206eac8b.16ba04","a86cc243.9413c"]]},{"id":"8be37710.5352c8","type":"api-call-service","z":"d79d6bcd.489e88","name":"entrance off off","server":"820ae6a6.7f40a8","service_domain":"input_boolean","service":"turn_off","data":"{\"entity_id\":\"input_boolean.6_entrance_cleaning\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":1360,"y":340,"wires":[[]]},{"id":"211b1f6.39c96e","type":"api-call-service","z":"d79d6bcd.489e88","name":"Return to base","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"return_to_base","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":1360,"y":460,"wires":[[]]},{"id":"a86cc243.9413c","type":"api-current-state","z":"d79d6bcd.489e88","name":"zone off?","server":"820ae6a6.7f40a8","version":"1","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.6_entrance_cleaning","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1100,"y":460,"wires":[[],["211b1f6.39c96e"]]},{"id":"65fc7b9f.9cbdf4","type":"stoptimer","z":"d79d6bcd.489e88","duration":"10","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":610,"y":40,"wires":[["6d78b7c3.708f88"],[]]},{"id":"e9eb8e49.0cb6f","type":"api-call-service","z":"d79d6bcd.489e88","name":"living room off","server":"820ae6a6.7f40a8","service_domain":"input_boolean","service":"turn_off","data":"{\"entity_id\":\"input_boolean.1_living_room_cleaning\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":1360,"y":40,"wires":[[]]},{"id":"6d78b7c3.708f88","type":"api-current-state","z":"d79d6bcd.489e88","name":"living room?","server":"820ae6a6.7f40a8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.1_living_room_cleaning","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1110,"y":40,"wires":[["e9eb8e49.0cb6f","c326d2fd.e442a"]]},{"id":"bd1ece73.5e4c8","type":"trigger-state","z":"d79d6bcd.489e88","name":"cleaning?","server":"820ae6a6.7f40a8","entityid":"vacuum.xiaomi_vacuum_cleaner","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"id":"3p107e8yejh","targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"returning"},{"id":"vk9pzh79rgp","targetType":"entity_id","targetValue":"input_boolean.zone_cleaning","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"on"}],"constraintsmustmatch":"all","outputs":2,"customoutputs":[],"outputinitially":true,"state_type":"str","x":160,"y":280,"wires":[["977ed28e.9a077"],[]]},{"id":"977ed28e.9a077","type":"api-call-service","z":"d79d6bcd.489e88","name":"roberta stop","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"send_command","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"command\":\"app_pause\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","x":350,"y":280,"wires":[[]]},{"id":"820ae6a6.7f40a8","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]`

You send the clean command to all rooms each time it starts returning to the dock, does it not try to clean all rooms at once? Or does it start with the first command that can execute (input boolean is on) and then does that one room before returning to the dock?

1 Like

The robot returns to the dock if all marked room are done, at the end of the cleaning only. If the cleaning of first marked room is started then its own input boolean turn off. After the cleaning the robot gets a paused state when started to return to the dock, the sequence start again with the next swiched on input boolean.

I ended up doing mine this way, I used the “Wait Until” component to wait until the vacuum starts returning to move onto the next room. Just wanted to show a new way to make it work.

1 Like

Could you share the code, please?

Here is the code for my nodes.

[{"id":"1fc4237e.83e9bd","type":"ha-wait-until","z":"f36aaced.315eb","name":"Wait","server":"9e375a62.089ba8","outputs":1,"entityId":"vacuum.xiaomi_vacuum_cleaner","property":"state","comparator":"is","value":"returning","valueType":"str","timeout":0,"timeoutUnits":"seconds","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"x":1090,"y":940,"wires":[["374c5c1.44e0aa4"]]},{"id":"6f009f3f.44cb2","type":"trigger-state","z":"f36aaced.315eb","name":"Rover Cleaning","server":"9e375a62.089ba8","entityid":"input_boolean.rover_cleaning","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"id":"bxq0aou904n","targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"on"},{"id":"mu8k3qtqx2","targetType":"this_entity","targetValue":"","propertyType":"previous_state","propertyValue":"old_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"off"}],"constraintsmustmatch":"all","outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","x":120,"y":1300,"wires":[["b2087e37.12853"],[]]},{"id":"b2087e37.12853","type":"api-current-state","z":"f36aaced.315eb","name":"Dining","server":"9e375a62.089ba8","outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.vacuum_dining","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":490,"y":940,"wires":[["b1856aaa.e16f48"]]},{"id":"b1856aaa.e16f48","type":"switch","z":"f36aaced.315eb","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":650,"y":940,"wires":[["41bc4df9.90fdf4"],["79edaf8a.1dbf9"]]},{"id":"41bc4df9.90fdf4","type":"api-call-service","z":"f36aaced.315eb","name":"Clean Dining Room","server":"9e375a62.089ba8","service_domain":"vacuum","service":"xiaomi_clean_zone","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"repeats\":\"1\",\"zone\":[[20842,19361,25892,24361]]}","mergecontext":"","output_location":"","output_location_type":"none","x":830,"y":940,"wires":[["1fc4237e.83e9bd"]]},{"id":"709b244d.5291ec","type":"api-call-service","z":"f36aaced.315eb","name":"Turn Off Rover Cleaning","server":"9e375a62.089ba8","service_domain":"input_boolean","service":"turn_off","data":"{\"entity_id\":\"input_boolean.rover_cleaning\"}","mergecontext":"","output_location":"","output_location_type":"none","x":850,"y":1800,"wires":[[]]},{"id":"374c5c1.44e0aa4","type":"api-call-service","z":"f36aaced.315eb","name":"Pause Rover","server":"9e375a62.089ba8","service_domain":"vacuum","service":"pause","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\"}","mergecontext":"","output_location":"","output_location_type":"none","x":1250,"y":940,"wires":[["6216eece.ca46e"]]},{"id":"ef15c81b.f49e88","type":"api-call-service","z":"f36aaced.315eb","name":"Clean Guest Room","server":"9e375a62.089ba8","service_domain":"vacuum","service":"xiaomi_clean_zone","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"repeats\":\"1\",\"zone\":[[13989,29648,17239,33248]]}","mergecontext":"","output_location":"","output_location_type":"none","x":830,"y":1140,"wires":[["bf75d9d8.f7f0f8"]]},{"id":"59dc525b.5dbd5c","type":"api-current-state","z":"f36aaced.315eb","name":"Guest","server":"9e375a62.089ba8","outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.vacuum_guest","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":490,"y":1140,"wires":[["af21179.6cae7e8"]]},{"id":"af21179.6cae7e8","type":"switch","z":"f36aaced.315eb","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":650,"y":1140,"wires":[["ef15c81b.f49e88"],["42e136fa.af7668"]]},{"id":"bf75d9d8.f7f0f8","type":"ha-wait-until","z":"f36aaced.315eb","name":"Wait","server":"9e375a62.089ba8","outputs":1,"entityId":"vacuum.xiaomi_vacuum_cleaner","property":"state","comparator":"is","value":"returning","valueType":"str","timeout":0,"timeoutUnits":"seconds","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"x":1090,"y":1140,"wires":[["87fddc7d.2a824"]]},{"id":"87fddc7d.2a824","type":"api-call-service","z":"f36aaced.315eb","name":"Pause Rover","server":"9e375a62.089ba8","service_domain":"vacuum","service":"pause","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\"}","mergecontext":"","output_location":"","output_location_type":"none","x":1250,"y":1140,"wires":[["e9500d7f.c0fc9"]]},{"id":"b9e5de71.d8d1d","type":"api-call-service","z":"f36aaced.315eb","name":"Clean Guest Bathroom","server":"9e375a62.089ba8","service_domain":"vacuum","service":"xiaomi_clean_zone","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"repeats\":\"1\",\"zone\":[[17416,29638,19266,32588]]}","mergecontext":"","output_location":"","output_location_type":"none","x":840,"y":1240,"wires":[["ab25294e.851478"]]},{"id":"42e136fa.af7668","type":"api-current-state","z":"f36aaced.315eb","name":"Guestbath","server":"9e375a62.089ba8","outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.vacuum_guestbath","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":510,"y":1240,"wires":[["4edc056c.6244dc"]]},{"id":"4edc056c.6244dc","type":"switch","z":"f36aaced.315eb","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":650,"y":1240,"wires":[["b9e5de71.d8d1d"],["1355f748.4a8859"]]},{"id":"ab25294e.851478","type":"ha-wait-until","z":"f36aaced.315eb","name":"Wait","server":"9e375a62.089ba8","outputs":1,"entityId":"vacuum.xiaomi_vacuum_cleaner","property":"state","comparator":"is","value":"returning","valueType":"str","timeout":0,"timeoutUnits":"seconds","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"x":1090,"y":1240,"wires":[["a7217650.c584b8"]]},{"id":"a7217650.c584b8","type":"api-call-service","z":"f36aaced.315eb","name":"Pause Rover","server":"9e375a62.089ba8","service_domain":"vacuum","service":"pause","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\"}","mergecontext":"","output_location":"","output_location_type":"none","x":1250,"y":1240,"wires":[["fb92dacb.6ad3c8"]]},{"id":"29274830.8b2ad8","type":"api-call-service","z":"f36aaced.315eb","name":"Clean Hallway","server":"9e375a62.089ba8","service_domain":"vacuum","service":"xiaomi_clean_zone","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"repeats\":\"1\",\"zone\":[[17299,32476,20949,33976],[19230,29553,20780,32603]]}","mergecontext":"","output_location":"","output_location_type":"none","x":820,"y":1340,"wires":[["5a1d1339.5d744c"]]},{"id":"1355f748.4a8859","type":"api-current-state","z":"f36aaced.315eb","name":"Hallway","server":"9e375a62.089ba8","outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.vacuum_hallway1","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":500,"y":1340,"wires":[["d5134fde.eec7c"]]},{"id":"d5134fde.eec7c","type":"switch","z":"f36aaced.315eb","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":650,"y":1340,"wires":[["29274830.8b2ad8"],["9593bcae.00f9"]]},{"id":"5a1d1339.5d744c","type":"ha-wait-until","z":"f36aaced.315eb","name":"Wait","server":"9e375a62.089ba8","outputs":1,"entityId":"vacuum.xiaomi_vacuum_cleaner","property":"state","comparator":"is","value":"returning","valueType":"str","timeout":0,"timeoutUnits":"seconds","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"x":1090,"y":1340,"wires":[["580246ca.711248"]]},{"id":"580246ca.711248","type":"api-call-service","z":"f36aaced.315eb","name":"Pause Rover","server":"9e375a62.089ba8","service_domain":"vacuum","service":"pause","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\"}","mergecontext":"","output_location":"","output_location_type":"none","x":1250,"y":1340,"wires":[["ec6a8479.ae04d8"]]},{"id":"9593bcae.00f9","type":"api-current-state","z":"f36aaced.315eb","name":"Kitchen","server":"9e375a62.089ba8","outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.vacuum_kitchen","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":500,"y":1440,"wires":[["5465978b.4944c8"]]},{"id":"5465978b.4944c8","type":"switch","z":"f36aaced.315eb","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":650,"y":1440,"wires":[["3123494d.b96bb6"],["ffd012cb.6037a"]]},{"id":"d1d65820.6e5178","type":"ha-wait-until","z":"f36aaced.315eb","name":"Wait","server":"9e375a62.089ba8","outputs":1,"entityId":"vacuum.xiaomi_vacuum_cleaner","property":"state","comparator":"is","value":"returning","valueType":"str","timeout":0,"timeoutUnits":"seconds","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"x":1090,"y":1440,"wires":[["5fef6150.a5383"]]},{"id":"5fef6150.a5383","type":"api-call-service","z":"f36aaced.315eb","name":"Pause Rover","server":"9e375a62.089ba8","service_domain":"vacuum","service":"pause","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\"}","mergecontext":"","output_location":"","output_location_type":"none","x":1250,"y":1440,"wires":[["d2c3c2bc.6f27e"]]},{"id":"32c8c98b.ebc516","type":"api-call-service","z":"f36aaced.315eb","name":"Clean Master Bathroom","server":"9e375a62.089ba8","service_domain":"vacuum","service":"xiaomi_clean_zone","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"repeats\":\"1\",\"zone\":[[22592,29601,25542,32151]]}","mergecontext":"","output_location":"","output_location_type":"none","x":850,"y":1540,"wires":[["454c609f.5915d"]]},{"id":"ffd012cb.6037a","type":"api-current-state","z":"f36aaced.315eb","name":"Masterbath","server":"9e375a62.089ba8","outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.vacuum_masterbath","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":510,"y":1540,"wires":[["f5d34671.a223b8"]]},{"id":"f5d34671.a223b8","type":"switch","z":"f36aaced.315eb","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":650,"y":1540,"wires":[["32c8c98b.ebc516"],["7077b5b8.0a2cdc"]]},{"id":"454c609f.5915d","type":"ha-wait-until","z":"f36aaced.315eb","name":"Wait","server":"9e375a62.089ba8","outputs":1,"entityId":"vacuum.xiaomi_vacuum_cleaner","property":"state","comparator":"is","value":"returning","valueType":"str","timeout":0,"timeoutUnits":"seconds","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"x":1090,"y":1540,"wires":[["a02520ea.b9d8"]]},{"id":"a02520ea.b9d8","type":"api-call-service","z":"f36aaced.315eb","name":"Pause Rover","server":"9e375a62.089ba8","service_domain":"vacuum","service":"pause","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\"}","mergecontext":"","output_location":"","output_location_type":"none","x":1250,"y":1540,"wires":[["55e288fa.112598"]]},{"id":"8c5f0218.5343","type":"api-call-service","z":"f36aaced.315eb","name":"Clean Master Bedroom","server":"9e375a62.089ba8","service_domain":"vacuum","service":"xiaomi_clean_zone","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"repeats\":\"1\",\"zone\":[[20958,32134,26158,37284]]}","mergecontext":"","output_location":"","output_location_type":"none","x":850,"y":1640,"wires":[["34b2d712.f82168"]]},{"id":"7077b5b8.0a2cdc","type":"api-current-state","z":"f36aaced.315eb","name":"Masterbed","server":"9e375a62.089ba8","outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.vacuum_masterbed","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":510,"y":1640,"wires":[["cdd35664.296c38"]]},{"id":"cdd35664.296c38","type":"switch","z":"f36aaced.315eb","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":650,"y":1640,"wires":[["8c5f0218.5343"],["87d2442.9eeb8b8"]]},{"id":"34b2d712.f82168","type":"ha-wait-until","z":"f36aaced.315eb","name":"Wait","server":"9e375a62.089ba8","outputs":1,"entityId":"vacuum.xiaomi_vacuum_cleaner","property":"state","comparator":"is","value":"returning","valueType":"str","timeout":0,"timeoutUnits":"seconds","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"x":1090,"y":1640,"wires":[["943a4d73.bca08"]]},{"id":"943a4d73.bca08","type":"api-call-service","z":"f36aaced.315eb","name":"Pause Rover","server":"9e375a62.089ba8","service_domain":"vacuum","service":"pause","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\"}","mergecontext":"","output_location":"","output_location_type":"none","x":1250,"y":1640,"wires":[["93479f7b.c3cac"]]},{"id":"96f3b31e.6fffa","type":"trigger-state","z":"f36aaced.315eb","name":"Rover Cleaning Off","server":"9e375a62.089ba8","entityid":"input_boolean.rover_cleaning","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"id":"nzh69s2m4m","targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"off"},{"id":"g8kdfcvndys","targetType":"this_entity","targetValue":"","propertyType":"previous_state","propertyValue":"old_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"on"}],"constraintsmustmatch":"all","outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","x":130,"y":1920,"wires":[["68966f63.9467a"],[]]},{"id":"68966f63.9467a","type":"api-call-service","z":"f36aaced.315eb","name":"Turn Off Vacuum Zones","server":"9e375a62.089ba8","service_domain":"input_boolean","service":"turn_off","data":"{\"entity_id\":\"input_boolean.vacuum_dining, input_boolean.vacuum_family, input_boolean.vacuum_guest, input_boolean.vacuum_guestbath, input_boolean.vacuum_hallway1, input_boolean.vacuum_hallway2, input_boolean.vacuum_kitchen, input_boolean.vacuum_masterbath, input_boolean.vacuum_masterbed, input_boolean.vacuum_office\"}","mergecontext":"","output_location":"","output_location_type":"none","x":550,"y":1920,"wires":[[]]},{"id":"ec6a8479.ae04d8","type":"stoptimer","z":"f36aaced.315eb","duration":"10","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":1470,"y":1340,"wires":[["9593bcae.00f9"],[]]},{"id":"93479f7b.c3cac","type":"stoptimer","z":"f36aaced.315eb","duration":"10","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":1470,"y":1640,"wires":[["87d2442.9eeb8b8"],[]]},{"id":"3123494d.b96bb6","type":"api-call-service","z":"f36aaced.315eb","name":"Clean Kitchen","server":"9e375a62.089ba8","service_domain":"vacuum","service":"xiaomi_clean_zone","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"repeats\":\"1\",\"zone\":[[16849,19988,20999,23488]]}","mergecontext":"","output_location":"","output_location_type":"none","x":820,"y":1440,"wires":[["d1d65820.6e5178"]]},{"id":"161f5731.b2e859","type":"api-call-service","z":"f36aaced.315eb","name":"Clean Family Room","server":"9e375a62.089ba8","service_domain":"vacuum","service":"xiaomi_clean_zone","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"repeats\":\"1\",\"zone\":[[16186,24520,26136,29570]]}","mergecontext":"","output_location":"","output_location_type":"none","x":830,"y":1740,"wires":[["358d3f9c.ea26b"]]},{"id":"87d2442.9eeb8b8","type":"api-current-state","z":"f36aaced.315eb","name":"Family","server":"9e375a62.089ba8","outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.vacuum_family","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":490,"y":1740,"wires":[["f3ffbfdb.47877"]]},{"id":"f3ffbfdb.47877","type":"switch","z":"f36aaced.315eb","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":650,"y":1740,"wires":[["161f5731.b2e859"],["709b244d.5291ec","5eb923bd.da484c"]]},{"id":"358d3f9c.ea26b","type":"ha-wait-until","z":"f36aaced.315eb","name":"Wait","server":"9e375a62.089ba8","outputs":1,"entityId":"vacuum.xiaomi_vacuum_cleaner","property":"state","comparator":"is","value":"returning","valueType":"str","timeout":0,"timeoutUnits":"seconds","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"x":1090,"y":1740,"wires":[["709b244d.5291ec","5eb923bd.da484c"]]},{"id":"c88b3e95.edad4","type":"api-call-service","z":"f36aaced.315eb","name":"Clean Office","server":"9e375a62.089ba8","service_domain":"vacuum","service":"xiaomi_clean_zone","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"repeats\":\"1\",\"zone\":[[19779,27272,20779,28322]]}","mergecontext":"","output_location":"","output_location_type":"none","x":810,"y":1040,"wires":[["d8c616d0.22b1e8"]]},{"id":"79edaf8a.1dbf9","type":"api-current-state","z":"f36aaced.315eb","name":"Office","server":"9e375a62.089ba8","outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.vacuum_office","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":490,"y":1040,"wires":[["c6d65aef.9a5058"]]},{"id":"c6d65aef.9a5058","type":"switch","z":"f36aaced.315eb","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":650,"y":1040,"wires":[["c88b3e95.edad4"],["59dc525b.5dbd5c"]]},{"id":"d8c616d0.22b1e8","type":"ha-wait-until","z":"f36aaced.315eb","name":"Wait","server":"9e375a62.089ba8","outputs":1,"entityId":"vacuum.xiaomi_vacuum_cleaner","property":"state","comparator":"is","value":"returning","valueType":"str","timeout":0,"timeoutUnits":"seconds","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"x":1090,"y":1040,"wires":[["8479abbc.0977b8"]]},{"id":"8479abbc.0977b8","type":"api-call-service","z":"f36aaced.315eb","name":"Pause Rover","server":"9e375a62.089ba8","service_domain":"vacuum","service":"pause","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\"}","mergecontext":"","output_location":"","output_location_type":"none","x":1250,"y":1040,"wires":[["6be221c8.b947d"]]},{"id":"6216eece.ca46e","type":"stoptimer","z":"f36aaced.315eb","duration":"10","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":1470,"y":940,"wires":[["79edaf8a.1dbf9"],[]]},{"id":"6be221c8.b947d","type":"stoptimer","z":"f36aaced.315eb","duration":"10","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":1470,"y":1040,"wires":[["59dc525b.5dbd5c"],[]]},{"id":"e9500d7f.c0fc9","type":"stoptimer","z":"f36aaced.315eb","duration":"10","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":1470,"y":1140,"wires":[["42e136fa.af7668"],[]]},{"id":"fb92dacb.6ad3c8","type":"stoptimer","z":"f36aaced.315eb","duration":"10","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":1470,"y":1240,"wires":[["1355f748.4a8859"],[]]},{"id":"d2c3c2bc.6f27e","type":"stoptimer","z":"f36aaced.315eb","duration":"10","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":1470,"y":1440,"wires":[["ffd012cb.6037a"],[]]},{"id":"55e288fa.112598","type":"stoptimer","z":"f36aaced.315eb","duration":"10","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":1470,"y":1540,"wires":[["7077b5b8.0a2cdc"],[]]},{"id":"5eb923bd.da484c","type":"api-call-service","z":"f36aaced.315eb","name":"Return Home","server":"9e375a62.089ba8","service_domain":"vacuum","service":"return_to_base","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\"}","mergecontext":"","output_location":"","output_location_type":"none","x":810,"y":1840,"wires":[[]]},{"id":"9e375a62.089ba8","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":false,"rejectUnauthorizedCerts":true}]
1 Like

And this is what it looks like on the HA side. If I press the left button, it just turns on the input boolean for cleaning. The middle shows the status of my vacuum and the right executes a script that stops all jobs, and sends the vacuum back to the dock. In this case, pressing the left button would clean the master bedroom, master bathroom and office.

2 Likes