How to get a token vacuum cleaner Xiaomi: 4 working methods (current in 2026)

Xiaomiโ€™s robot vacuum cleaners are some of the most popular smart home devices, but fully managing them through third-party applications (like Home Assistant or ioBroker) requires a dedicated access token. Without it, you wonโ€™t be able to integrate the vacuum cleaner into your own automation system, customize advanced scenarios, or use alternative branded clients.

The problem is that Xiaomi doesnโ€™t officially provide the token to users โ€“ it needs to be extracted independently. In this article, we will discuss all the current ways to obtain the token for Mi Robot Vacuum, Mi Robot Vacuum-Mop, Xiaowa and others, including bypassing the new restrictions of 2023-2026. You will learn how to do this through Mi Home, ADB, HTTP-Proxies and even without root rights on the phone.

Importantly, the procedure is different for devices tied to cn (China), ru (Russia) and eu (Europe), and we will specify the nuances for each region.

1 What is Xiaomi Token and Why is it Needed

A token is a unique 32-character key (e.g. a1b2c3d4e5f6...1234567890abcdef) that identifies your device in the Xiaomi cloud.

  • ๐Ÿ”Œ Integration with Home Assistant, ioBroker or Node-RED โ€“ without a token, these systems will not be able to send commands to the vacuum cleaner.
  • ๐Ÿ“ฑ Use alternative applications (such as Mi Home Lite or Vacuum Map) that offer advanced map, cleaning and statistics features.
  • ๐Ÿ› ๏ธ Debugging and Diagnostics through Python libraries like python-miio.
  • โš™๏ธ Automatic scripting settings (for example, running a scheduled cleaning service through Google Assistant or Alice without a branded app).

Since 2022, Xiaomi has tightened its security policy, with tokens being dynamically updated (every 2-3 months) and the old methods of extracting them no longer working.

โš ๏ธ Warning: Donโ€™t give your token to third parties! It can be used to control your vacuum cleaner remotely, including starting a cleaning or changing settings.

2. Method 1: Receiving a token through Mi Home (the easiest)

This method works for most models (Mi Robot Vacuum 1S, Mi Robot Vacuum-Mop 2 Lite, etc.) if the device is tied to a Xiaomi account on the ru, eu or us server. For Chinese servers (cn), additional configuration will be required (see section 4).

Steps:

  1. Install the latest version of Mi Home from Google Play or App Store.
  2. Log in to your Xiaomi account and make sure the vacuum cleaner is connected to the app.
  3. Go to Profile โ†’ Settings โ†’ General settings โ†’ About the program and tap 5-7 times according to the application version until the inscription โ€œYou became a developerโ€ appears.
  4. Return to the main menu, open the list of devices and select your vacuum cleaner.
  5. Put three points on it (โ‹ฎ) in the upper right corner and select "Device Information".
  6. Scroll down to the Token block - copy it.

โ˜‘๏ธ What to do if the token is not in Mi Home

Done: 0 / 4

If the token is not in the device information, then your account is tied to a Chinese server (cn), or Xiaomi has hidden this option for your model.

๐Ÿ“Š What server is your Xiaomi account using?
China (cn)
Russia (ru)
Europe (eu)
United States (us)
Other

3. Method 2: Extracting a token through HTTP-proxy (no root rights)

This method is suitable for Android users who do not have root rights, but have access to the vacuum cleaner's Wi-Fi network.We will intercept traffic between the Mi Home app and Xiaomi servers using the help of the Wi-Fi vacuum cleaner. HTTP-proxy.

It is necessary:

  • ๐Ÿ“ฑ Android smartphone (version 8.0 and higher).
  • ๐Ÿ’ป Computer with Python 3.8 installed+ and the mitmproxy library.
  • ๐Ÿ“ก The vacuum cleaner and phone must be connected to the same Wi-Fi network.

Instructions:

  1. Install mitmproxy on your computer: pip install mitmproxy
  2. Launch a proxy server: mitmproxy --mode transparent --showhost (remember IP-address and port, for example, 192.168.1.100:8080).
  3. On your phone, set up your Wi-Fi connection so that traffic goes through a proxy: Open your Wi-Fi settings. Tap on the current network โ†’ Change Network โ†’ More. Select Manual Proxy Setup and enter your mitmproxyโ€™s IP/port.
  4. Install mitmproxy certificate on your phone: Open in the browser http://mitm.it. Download the certificate for Android and install it in Settings โ†’ Security โ†’ Certificate Installation.

Mi Home

mitmproxy

api.io.mi.com

/home/device_list

Example of server response (see the "token" field):

{


"result": [




{




"did": "1234567890",




"token": "a1b2c3d4e5f67890123456789abcdef01",




"name": "Mi Robot Vacuum",




"model": "roborock.vacuum.s5"




}




]




}

โš ๏ธ Note: Since 2023, Xiaomi has been encrypting some of the traffic. If there is no token in the response, try Method 3 or use Packet Capture (an Android app with interception function). HTTPS).

4. Method 3: Obtaining a token through ADB (for advanced)

If previous methods failed, you can extract the token directly from the memory of the Mi Home app using ADB (Android Debug Bridge), which requires USB debugging on the phone, but does not require root rights.

Preparation:

  • ๐Ÿ”ง Turn on Developer Mode on your phone (tap 7 times on build number in Settings) โ†’ The phone).
  • ๐Ÿ”Œ Turn on Debugging. USB developer-setting.
  • ๐Ÿ’ป Install. ADB on the computer (instructions for Windows/Linux/macOS).

