xiaomi_vacuumswitch platform allows you to control the state of your Xiaomi Mi Robot Vacuum.
Current supported features are
stop (goes to dock).
Follow the pairing process using your phone and Mi-Home app. From here you will be able to retrieve the token from a SQLite file inside your phone.
If your Home Assistant installation is running in a Virtualenv, make sure you activate it by running the commands below.
$ sudo su -s /bin/bash homeassistant $ source /srv/homeassistant/bin/activate
In order to fetch the token follow these instructions depending on your mobile phone platform.
Windows and Android
- Configure the robot with the Mi-Home app.
- Enable developer mode and USB debugging on the Android phone and plug it into the computer.
- Get ADB tool for Windows : https://developer.android.com/studio/releases/platform-tools.html
- Create a backup of the application com.xiaomi.smarthome:
.\adb backup -noapk com.xiaomi.smarthome -f backup.ab
- If you have this message : “More than one device or emulator”, use this command to list all devices:
and execute this command:
.\adb -s DEVICEID backup -noapk com.xiaomi.smarthome -f backup.ab # (with DEVICEID the device id from the previous command)
- On the phone, you must confirm the backup. DO NOT enter any password and press button to make the backup.
- Get ADB Backup Extractor : https://sourceforge.net/projects/adbextractor/
- Extract All files from the backup:
java.exe -jar ../android-backup-extractor/abe.jar unpack backup.ab backup.tar ""
- Unzip the “.tar” file.
- Open the sqlite DB miio2.db with a tool like SQLite Manager extension for FireFox.
- Get token from “devicerecord” table.
macOS and iOS
- Setup iOS device with the Mi-Home app.
- Create an unencrypted backup of the device using iTunes.
- Install iBackup Viewer from here: http://www.imactools.com/iphonebackupviewer/
- Extract this file /raw data/com.xiami.mihome/_mihome.sqlite to your computer
- Open the file extracted using notepad. You will then see the list of all the device in your account with their token.
# Example configuration.yaml entry - platform: xiaomi_vacuum name: 'name of the robot' host: 192.168.1.2 token: your-token-here
- name (Optional): The name of your robot
- host (Required): The IP of your robot
- token (Required): The token of your robot. Go to Getting started section to read more about how to get it