Roborock Vacuum

Get your vacuum token

Requires Android SDK Tools.

  1. Install Mi Home 5.0.19 APK
  2. Login and check the vacuum
  3. Use adb to backup app (Android SDK Tool)

    adb backup com.xiaomi.smarthome

    Will produces a backup.ab file.

  4. Download Android Backup Extractor
  5. Extract android backup file to archive file

    java -jar abe.jar unpack backup.ab backup.ab.tar

  6. Unzip the archive
  7. Open the SQLite file apps/com.xiaomi.smarthome/db/miio2.db
  8. The token is in the device_record.token field

HA configuration

vacuum:
  - platform: xiaomi_miio
    host: 192.168.0.ip
    token: !secret roborock_token

Now, the vacuum can be requested by HA.

Custom setting

Add a input select for zone cleaning.

input_select:
  vacuum_room:
    name: Choose a room 
    options:
      - ...
      - Kitchen
      - Dining Room
    initial: ...
    icon: mdi:robot-vacuum

This entity can be added to the UI as a combo.

Have to get somehow the map coordinates : https://community.home-assistant.io/t/howto-xiaomi-vacuum-zoned-cleaning/51293

… and call HA service: vacuum.send_command

{
  "entity_id": "vacuum.xiaomi",
  "command": "app_zoned_clean",
  "params": [[x1,y1,x2,y2,c], ...]
}

… and all of that can be automated of course: thanks to NodeRED !