How to Get a Xiaomi Robot Vacuum Token: 5 Working Ways (Updated 2026)

Xiaomi’s robot vacuum cleaner token is a unique digital key that unlocks advanced device features, such as integration with Home Assistant, Node-RED, third-party apps, or even creating your own automation scripts. Without it, you’re limited to the standard Mi Home functionality, and with it, you control the vacuum cleaner through voice assistants, task schedulers, or custom control panels.

The problem is that Xiaomi doesn't provide the token openly, but it needs to be extracted from app traffic, intercepted through debugging tools, or obtained by decoupling. In this article, we're looking at the current 2026 methods that work for all models: from Mi Robot Vacuum. 1S to DreameBot Z10 We will analyze the methods of different complexity: from simple (via Mi Home) to advanced (using Python and Wireshark).

Important: the token is tied to Xiaomi account and device. If you dump the vacuum cleaner to factory settings or change the region of the account, the token will become invalid. Xiaomi periodically updates security protocols β€” some methods may stop working. We monitor the relevance and update the instructions.

1.What is a robot vacuum cleaner token and why is it needed

A token (or device token) is a 32-digit alphanumeric code that identifies your device in the Xiaomi ecosystem.It is generated when you first connect a vacuum cleaner to your account and is used to authorize requests to the company's cloud servers. Without a token, third-party systems won’t be able to send commands to a vacuum cleaner, even if they know it. DID (unique identifier of the device).

Examples of use of the token:

  • 🏠 Integration with Home Assistant: Vacuum control via dashboards, schedule automation or triggers (e.g., starting cleaning when leaving home).
  • πŸ€– Python Scripts: Creating custom cleaning algorithms (zonal cleaning, obstacle avoidance, dynamic power change).
  • πŸ“± Alternative apps: Valetudo, DreameHome or Mi Home Lite with advanced features.
  • πŸ”§ Debugging and Repair: Diagnosing Errors Through API, Resetting settings without physical access to the device.

Without a token, you are limited to the official Mi Home app, where functionality is often stripped down (for example, you can’t configure cleaning by coordinates or change the card settings). With a token, you get full control of the device, including access to undocumented commands (for example, turning on the test mode of the engines or resetting the brush counter).

⚠️ Warning: Don't give your token to third parties! With it, you can not only control the vacuum cleaner, but also access other devices in your Xiaomi account if they use the same server region. Store the token in a secure place (for example, in a password manager).

2.Preparation: What to do before extracting the token

Before proceeding to receive the token, follow the mandatory steps:

Make sure the vacuum cleaner is connected to Wi-Fi (2.4 GHz)

Update the Mi Home app to the latest version

Put the debugging on. USB on a smartphone (for methods with traffic interception)

Create a backup of vacuum cleaner settings in Mi Home

Check that your Xiaomi account is linked to the Mainland China region (for some methods)

-->

The most reliable way to use an account is to use a Mainland China account, because Xiaomi shares servers for different regions, and tokens received in the European or Russian version of Mi Home may not work with third-party services.

  1. Open Mi Home β†’ tap on the avatar β†’ Account settings.
  2. Select Country/Region β†’ Mainland China (China).
  3. Leave the account and log in again.
  4. Connect the vacuum cleaner to the account again (it will appear in the list of devices).

If you don’t want to change the region, you can still get the token, but some commands are available. API They may not work well, but also note that for methods that intercept traffic (HTTP-Server or Fiddler requires root access on Android or jailbreak on iOS, or emulator use.

Mi Robot Vacuum 1/1S/1C

Mi Robot Vacuum-Mop 2/2S/2 Pro

DreameBot (D9, Z10, L10 etc.)

Viomi (SE, V3, etc.)

Other (specify in the comments)

-->

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

This method works for most models and does not require technical skills, the point is to pull the token from the cache of the Mi Home application using a special script.

Steps for Android:

  1. Download and install the Mi Home Backup app (unofficial but verified by the community).
  2. Open Mi Home Backup and click Login with Xiaomi Account.
  3. Enter your username/password from your Xiaomi account (the region must be Mainland China).
  4. After authorization, select your vacuum cleaner in the list of devices.
  5. Click Backup Device Data – the token will appear in the Token field.

Steps for iOS:

On the iPhone, the process is more complicated because of the system limitations.

  1. Install Mi Home on a Mac OS via an emulator (e.g. Xcode) + iPadian).
  2. Use mitmproxy or Charles Proxy to intercept traffic (instructions below in method 4).
  3. Or use a Python script that emulates authorization.

