How to find out the token of the Xiaomi vacuum cleaner on your computer: all working methods of 2026

Xiaomi’s robot vacuum cleaners (including Mi Robot Vacuum, Viomi, Dreame models) require a unique token to integrate with third-party smart home systems – Home Assistant, ioBroker or Node-RED. This token acts as a β€œpassword” for remote device management via the MIOT- protocol. The problem is that Xiaomi does not officially provide the token to users, hiding it in encrypted packages of the Mi Home application.

In this article, 5 current ways to extract a token on a PC (including methods for Windows, Linux and macOS), analyze typical errors (for example, Invalid token or Device not found), and how to check the token for health without risking blocking an account. All instructions are tested on models from 2020-2026 and are compatible with the latest firmware versions.

Why Xiaomi vacuum cleaner token cannot be officially obtained

Xiaomi intentionally restricts access to device tokens for three reasons:

  • πŸ”’ Security: The token allows you to control the vacuum cleaner remotely, which creates the risk of unauthorized access (for example, through vulnerabilities in Home Assistant).
  • πŸ“Š Ecosystem Control: Xiaomi is pushing its own Mi Home platform and restricting integration with competitors (e.g. Google Home or Apple HomeKit).
  • πŸ“ˆ Monetization: Some features (such as zoning or schedules) may be paid for on third-party systems, whereas on Mi Home they are free.

However, the token can be extracted legally – it is stored in the cache of the application on your smartphone or transmitted in plain form when connected to the vacuum cleaner via Wi-Fi. The main thing is not to violate the user agreement (for example, do not distribute tokens publicly).

πŸ“Š What kind of vacuum cleaner Xiaomi you have?
Mi Robot Vacuum-Mop 2 Lite
Viomi V3
Dreame D9
Xiaomi Mi Robot Vacuum (1st generation)
Other

Method 1: Retrieving a token through Mi Home (Android) + PC

The most reliable method is to intercept traffic between the Mi Home app on your smartphone and Xiaomi servers.

  • πŸ“± Android smartphone with Mi Home installed (version no lower than 6.0).
  • πŸ’» A computer with Windows/Linux/macOS and a Fiddler or Charles Proxy program.
  • πŸ”Œ One Wi-Fi router (vacuum cleaner and smartphone must be on the same network).

Step-by-step:

  1. Install Fiddler (free) or Charles Proxy (paid but with a trial).
  2. On your smartphone, turn on Developer Mode (7 times click on the Build Number in your phone settings) and activate Debugging over USB.
  3. Connect your smartphone to your PC via USB and in Fiddler go to Tools β†’ Options β†’ Connections. Check Allow remote computers to connect.
  4. On your smartphone, in Wi-Fi settings, hold your finger on your network, select Change Network β†’ Additionally, and in the Proxy field, specify the IP- address of your PC and the 8888 port.
  5. Start Mi Home, update the vacuum cleaner data (for example, open its map). In Fiddler, filter the queries by domain api.io.mi.com.
  6. Find a query with a URL containing /home/rpc/. The server response will have a string like β€œtoken”: β€œyour token here” (usually 32 characters).

Install Fiddler/Charles on PC

Enable the developer mode on Android

Connect your smartphone to your PC via USB

Set up a proxy on your smartphone

Update the vacuum cleaner data in Mi Home-->

⚠️ Warning: If there is no token in the server’s response, check:

  • Mi Home version (in the old versions, the token was transferred openly, in the new versions it is encrypted).
  • Account region (China Mainland and Europe server tokens are different).
  • Availability of a VPN (disable it – it can redirect traffic)

Method 2: Use Mi Home Lite (without root)

The Mi Home Lite app stores tokens unencrypted in a configuration file, which works without root rights but requires access to the smartphone file system.

Instructions:

  1. Install Mi Home Lite from APKPure (official store may not be suitable).
  2. Log in and add a vacuum cleaner (if it was already in Mi Home, the data is synchronized automatically).
  3. Connect your smartphone to your PC and use ADB to copy the file: adb pull /data/data/com.xiaomi.smarthome.lite/shared_prefs/mihome_lite_preferences.xml
  4. Open the downloaded file in any text editor and find the string <string name="device_token_DID vacuum cleaner">... where the DID is a unique device identifier (e.g., 123456789).
How do I know the DID vacuum cleaner?
DID (Device ID) can be found in Mi Home: open the vacuum cleaner card β†’ Settings (βš™οΈ) β†’ About the device β†’ "ID devices" (usually 8-10 digits).

⚠️ Warning: If the mihome_lite_preferences.xml file is empty or there is no token in it, try:

  1. Restart Mi Home Lite and update vacuum cleaner data.
  2. Use another file: /data/data/com.xiaomi.smarthome.lite/databases/mihome.db (SQLite editor needed).

Method 3: Through ADB (for advanced users)

If you have root access on your smartphone, the token can be extracted directly from the Mi Home database using ADB. This method is suitable for Xiaomi and Viomi,Released models after 2019.

Steps:

  1. Install ADB Tools on your PC and connect your smartphone over USB.
  2. Run the command to access the shell: adb shell su cd /data/data/com.xiaomi.smarthome/databases sqlite3 mihome.db
  3. Enter SQL- request to search for the token: SELECT token FROM devices WHERE deviceID='DID vacuum cleaner';

If the token is not displayed, try an alternative request:

SELECT * FROM devices;

πŸ’‘

If ADB issues a β€œpermission denied” error, check if root rights are enabled on your smartphone and if Magisk is installed (for modern Android).

