Howto: Xiaomi vacuum zoned cleaning

But do you need a saved map for zoned cleaning? I didn’t see it in any requirements. Cannot you just give raw coordinates and robo will blindly go there and clean within those coordinates what it can access?

saved map “xiaomi feature” is not needed, but there must be a last map available on your xiaomi, but it doesnt need to be “saved”

so when you do a clean start, it will make a map, then afterwards, NEVER do a clean start anymore, otherwise your last “good” map is lost, so if you want a full clean, make also a zone for your full map, than also use zone cleaning then

If i do zoned cleanup corner to corner whole downstairs, will it get lost when it sees a wall in different place than upstairs? Exterior walls are in same place

it will just create a new map, the wall is not an issue, it will just bump to it
you just need to place it on same exact X Y coordinates, then you should be fine

I have the card setup and the vacuum seems to go to the designated zones. However, once it reaches the zone its “finished” and returns back to the dock. It doesn’t start cleaning anything.

Anyone got any idea what this could be?

Configuration.yaml:

input_select:
  vacuum_room_select:
    name: Choose a room to clean
    options:
      - Kitchen
      - Printer
      - Livingroom
      - Hallway
      - Gamingroom
      - Bedroom

Scripts:

vacuum_livingroom:
      alias: "Vacuum the livingroom"
      sequence:
        - service: vacuum.send_command
          data:
            entity_id: vacuum.xiaomi_vacuum_cleaner
            command: app_zoned_clean
            params: [[23400,29000,30000,25000, 1]]
            
vacuum_kitchen:
      alias: "Vacuum the Kitchen"
      sequence:
        - service: vacuum.send_command
          data:
            entity_id: vacuum.xiaomi_vacuum_cleaner
            command: app_zoned_clean
            params: [[24000,31500,30000,28900, 1]]
            
vacuum_printer:
      alias: "Vacuum the Printer"
      sequence:
        - service: vacuum.send_command
          data:
            entity_id: vacuum.xiaomi_vacuum_cleaner
            command: app_zoned_clean
            params: [[24000,31500,27500,28900, 2]]   

vacuum_hallway:
      alias: "Vacuum the Hallway"
      sequence:
        - service: vacuum.send_command
          data:
            entity_id: vacuum.xiaomi_vacuum_cleaner
            command: app_zoned_clean
            params: [[29700,33000,31500,27900, 1]]    

vacuum_gamingroom:
      alias: "Vacuum the Gamingroom"
      sequence:
        - service: vacuum.send_command
          data:
            entity_id: vacuum.xiaomi_vacuum_cleaner
            command: app_zoned_clean
            params: [[31350,33000,36000,29550, 1]] 

vacuum_bedroom:
      alias: "Vacuum the Bedroom"
      sequence:
        - service: vacuum.send_command
          data:
            entity_id: vacuum.xiaomi_vacuum_cleaner
            command: app_zoned_clean
            params: [[30500,28000,35000,25000, 1]]            
            
vacuum_room:
    alias: "Start cleaning"
    sequence:
      - service: script.turn_on
        data_template:
          entity_id: >
            {% if is_state("input_select.vacuum_room_select", "Kitchen") %}
              script.vacuum_kitchen
            {% elif is_state("input_select.vacuum_room_select", "Livingroom") %}
              script.vacuum_livingroom
            {% elif is_state("input_select.vacuum_room_select", "Printer") %}
              script.vacuum_printer
            {% elif is_state("input_select.vacuum_room_select", "Hallway") %}
              script.vacuum_hallway
            {% elif is_state("input_select.vacuum_room_select", "Gamingroom") %}
              script.vacuum_gamingroom
            {% elif is_state("input_select.vacuum_room_select", "Bedroom") %}
              script.vacuum_bedroom
            {% endif %}

This is cool. Got my scheduled zoned clean-up up and running very quick (with help from the Flole app). Thank you.

It could be possible with scripts.
You could have one script for each floor with the following algorithm:

  • First put the vacuum always on the same corner to ensure the map when reset will always be the same.
  • Then call the service to do a standard clean. It will reset the map for the floor and start reconstruct a new one.
  • Wait around 20 seconds and call service to stop standard clean.
  • You can add after the service call to do zone cleaning.