If Mi Home Backup doesn’t show the token, try:

  • πŸ”„ Restart the application and repeat authorization.
  • πŸ“± Remove the Mi Home cache in the phone settings.
  • 🌐 Change your account region to Mainland China (if you haven’t already done so).

πŸ’‘

If you have two-factor authentication in your Xiaomi account, temporarily disable it before using Mi Home Backup, this will eliminate authorization errors.

4. Method 2: Intercepting a token through HTTP-server (for advanced servers)

This method requires Python and terminal skills, but it gives you 100% results, and we're going to emulate the Xiaomi server so that the Mi Home app sends a token to it.

What you need:

  • πŸ’» Computer with Python 3.8+ and the mitmproxy library.
  • πŸ“± Smartphone with Mi Home and Wi-Fi access.
  • πŸ”Œ A vacuum cleaner connected to the same Wi-Fi as a computer.

Step-by-step:

  1. Install mitmproxy via the terminal: pip install mitmproxy
  2. Launch a proxy server: mitmweb --mode transparent --showhost (The web interface will open on http://127.0.0.1:8081)
  3. On your smartphone, connect to Wi-Fi, where mitmproxy works, and configure a proxy: IP your computer (to know via ipconfig or ifconfig) port: 8080.

mitmproxy

http://mitm.it

Mi Home

mitmproxy

api.io.mi.com

/app/genNonce

/app/login

"ssecurity"

Example of a server response with a token:

{


"code": 0,




"message": "ok",




"result": {




"ssecurity": "5f4dcc3b5aa765d61d8327deb882cf99," // ← This is a token




"location": "CN",




"userId": 123456789




}




}

⚠️ Note: If you are using Mi Home versions older than 6.0.100, Xiaomi may block uncertified proxies, in which case try to roll back to an older version of the app (e.g. 5.9.54) or use the method with Packet Capture (described below).

5. Method 3: Using Packet Capture (without root)

If previous methods have failed, try to intercept the token using the Packet Capture app (available for Android).This method does not require root rights, but caution is needed - not all versions of the Mi Home are compatible.

Instructions:

  1. Download Packet Capture from Google Play.
  2. Open the app, press Start Capture and select HTTP/HTTPS.
  3. Return to Mi Home, log in to your account and wait for the device list to load.
  4. Stop capturing traffic in Packet Capture and search for a request to api.io.mi.com.
  5. In the server response, look for the β€œtoken” or β€œssecurity” field.
What if Packet Capture doesn’t show a token?
If after a few attempts, the token does not appear, chances are your version of Mi Home uses encryption that Packet Capture cannot decrypt: 1. Try the method with mitmproxy (the method) 2). 2. Or use an Android emulator with the Mi Home version 5.5–5.9 (download APK Available on APKPure). 3. For Dreame models (e.g. DreameBot) D9) The token can be obtained through the official DreameHome application - in it the token is stored in open form in the configuration file (path: /data/data/com.dreame.vacuum/files/device_token.txt).

6. Method 4: Removing tokens from Mi Home files (for Android with root)

If your phone has root access, the token can be extracted directly from Mi Home files, a method that is robust but requires caution – incorrect actions can cause the app to crash.

Step-by-step:

  1. Install a file manager with root support (such as Root Explorer or FX File Explorer).
  2. Cross the path: /data/data/com.xiaomi.smarthome/databases Look for the file. miio_device.db or com.xiaomi.smarthome_preferences.xml.
  3. Open the file. miio_device.db In the text editor and find the line with your vacuum cleaner (ID device).
  4. If there is no file, check the folder: /data/data/com.xiaomi.smarthome/shared_prefs There may be a file here. device_token.xml informatively.

