From 17ef348307f0d626268148f4a3df7a8adf2352ee Mon Sep 17 00:00:00 2001 From: Andrzej Date: Tue, 1 Dec 2020 13:50:48 +0100 Subject: [PATCH] Add Xiaomi Cloud Tokens Extractor (#15363) --- source/_integrations/xiaomi_miio.markdown | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/source/_integrations/xiaomi_miio.markdown b/source/_integrations/xiaomi_miio.markdown index 827301dfaa0..a26a4b53277 100644 --- a/source/_integrations/xiaomi_miio.markdown +++ b/source/_integrations/xiaomi_miio.markdown @@ -36,6 +36,26 @@ For many of these devices you need an access token, the first section will descr ## Retrieving the Access Token +### Xiaomi Cloud Tokens Extractor + +One of Home Assistant users wrote a tokens extractor tool, which is currently the easiest way to retrieve tokens for all devices assigned to Xiaomi account. +[In the repository](https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor) there's executable for convenient use on Windows or Python script to be run on any platform. If you do not wish to run executable, then you can run it using the source code: + +1. Install requirements: + + ```bash + pip3 install pycryptodome pybase64 requests + ``` + +2. Run script + + ```bash + python3 token_extractor.py + ``` + +3. Provide e-mail address or username for Xiaomi's account, password and country of the account (most used: CN - China Mainland, DE - Germany etc.) +4. Script will print out all devices connected to the account with their IP address and tokens for use in Home Assistant. + ### Xiaomi Home app (Xiaomi Aqara Gateway, Android & iOS) 1. Install the Xiaomi Home app.