Howto: Xiaomi vacuum zoned cleaning

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.

What is the difference between app_zoned_clean and xiaomi_clean_zone? Is there any real reason like performance why one should use the latter?

no, its the same function, just different methods of how to use it.

1 Like

Sorry for asking again but would really like to get rid of the Xiaomi Android app and this in the only thing left.

1 Like

I got to manage the vacuum is cleaning the zones with areas checked it with the service call. But now it doesn’t work anymore. If I get new coordinates from the flolevac app it is still not working with service call or script. Can Someone give me a hint?

There could be multiple reasons:

Did your the ip of your vacuum change?
Did you readd the vacuum to your xiaomi App? (readding the vacuum/resetting the wifi settings resets the token, you have to retreive the token again)

Hi @ciB, IP didn’t change it is a fixed ip address. It’s my bad for not explaining it clearly I guess. The vacuum is working in Home Assistant. Starting, stoping etc etc. When I retrieve the coordinates from the Flolevac app it doesn’t go to that zone to clean but it starts cleaning around the dock.

Ah, ok. Then you most likely entered the coordinates in the wrong order. Make sure to go from buttom left corner to top right corner. (so in a zone [x1, y1, x2, y2, repetitions], x1<x2 and y1<y2 ) You can check in your xiaomi App (maybe also Flole) how the zone looks like home assistant just passed on.

I tried to check what the zone looks like in the app but it don’t appear in it. and if you get the coordinates from flolevac shoudn’t it be right?

OK. Tried the call service again and that is working.

{
  "entity_id": "vacuum.xiaomi_vacuum_cleaner",
  "command": "app_zoned_clean",
  "params": [[28226,26738,29776,30288,1]]
}

So there is something wrong with my script:

script:
  roborock_woonkamer:
    alias: woonkamer 
    sequence:
      - service: vacuum.send_command
        data:
          entity_id: vacuum.xiaomi_vacuum_cleaner
          command: app_zoned_clean
          params: [ 25027, 23051, 30327, 27201, 1]
        
  roborock_keuken:
    alias: keuken 
    sequence:
    - service: vacuum.send_command
      data:
        entity_id: vacuum.xiaomi_vacuum_cleaner
        command: app_zoned_clean
        params: [ 28226, 26738, 29776, 30288, 1]

edit:
Found the solution. Need to specify the parameters like this [[12345,12345,12345,12345,1]] instead of [12345,12345,12345,12345,1]

Hi everyone,

I have created scripts that overcome some issues with xiaomi vacuum integration:

1 Like

I’m having the same problem. Did you find a solution?

Unfortunately, no. Do you happen to have Xiaomi smart devices connected to the China region and the roborock connected to Europe region? I wonder if that’s why it’s not working for me. I’m considering creating a new account for the roborock instead of swapping regions. The other alternative is rooting I guess, but haven’t looked into it.