Skip to content

Commit c7d4a93

Browse files
jcastroLandrash
authored andcommitted
Create switch.xiaomi_vacuum (home-assistant#2771)
* Create switch.xiaomi_vacuum First revision * Update switch.xiaomi_vacuum Tweaks in the copy * Update switch.xiaomi_vacuum * Update switch.xiaomi_vacuum * Update switch.xiaomi_vacuum * Update switch.xiaomi_vacuum Tweaks on info table * Changed filename to .markdown Changed filename to .markdown * Update switch.xiaomi_vacuum.markdown * Update switch.xiaomi_vacuum.markdown Update, collaboration from other users * Update switch.xiaomi_vacuum.markdown Added WIP token instructions based on some reading * Fix spelling and formatting * Update switch.xiaomi_vacuum.markdown Spelling
1 parent aed2c76 commit c7d4a93

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
layout: page
3+
title: "Xiaomi Mi Robot Vacuum"
4+
description: "Instructions how to integrate your Xiaomi Mi Robot Vacuum within Home Assistant."
5+
date: 2017-05-05 18:11
6+
sidebar: true
7+
comments: false
8+
sharing: true
9+
footer: true
10+
logo: xiaomi_vacuum.png
11+
ha_category: Switch
12+
ha_release: 0.48
13+
---
14+
15+
The `xiaomi_vacuum`switch platform allows you to control the state of your [Xiaomi Mi Robot Vacuum](http://www.mi.com/roomrobot/).
16+
Current supported features are `start` and `stop` (goes to dock).
17+
18+
{% linkable_title Getting started %}
19+
20+
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.
21+
22+
<p class='note warning'>
23+
If your Home Assistant installation is running in a [Virtualenv](/docs/installation/virtualenv/#upgrading-home-assistant), make sure you activate it by running the commands below.</p>
24+
25+
```bash
26+
$ sudo su -s /bin/bash homeassistant
27+
$ source /srv/homeassistant/bin/activate
28+
```
29+
30+
In order to fetch the token follow these instructions depending on your mobile phone platform.
31+
32+
### Windows and Android
33+
1. Configure the robot with the Mi-Home app.
34+
2. Enable developer mode and USB debugging on the Android phone and plug it into the computer.
35+
3. Get ADB tool for Windows : https://developer.android.com/studio/releases/platform-tools.html
36+
4. Create a backup of the application com.xiaomi.smarthome:
37+
```bash
38+
.\adb backup -noapk com.xiaomi.smarthome -f backup.ab
39+
```
40+
5. If you have this message : "More than one device or emulator", use this command to list all devices:
41+
```bash
42+
.\adb devices
43+
```
44+
and execute this command:
45+
```bash
46+
.\adb -s DEVICEID backup -noapk com.xiaomi.smarthome -f backup.ab # (with DEVICEID the device id from the previous command)
47+
```
48+
6. On the phone, you must confirm the backup. DO NOT enter any password and press button to make the backup.
49+
7. Get ADB Backup Extractor : https://sourceforge.net/projects/adbextractor/
50+
8. Extract All files from the backup:
51+
```bash
52+
java.exe -jar ../android-backup-extractor/abe.jar unpack backup.ab backup.tar ""
53+
```
54+
9. Unzip the ".tar" file.
55+
10. Open the sqlite DB miio2.db with a tool like SQLite Manager extension for FireFox.
56+
11. Get token from "devicerecord" table.
57+
58+
59+
### macOS and iOS
60+
1. Setup iOS device with the Mi-Home app.
61+
2. Create an unencrypted backup of the device using iTunes.
62+
3. Install iBackup Viewer from here: http://www.imactools.com/iphonebackupviewer/
63+
4. Extract this file /raw data/com.xiami.mihome/_mihome.sqlite to your computer
64+
5. Open the file extracted using notepad. You will then see the list of all the device in your account with their token.
65+
66+
{% linkable_title Configuration %}
67+
68+
```yaml
69+
# Example configuration.yaml entry
70+
- platform: xiaomi_vacuum
71+
name: 'name of the robot'
72+
host: 192.168.1.2
73+
token: your-token-here
74+
```
75+
76+
Configuration variables:
77+
- **name** (*Optional*): The name of your robot
78+
- **host** (*Required*): The IP of your robot
79+
- **token** (*Required*): The token of your robot. Go to Getting started section to read more about how to get it

0 commit comments

Comments
 (0)