Howto: Xiaomi vacuum zoned cleaning

Hum yeah, totally forgent about the states menu !

Do you think itā€™s now possible to use the long-lived token with ifft?

Thanks for this great article! found an easier way to both get the token and the map coordinates.
Install mitmproxy on your computer, set the computer as proxy on your mobile phone.
Then you can get both the token and the map coordinates by looking what is sent to the vacuum in mitmproxy.
You will need to add the mitmproxy ssl certificate to your mobile device for this to work (so mitmproxy is able to decrypt the ssl traffic).

I found this is the easiest: Get the Xiaomi Home token
Granted you need to trust a russion app but well I deinstalled it after getting the token and with NoRoot Firewall keep everything blocked afterwards.

Thatā€™s the one linked in my how-to :slight_smile:

oops. I never saw that because I never read the full opening post and unfolded that point. Saw only the other post haha

Is there a way to get multiple zones vacuumed in one script? Can someone pls provide an example?
Iā€™d like to say ā€˜Alexa, vacuum the kitchenā€™, but the area would need a couple of ā€˜zonesā€™. I donā€™t want it to go back to the dock after cleaning the first zone, but continue to the second zone, then redock.

Well you can put all zones in sequence in your script.

Yes, thatā€™s possible. The command takes a list of zones. This is also described in the HowTo. For example:

vacuum_kitchen:
      alias: "Vacuum the kitchen"
      sequence:
        - service: vacuum.send_command
          data:
            entity_id: vacuum.DustyMcDustface
            command: app_zoned_clean
            params: [[26500, 20500, 29000, 23000, 1], [23500, 23500, 21000, 22000, 1]]

Thanks for that guys. Is the following code valid then?

vacuum_family_area:
  alias: "Vacuum the family area"
  sequence:
    - service: vacuum.send_command
      data:
        entity_id: vacuum.xiaomi_vacuum_cleaner
        command: app_zoned_clean
        params: [[21800, 19500, 26300, 23000, 1]]
    - service: vacuum.send_command
      data:
        entity_id: vacuum.xiaomi_vacuum_cleaner
        command: app_zoned_clean
        params: [[23000, 23300, 26300, 25400, 1]]

Or Iā€™m guessing it should be more like this?

vacuum_family_area:
  alias: "Vacuum the family area"
  sequence:
    - service: vacuum.send_command
      data:
        entity_id: vacuum.xiaomi_vacuum_cleaner
        command: app_zoned_clean
        params: [[21800, 19500, 26300, 23000, 1], [23000, 23300, 26300, 25400, 1]]
1 Like

For anyone interested I have managed to complete a migration of the original ā€˜Vacuum a Roomā€™ Floor Plan config into Lovelace using a Picture Elements Card rather than Floor Plan. Overall it works well although rather than being able to click on a room I need to click on the room text. Also - background is transparent so it changes with the theme. Lovelace Config

7 Likes

Yay got it working, thanks for the help

Yes, sorry :smiley:

1 Like

Iā€™ve just read through this a few times, and tried @stanvx yaml file (changing the appropriate items for our house) and I must be thick, as I canā€™t get anything to work.

Has anyone put together a Dummyā€™s Guide to this as yet? Iā€™m happy to test it out :slight_smile:

I will be honest, my experience with Home Assistant (Iā€™m running Hassbian because I donā€™t like Docker) is a bit limited, but I have basic stuff working, like lights doing what I want, and I can do basic things with the Roborock already via itsā€™ own group tabā€¦

Iā€™m not running Lovelace, as I havenā€™t got my head around that yetā€¦

I couldnā€™t get this to work until i added quotes to everything.

Unfortunately I have the issue that the map keeps rotating.

Try avoiding the regular cleanup. It seems that the map rotates once you initiate a regular cleanup (where the robot cleans everything he can find). You can actually use that knowledge to get the map into your desired position again. Then, after the map is in the right position, only use zoned cleanups - they wonā€™t rotate the map.

Itā€™s really an annoying thing because I often clean upstairs or separate rooms but then when I put it back downstairs indeed the map is rotated or all coordinates donā€™t apply anymore! :frowning:

If anyone has a brilliant solution for thisā€¦

Iā€™m not getting app_go_to command to work. It works in dev tools when I call the service, but it does not when I put it in a script. Does it not work within a script?

Yes, it works in a script. Can you please post your script here? There must be an error in your script.