Model vacuum cleanerCompatibility with ADBNotes
Mi Robot Vacuum 1Sβœ… Yes.The token is stored in mihome.db
Viomi V3βœ… Yes.You may need a SQLite Editor.
Dreame D9⚠️ Partially.Token is encrypted, you need a Python script
Mi Robot Vacuum-Mop 2 Liteβœ… Yes.It only works with Mi Home versions 5.9-6.1.

Method 4: Intercept the token through HTTP-proxy (without PC)

If you don’t have a computer, you can get the token using the HTTP- proxy directly on your smartphone. This will require the Packet Capture app (or HTTP Toolkit for Android).

Algorithm:

  1. Install Packet Capture and enable traffic recording.
  2. Start Mi Home and update the status of the vacuum cleaner (for example, click Cleaning).
  3. Stop posting and filter queries for the keyword miot-spec.org.
  4. In the body of the answer, find the token field. If it's not, check the api.io.mi.com queries.

⚠️ Warning: Some versions of the Mi Home use HTTPS with pinning, which blocks interception, in which case only changing the certificates (instruction below) will help.

How to get around HTTPS-pinning in Mi Home?
1. Install Frida on PC: pip install frida-tools. 2 Connect your smartphone and start the script: frida -U -l mihome_ssl_pinning.js -f com.xiaomi.smarthome --no-pause 3. The script mihome_ssl_pinning.js can be found on GitHub.

Method 5: Generation of a token through a Python script

For Dreame models (such as Dreame D9 or DreameBot L10 Pro), the token can be generated using Python and the miio library.

Instructions:

  1. Install Python 3.8+ and the Miio: Pip install python-miio library
  2. Download the mi_token_extractor.py script.
  3. Run the script with parameters (replace the IP_ vacuum cleaner and DID): python mi_token_extractor.py IP_ DID vacuum cleaner

Example of conclusion:

Device ID: 123456789


Token: a1b2c3d4e5f678901234567890abcdef




Model: dreame.vacuum.p2046

⚠️ Warning: If the script gives an error Device did not respond, check:

  • The vacuum cleaner is on and connected to the same Wi-Fi as the PC.
  • Windows Firewall allows traffic to port 54321 (using the MIOT protocol).
  • IP- address of the vacuum cleaner is static (assign it in the router settings).

How to check the token for performance

Before using the token in Home Assistant or other service, be sure to check it.

  1. Install Node.js and the Miio: npm install miio library
  2. Create a test_token.js file with the code: const miio = require('miio'); miio.device({address: 'IP_ vacuum cleaner', token: 'your token' }).then(device => console.log('Success! Model:', device.model)).catch(err => console.error('Error:', err));
  3. Start the script: node test_token.js.

If the output contains a vacuum cleaner model (e.g. roborock.vacuum.s5), the token is working.

Mistake.Reason.Decision
Invalid tokenWrong token or regionCheck the region of the account in Mi Home (configure the server in the script)
Device not foundThe vacuum cleaner is off or offlineReboot the vacuum cleaner and router
TimeoutFirewall lockingDisable Windows Defender or add an exception to miio

πŸ’‘

If the token stopped working after 1-2 weeks, Xiaomi could reset it.Repeat the extraction procedure or use Home Assistant with Xiaomi Miio Auto integration, which updates the tokens automatically.

Frequent mistakes and their solutions

When you extract a token, you're faced with typical problems, and here's how to solve them:

  • πŸ”„ The token changes after the Mi Home update: Xiaomi periodically resets the tokens for security.Use Home Assistant with the Xiaomi Cloud Map Extractor plugin, which updates the token automatically.
  • 🌍 Region error: If the vacuum cleaner is bought for China and the account is registered in Europe, the token will not work. The solution is to change the region in Mi Home (account settings β†’ Country/Region).
  • πŸ”’ Account is blocked: if tokens are extracted too often, Xiaomi may temporarily block access.Wait 24 hours or contact support via the official website.

If none of these methods worked, try:

  1. Reset the vacuum cleaner to the factory settings (press the power button for 10 seconds).
  2. Use a virtual machine with Android-x86 and a clean Mi Home installation.
  3. Contact the Home Assistant community – there are up-to-date scripts for new models.
Can I get a Xiaomi vacuum cleaner token without a smartphone?
Yes, but only for models that support LAN- protocol (for example, Roborock S7). Use Python script with the miio library, specifying IP- vacuum address. For most Xiaomi models (for example, Mi Robot Vacuum 1C), the smartphone is mandatory.
What if the token is 64 characters instead of 32?
This is an encrypted token (usually in Base64 format) that needs to be decoded. In Linux/macOS, use the command: echo "your token" | base64 --decode.
How to find out IP- address of a vacuum cleaner for a Python script?
IP- address can be found: In the router (DHCP Clients section or Connected Devices). Through Mi Home: Open vacuum card β†’ Settings β†’ About device β†’ Local area network. Using a network scanner (for example, Advanced IP Scanner).
Is it safe to share a token with others?
No. The token gives you full control of the vacuum cleaner: an attacker can: Run the cleaning at any time; access your home map (if the vacuum cleaner supports LDS- mapping); remove the device from your Mi Home account; use the token only on trusted systems (e.g., local Home Assistant).
Do these methods work for Dreame vacuum cleaners?
Yes, but with reservations: For Dreame D9/D10, a Python script is suitable (the 5 method). DreameBot models (for example, L10 Pro) require a cloud token that can be obtained through specialized tools. Mi Home does not support Dreame - use the Dreame application, but the token is extracted similarly (via HTTP-proxy).