Howto: Xiaomi vacuum zoned cleaning

Me again. Api connexion and Google Assistant command are ok.
But i need a bit more help for configuring notifications.
Is the state to use what is highlighted in the screenshot ?

And, if i wanna be asked to clean after use, said 2 min after beeing back to dock, what condition should i use ?
Action will be a pushbullet or sms notification, but i think i can make it myself.

Thanks in advance guys !

No its not. Go to the states menu within your home assistant ui. Then check the states names. They are in engl. while the ui represtantion is translated. It will be: docked, cleaning, etc. as written above.

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…