Step-by-step:

  1. Connect the phone to your computer via USB and confirm access for debugging.
  2. Execute the command to obtain a list of packages: adb shell pm list packages | grep mihome (should display com.xiaomi.smarthome).
  3. Download the Mi Home database: adb pull /data/data/com.xiaomi.smarthome/databases/mihome.db
  4. Open mihome.db with SQLite Browser or DB Browser for SQLite.
  5. Go to the device table โ€“ the token column will have the desired key.

If the table of devices is empty or there is no token:

  • ๐Ÿ”„ Update the data in Mi Home (pull the screen down).
  • ๐Ÿ“ฑ Restart the application.
  • ๐Ÿ” Check the other tables: device_record or miot_devices.
adb backup -f mihome.ab com.xiaomi.smarthome

Then extract the data from the backup with abe (Android Backup Extractor).-->

5. Method 4: For vacuum cleaners on a Chinese server (cn)

Devices tied to the cn server in China require additional actions due to the strict restrictions of Xiaomi, which can help to change the account region or use an intermediary (for example, the Mi Account Unlocker service).

Option 1: Change the region of the account

  1. Go to account.xiaomi.com and log in.
  2. Go to Personal Info โ†’ Country/Region.
  3. Change the region to Russia (ru), Europe (eu) or Singapore (sg).
  4. Confirm the change by SMS/email.
  5. Remove the vacuum cleaner from the Mi Home and add it again โ€“ the token will appear in the device information.

Option 2: Use Mi Account Unlocker

If the change of region did not help, use services like com.xiaomi_miio (Risk: such methods may violate Xiaomiโ€™s user agreement.

serverMethod of obtaining a tokenDifficultyRisks.
ru/eu/usThrough Mi Home (Section "Device Information")โญ (simple)No.
cnChange of account region + re-bindingโญโญ (middle-of-the-road)You may need a VPN.
Anybody.HTTP-proxy (mitmproxy)โญโญโญ (difficult)Requires skills to work with ADB
Anybody.ADB (DB extraction)โญโญโญโญ (advanced)I need a USB debugging.

โš ๏ธ Note: After the change of cn region โ†’ Some vacuum cleaner functions (such as voice commands in Chinese) may stop working, and Xiaomi may block an account for frequent changes in the region (limit - 1 time every 30 days).

6. Frequent errors and their solutions

When you get a token, you're going to have a typical problem, and we've collected some of the most common ways to fix it.

  • ๐Ÿ”ด "Token not in Mi Home": Check the version of the app (should be the last one). Make sure the vacuum cleaner is tied to the same account as the phone. Change server region (see Method 4).
  • ๐Ÿ”ด "Mitmproxy doesn't intercept traffic": "Verify that the certificate is installed in trusted. HTTPS-Check in Mi Home settings (if you have one). Use Packet Capture instead of mitmproxy.
  • ๐Ÿ”ด "ADB Not seeing the device: Install drivers for your phone (e.g. Google) USB Driver. Try another one. USB-Cable (original, preferably) Turn on Debugging USB (safety settings).
  • ๐Ÿ”ด "Token doesn't work in Home Assistant": Check you've copied the token without spaces. Update Xiaomi Miio integration into Home Assistant. make sure the vacuum cleaner is on the network (Wi-Fi indicator burns blue).
What to do if the token has changed?
Since 2023, Xiaomi has started updating tokens every 2-3 months. If your token stopped working: 1. Repeat the procedure for receiving (preferably via Mi Home or ADB). 2. In Home Assistant, update the device configuration. 3. If the vacuum cleaner is displayed as "unavailable", reboot it (press the power button for 10 seconds).

7 Security: How to Protect Your Token

The token gives you complete control over your vacuum cleaner, so it should be stored as carefully as the password from your Xiaomi account.

  • ๐Ÿ” Do not publish the token in open sources (forums, GitHub, comments).
  • ๐Ÿ“ Store the token in a secure location (for example, in the Bitwarden or KeePass password manager).
  • ๐Ÿ”„ Regularly update the token (every 3-6 months), especially if you suspect a leak.
  • ๐Ÿ›ก๏ธ Use two-factor authentication in your Xiaomi account.

If you suspect that the token has been compromised:

  1. Untie the vacuum cleaner from your Mi Home account immediately.
  2. Change the password from your Xiaomi account.
  3. Get a new token and update it in all integrations.

๐Ÿ’ก

Never enter a token on suspicious sites promising โ€œextended featuresโ€ for a vacuum cleaner, and fraudsters can use it to remotely control your device or steal account data.

โ“ Can I get a token without a phone (only from a computer)?
Yes, but it's more complicated. You'll need an Android emulator (like BlueStacks) with Mi Home installed, an ADB to extract data from the emulator, or using mitmproxy on an emulator, and it's much easier to use a real phone.
โ“ Why is a token made up of 32 characters and I have fewer?
You didn't copy the token, but the DID (device ID) or part of the hash. The right token always looks like a1b2c3d4e5f67890123456789abcdef01 If there are fewer characters, check the source (you may have been looking in the wrong place in Mi Home or database).
โ“ Does this work for Roborock (for example, S7 or S8)?
Yes, Roborock (a subsidiary of Xiaomi) uses the same token system. The instructions from this article are suitable for models: Roborock S5/S6/S7/S8, Roborock Q5/Q7, Roborock E4/E5. Except that new models with v2023+ firmware may require additional authentication.
โ“ Can I use one token for several vacuum cleaners?
No, every device has a unique token, and if you have two vacuum cleaners, you have to get your own key for each.
โ“ What to do if Xiaomi has blocked the account for frequent change of region?
Contact support via support.xiaomi.com. When blocking, you usually need: passport photo (to verify identity), vacuum cleaner purchase check, explanation of the reason for changing the region (specify "moving" or "setting error"). Unlocking takes 3 to 7 days.