Tips: try to order the zones consistently with the floor discovery. Or you can add some ‘to go’ instructions after the reset to help the vacuum construct the floor map.

Please check this topic:

Maybe @3_14 knows the answer. :slight_smile:
He made a great card for the zoned cleaning and it is working perfectly without interuptions.

Hi offered a solution, maybe it is working:

- service: vacuum.xiaomi_clean_zone
  data_template:
    entity_id: vacuum.xiaomi_vacuum
    repeats: '{{ states.input_number.vacuum_times.state | int }}'
    zone: 
      {% if is_state('input_boolean.vacuum_room_1', 'on') %}
      - [13954, 14901, 31754, 32751]
      {% endif %}
      {% if is_state('input_boolean.vacuum_room_2', 'on') %}
      - [23954, 24901, 32754, 32752]
      {% endif %}
      {% if is_state('input_boolean.vacuum_room_3', 'on') %}
      - [33954, 34901, 33754, 32753]
      {% endif %}

I’m trying to find coordinates with FloleVac but when I select Map it keeps loading forever with the message “Loading Map”. It’s able to fetch Clean Area, Battery level and Duration of the last cleaning, but no map shows up. Suggestions? I’ve tried different servers in the settings and I tried e-mailing the developer but he doesn’t respond.

KEY to the coordinate system. If the vacuum cleaner tells you that some parts are unreachable you have wrong coordinates. I prepared a quick picture for clarification. I hope it is right. It works for me.

You do not tell the vacuum cleaner any point coordinates, but what line (number) must not go

image

1 Like

Make sure you’ve input the correct Xiaomi Username and password, as well as the correct vacuum ip in the FloleVac settings to access the map functionality.

I do. If login details are incorrect I get an error message about that. If IP is wrong it just keeps loading. If IP is correct I get the number details about the last cleaning behind the ‘Loading Map’, but the map never shows.

For me the Flole App does not work anymore either. It cannot connect to my vacuum although All settings are correct, checked like 10 times. HA and the xiaomi App work perfect though

I’m able to connect to Flole, but when following the instructions and pasting them as script, for some reason it does not seem to be able to reach the location and turns back to the base.

Example:
coordinates coming from FloleVac which corresponds to my daughter’s bedroom: [[28600,22314,32500,25264,1]]

the below script does launch the robot, but goes back to the base as destination unreacheable:

- vacuum_daughter:
    alias: Bobby room daughter
    sequence:
    - data:
        entity_id: vacuum.xiaomi_vacuum_cleaner
        repeats: '1'
        zone:
        - - 28600
          - 22314
          - 32500
          - 25264
      service: vacuum.xiaomi_clean_zone

Has anyone gotten the same issue? did I not put the coordinates in the right order?
Thanks!

Coordinates seem right… after calling the script you should see the created zone in your app - check if the zone is somewhere else than expected (e.g. outside your space) -if it does not show at all, something else is wrong.

1 Like

Does anyone know if it is possible to reset the timers from home assistant for service work like clean sensors aor change main brush?

Hi,
I have the same issue… Tried changing order of x1,y1 and x2,y2, and have confirmed that the proper box i drawn in the Xiaomi app. I have Roborock S5 with most uptodate firmware and app.

It seems the robot tried to go to one of the corners given by the coordinates instead of doing the cleaning of the area… Then it returns to dock since cannot find anything…

Btw: is there a difference using “app_zoned_clean” or “xiaomi_clean_zone”?

Br,
Jarle

I have the similar script like this (in scripts.yaml):

>   vacuum_room:
>     alias: "Vacuum the room"
>     sequence:
>       - service: vacuum.send_command
>         data:
>           entity_id: vacuum.xiaomi
>           command: app_zoned_clean
>           params: [[12345, 12345, 12345, 12345, 1]]

And in the params you put the coordinates like so and the last “1” is the repeat counter (how many times to vacuum)

Replied to wrong message at first

I have that issue as well, you can make it find the area by starting it close to the main area to be vacuumed. For example I send my robot to a spot near the kitchen before it starts cleaning so that it doesn’t try to go to a corner it can’t find first.

app_zoned_clean was used before the function was added to the miio python library. You need to enter the coordinates differently depending on which you use. In Piggyback’s example above you can see how you use xiaomi_clean_zone, my example used at the beginning of this tutorial used the old way.