You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Xiaomi token retrieval moved and extended.
* Misleading sentence removed.
* Additional item added to the trouble shooting section.
* API token reference removed from the Xiaomi Gateway introduction.
* The iOS app method does not work anymore. The ZToken column contains a 96 character encrypted token now. A 32 character token is still needed.
Copy file name to clipboardExpand all lines: source/_components/light.xiaomi_philipslight.markdown
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ The `xiaomi_philipslight` platform allows you to control the state of your Xiaom
17
17
18
18
Currently, the supported features are `on`, `off`, `set_cct` (colortemp) , `set_bright` (brightness).
19
19
20
-
Please follow the instructions on [Retrieving the Access Token](/components/xiaomi/#retrieving-the-access-token) to get the API token to use in the `configuration.yaml` file.
20
+
Please follow the instructions on [Retrieving the Access Token](/components/vacuum.xiaomi/#retrieving-the-access-token) to get the API token to use in the `configuration.yaml` file.
21
21
22
22
To add a Xiaomi Philips Light to your installation, add the following to your configuration.yaml file:
Copy file name to clipboardExpand all lines: source/_components/vacuum.xiaomi.markdown
+61-1Lines changed: 61 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ The `xiaomi` vacuum platform allows you to control the state of your [Xiaomi Mi
17
17
18
18
Current supported features are `turn_on`, `pause`, `stop`, `return_to_home`, `turn_off` (stops goes to dock), `locate`, `clean_spot`, `set_fanspeed` and even remote control your robot.
19
19
20
-
Please follow the instructions on [Retrieving the Access Token](/components/xiaomi/#retrieving-the-access-token) to get the API token to use in the `configuration.yaml` file.
20
+
Please follow the instructions on [Retrieving the Access Token](/components/vacuum.xiaomi/#retrieving-the-access-token) to get the API token to use in the `configuration.yaml` file.
21
21
22
22
To add a vacuum to your installation, add the following to your `configuration.yaml` file:
23
23
@@ -79,3 +79,63 @@ Use this call to enter the remote control mode, make one move, and stop and exit
79
79
| `velocity` | no | Speed, between -0.29 and 0.29. |
80
80
| `rotation` | no | Rotation, between -179 degrees and 179 degrees. |
81
81
| `duration` | no | Parameter affecting the duration of the movement. |
82
+
83
+
### {% linkable_title Retrieving the Access Token %}
84
+
85
+
<p class='note'>
86
+
This token (32 hexadecimal characters) is required for the Xiaomi Mi Robot Vacuum and Xiaomi Philips Light. The Xiaomi Gateway uses another security method and requires a `key` (16 alphanumeric chars) which can be obtained easily via a hidden menu item at the Mi-Home app.
87
+
</p>
88
+
89
+
Follow the pairing process using your phone and Mi-Home app. You will be able to retrieve the token from a SQLite file inside your phone.
90
+
91
+
Before you begin you need to install `libffi-dev` and `libssl-dev` by running the command below. This is needed for `python-mirobo` to be installed correctly.
92
+
93
+
```bash
94
+
$ sudo apt-get install libffi-dev libssl-dev
95
+
```
96
+
97
+
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.
98
+
99
+
```bash
100
+
$ sudo su -s /bin/bash homeassistant
101
+
$ source /srv/homeassistant/bin/activate
102
+
```
103
+
104
+
To fetch the token follow these instructions depending on your mobile phone platform.
105
+
106
+
#### {% linkable_title Windows and Android %}
107
+
108
+
1. Configure the robot with the Mi-Home app.
109
+
2. Enable developer mode and USB debugging on the Android phone and plug it into the computer.
110
+
3. Get and install the [ADB tool for Windows](https://developer.android.com/studio/releases/platform-tools.html).
111
+
4. Create a backup of the application `com.xiaomi.smarthome`:
10. Open the SQLite database `miio2.db` with a tool like SQLite Manager extension for FireFox.
131
+
11. Get the token from "devicerecord" table.
132
+
133
+
#### {% linkable_title Linux and Android (rooted!) %}
134
+
135
+
1. Configure the light with the Mi-Home app.
136
+
2. Enable developer mode, USB debugging and root permission only for ADB on the Android phone and plug it into the computer.
137
+
3. Get ADB f.e. `apt-get install android-tools-adb`
138
+
4. `adb devices` should list your device
139
+
5. `adb root` (does work for development builds only: ones with `ro.debuggable=1`)
140
+
6. `adb shell`
141
+
7. `echo "select name,localIP,token from devicerecord;" | sqlite3 /data/data/com.xiaomi.smarthome/databases/miio2.db` returns a list of all registered devices including IP address and token.
Copy file name to clipboardExpand all lines: source/_components/xiaomi.markdown
+4-70Lines changed: 4 additions & 70 deletions
Original file line number
Diff line number
Diff line change
@@ -46,8 +46,6 @@ What's not available?
46
46
47
47
Follow the setup process using your phone and Mi-Home app. From here you will be able to retrieve the key from within the app following [this tutorial](https://community.home-assistant.io/t/beta-xiaomi-gateway-integration/8213/1832)
48
48
49
-
Please check the instructions in this [section](/xiaomi/#retrieving-the-access-token) to get the API token to use with your platforms.
50
-
51
49
To enable Xiaomi gateway in your installation, add the following to your `configuration.yaml` file:
52
50
53
51
### {% linkable_title One Gateway %}
@@ -140,72 +138,8 @@ Automation example
140
138
141
139
That means that Home Assistant is not getting any response from your Xiaomi gateway. Might be a local network problem or your firewall.
142
140
- Make sure you have enabled LAN access: https://community.home-assistant.io/t/beta-xiaomi-gateway-integration/8213/1832
143
-
- Turn off the firewall on the system where Home Assistant is running
141
+
- Turn off the firewall on the system where Home Assistant is running.
144
142
- Try to leave the MAC address `mac:` blank.
145
-
- Try to set `discovery_retry: 10`
146
-
- Try to disable and then enable LAN access
147
-
148
-
### {% linkable_title Retrieving the Access Token %}
149
-
150
-
Follow the pairing process using your phone and Mi-Home app. You will be able to retrieve the token from a SQLite file inside your phone. This token is needed for using various `xiaomi_*` platforms.
151
-
152
-
Before you begin you need to install `libffi-dev` and `libssl-dev` by running the command below. This is needed for `python-mirobo` to be installed correctly.
153
-
154
-
```bash
155
-
$ sudo apt-get install libffi-dev libssl-dev
156
-
```
157
-
158
-
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.
159
-
160
-
```bash
161
-
$ sudo su -s /bin/bash homeassistant
162
-
$ source /srv/homeassistant/bin/activate
163
-
```
164
-
165
-
To fetch the token follow these instructions depending on your mobile phone platform.
166
-
167
-
#### {% linkable_title Windows and Android %}
168
-
169
-
1. Configure the robot with the Mi-Home app.
170
-
2. Enable developer mode and USB debugging on the Android phone and plug it into the computer.
171
-
3. Get and install the [ADB tool for Windows](https://developer.android.com/studio/releases/platform-tools.html).
172
-
4. Create a backup of the application `com.xiaomi.smarthome`:
10. Open the SQLite database `miio2.db` with a tool like SQLite Manager extension for FireFox.
192
-
11. Get the token from "devicerecord" table.
193
-
194
-
#### {% linkable_title Linux and Android (rooted!) %}
195
-
196
-
1. Configure the light with the Mi-Home app.
197
-
2. Enable developer mode, USB debugging and root permission only for ADB on the Android phone and plug it into the computer.
198
-
3. Get ADB f.e. `apt-get install android-tools-adb`
199
-
4. `adb devices` should list your device
200
-
5. `adb root` (does work for development builds only: ones with `ro.debuggable=1`)
201
-
6. `adb shell`
202
-
7. `echo "select name,localIP,token from devicerecord;" | sqlite3 /data/data/com.xiaomi.smarthome/databases/miio2.db` returns a list of all registered devices including IP address and token.
203
-
204
-
#### {% linkable_title macOS and iOS %}
205
-
206
-
1. Setup iOS device with the Mi-Home app.
207
-
2. Create an unencrypted backup of the device using iTunes.
4. Extract this file: **`/raw data/com.xiami.mihome/1234567_mihome.sqlite`** to your computer, where `_1234567_` is any string of numbers.
210
-
5. Open the SQLite database with a tool like SQLite Manager extension for FireFox or DB Browser. You will then see the list of all the devices in your account with their token. The token you need is in the column **`ZToken`** and looks like **`123a1234567b12345c1d123456789e12`**.
211
-
(Location of SQLite files directly on iOS devices **/private/var/mobile/Containers/Data/Application/A80CE9E4-AD2E-4649-8C28-801C96B16BD7/Documents/**)
143
+
- Try to set `discovery_retry: 10`.
144
+
- Try to disable and then enable LAN access.
145
+
- Hard reset the gateway: Press the button of the gateway 30 seconds and start again from scratch.
0 commit comments