Example of contents miio_device.db:

Field.MeaningDescription
did123456789Unique. ID vacuumer
token5f4dcc3b5aa765d61d8327deb882cf99Token of the device
nameMi Robot VacuumName of device
modelroborock.vacuum.a1Model vacuum cleaner

⚠️ Note: Modifying files in the folder /data/data/ You can also back up the file before editing, and don’t transfer the token through unsecured channels (such as open chats or forums) – it can be used to control your vacuum cleaner!

Method 5: Alternative methods (for specific cases)

If none of the above methods worked, try these options:

  • πŸ”§ Through Mi Home for PC: Install the desktop version of Mi Home and use Fiddler or Wireshark to intercept traffic. api.io.mi.com/miot-spec/v2/instance.
  • πŸ€– For Dreame robots: In the DreameHome app, the token is stored in the open. ADB for retrieval: adb shell "cat" /data/data/com.dreame.vacuum/files/device_token.txt"
  • πŸ“‘ Mi Cloud Tokens Extractor: The online service mi.tokens.extractor (unofficial) allows you to get a token by login / password from your Xiaomi account.Risk! Enter data only if you trust the resource.
  • πŸ”„ Reset and Re-Association: If the vacuum cleaner was previously linked to another account, reset through a button on the case (press Reset for 5 seconds), then re-assign and re-extract the token.

For Viomi models (e.g. Viomi) V3) The token can be obtained through the Viomi Home app using the same method as mitmproxy. The main thing is to make sure that the account region is set in China, otherwise, the user can use the same method. API-The requests will go to other servers.

vacuum:


- platform: xiaomi_miio




host: IP_DUST




token: Your Token

After the Home Assistant reboot, the vacuum cleaner will appear in the interface as a controlled device.-->

8. Frequent errors and their solutions

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

Mistake.Reason.Decision
The token is not displayed in Mi Home BackupIncorrect account region or outdated version of the applicationChange region to Mainland China and upgrade Mi Home to the latest version
mitmproxy does not intercept trafficNot installed or blocked by XiaomiInstall the certificate in a trusted and use Mi Home versions 5.9-6.0
The token consists of one zero (0000...)File Reading Error or Wrong PathCheck the access rights to the folder /data/data/ and re-search
Vacuum cleaner not responding to token commandsThe wrong server region or an outdated tokenCheck the region of the account and get the token again
Packet Capture doesn't show api.io.mi.comMi Home uses an encrypted connectionReverse to Mi Home 5.5-5.9 or use mitmproxy

If you get an Invalid token error when using the token in Home Assistant or other systems, make sure that:

  • πŸ”— Token copied without spaces and unnecessary symbols.
  • 🌍 The account region matches the server region in the integration settings.
  • πŸ”„ You didn’t dump the vacuum after receiving the token (this dumps the token!).

FAQ: Answers to Frequent Questions

❓ Does the token change after updating the vacuum cleaner firmware?
No, the token is tied to the account and device, not the firmware version, but once the vacuum cleaner is reset to the factory settings or the Xiaomi account is changed, the token will become invalid and you will need to retrieve it.
❓ Can I use one token for several vacuum cleaners?
No, each vacuum cleaner has a unique token, but one Xiaomi account can manage multiple devices, and each one needs to extract a token separately.
❓ Does the token received in the China region work in Europe?
Yes, but this requires that the servers of the Home Assistant or other software are configured to the China region (the server setting must be cn).
❓ How to check that the token works?
Python: From Mio Import Vacuum Vacuum Vacuum = Vacuum(ip="IP_WULES, token="Your Token) print(vacuum.status()) If the team returns the vacuum cleaner status (e.g. charge level, cleaning status), the token is valid.
❓ Can I get a token without changing the region of the account?
Tokens received in the regions of Russia, Europe or Singapore may not work with third-party services due to different factors. API-Mainland China is recommended for full compatibility.