Xiaomiβs robot vacuum cleaners are some of the most popular smart home devices, but their full use outside the standard Mi Home app requires a special token. This unique identifier allows you to integrate a vacuum cleaner with Home Assistant, Node-RED, third-party applications, or even write your own scripts for automation. Without a token, you will not be able to remotely control the device via APIs, configure complex scenarios, or bypass regional restrictions.
The problem is that Xiaomi doesn't provide the token openly, it has to be extracted independently, and the way it gets it has changed over the years: if it used to be enough to intercept traffic through the Internet. HTTP-Proxies now require workarounds due to tighter security, and in this article we will look at all current methods (including those that work in 2026), their pros and cons, and give step-by-step instructions based on the latest firmware updates.
What is the token robot vacuum cleaner Xiaomi and why it is needed
A token (or token) is a unique 32-character alphanumeric key that identifies your device in the Xiaomi ecosystem, generated by the companyβs servers when the vacuum cleaner is first linked to an account and used to authorize API requests. Without the token, third-party applications will not be able to:
- π± Manage the vacuum cleaner through Home Assistant, ioBroker or OpenHAB.
- π Bypass regional locks (e.g. for use in Europe).
- π€ Automate cleaning on schedule, taking into account motion or humidity sensors.
- π Get advanced statistics (cleaning cards, working hours, wear of brushes).
It is important to understand that the token is tied to a specific Mi Account account and device. If you dump the vacuum cleaner to the factory settings or re-link it to another account, the old token will stop working, and Xiaomi can block tokens when suspicious activity (for example, too frequent requests to the API).
β οΈ Warning: Never share your token in open sources (forums, githab, chat rooms) and attackers can use it to control your vacuum cleaner or even steal your Mi Account data.
Method 1: Receiving a token through Mi Account (official method)
This is the easiest and safest way to do this, but it only works for devices tied to a Chinese server (cn). If your vacuum cleaner is connected to servers in Europe (eu), Russia (ru), or the United States (us), this method will not work β you will need to change the region (more on this below).
Instructions:
- Open the Mi Home app and go to profile (the person icon in the lower right corner).
- Click on Account Settings β Security β Devices with access.
- Find your robot vacuum cleaner in the list and copy the Device ID string (e.g., 123456789).
- Go to account.xiaomi.com, log in and open the developer tools (F12 in the browser).
- The Network tab β find the request to /api/user/getProfile β in the answer will be the token field.
If the token field is missing, your account is not authorized to view the tokens.
- π Change your account region to China (instructions in the following section).
- π§ Write in support of Xiaomi with a request to provide a token (specify Device) ID).
π‘
If you have multiple vacuum cleaners, the tokens for each device will be different, and keep them in a secure place (for example, in a password manager).
Method 2: Changing the server region to China (to receive a token)
If your vacuum cleaner is tied to servers in Europe, Russia or the United States, the official method won't work, so the solution is to temporarily change your account region to China, and you can get a token, and then you can reset your settings.
Step-by-step:
Remove the vacuum cleaner from your Mi Home|Region to China (mainland.cn)|Reconnect the vacuum cleaner via Wi-Fi|Receive the token via Mi Account (Method 1)|Return the former region (optional)
-->
Important nuances:
- π± The Mi Home app must be Chinese version (download) APK APKPure).
- β οΈ After the region change, all devices in the account will be untied.
β οΈ Note: Some vacuum cleaners (e.g. Xiaomi Mi Robot Vacuum-Mop 2 Pro) may block the cleaning function when changing region, 4PDA).
Method 3: Intercepting a token through HTTP-Proxies (for experienced proxies)
This method works for all regions, but requires network skills, and the essence is to intercept traffic between the Mi Home app and Xiaomi servers when the token is transferred in the open.
What you need:
- π± Android smartphone with root rights or PC with root rights Fiddler/Charles Proxy.
- π Installed proxy certificate on the device (for decryption) HTTPS).
- π‘ Local network where the vacuum cleaner and smartphone are connected to the same router.
Instructions for Charles Proxy:
- Install Charles Proxy on your PC and configure a proxy on your smartphone (PC IP address, port 8888).
- In Charles, enable SSL Proxying for the domain api.io.mi.com.
- Start Mi Home, log in and wait for synchronization with the vacuum cleaner.
- In Charlesβs logs, search for /api/user/getProfile, and the answer will be the token field: βyour token.β
For Android without root:
1. Install the Packet Capture app from Google Play.
2. Configure the filter to the domain api.io.mi.com.
3. Start capturing traffic and open Mi Home.
4. In the logs, find JSON with the "token" field.What to do if the token is not visible in the logs?
Method 4: Retrieving a token through ADB (for Android)
If you have an Android smartphone with root rights, you can extract the token directly from the Mi Home application database, which works regardless of the server region.
Instructions:
- Connect your smartphone to your PC and launch the adb shell.
- Follow the commands: su cd /data/data/com.xiaomi.smarthome/databases sqlite3 mihome.db.tables
- Find the table miuser and execute: SELECT * FROM miuser;
- The output will be the token field with your key.
If the table mihome.db is missing, try:
- π Search for a token in a file /data/data/com.xiaomi.smarthome/shared_prefs/mihome_preferences.xml.
- π± Use a root-access file manager (e.g., Root Explorer).
β οΈ Note: Modifying files in /data/data/ Mi Home may crash.Before manipulation, back up the folder com.xiaomi.smarthome.
Method 5: Alternative methods (for advanced users)
If none of the above methods worked, the less standard, but working options remain:
| Method | Difficulty | Essential tools | Notes |
|---|---|---|---|
| Python script with Mi Account | Medium | Python 3, the miio library | Requires a username/password from Mi Account. Script example: GitHub. |
| Branded by Dreame | Low. | Dreamehome app (for Dreame vacuum cleaners) | The token can be extracted from the application logs via logcat. |
| Reverse development of APK | Tall. | JADX, Apktool | It requires Java/Kotlin knowledge, you need to decompile Mi Home and find a class of work with tokens. |
For Dreame vacuum cleaners (such as Dreame D9 or DreameBot L10 Pro), the token can be obtained through the Dreamehome app:
- Install Dreamehome and tie the vacuum cleaner.
- Connect your smartphone to your PC and launch adb logcat | grep "token".
- During synchronization with the vacuum cleaner, a string with a token will appear in the logs.
π‘
For Dreame vacuum cleaners, the token can often be found in a file /data/data/com.dreame.robot.vacuum/databases/robot_db table robot_info.
Frequent mistakes and their solutions
When you get a token, you're going to have a typical problem, and here's how to solve it:
- π Token is invalid or expired: Xiaomi Tokens can be βburntβ by: Changing password in Mi Account, updating vacuum cleaner firmware, prolonged inactivity (more than 6 months). Solution: get a new token by any of the methods described.
- π« The error "Invalid token" when using API: Check: Server region (cn token won't work on eu) Device correct ID (The token format (32 characters, no spaces) must match that of the Mi Home).
- π Account blocked after multiple requests: Xiaomi may temporarily block accounts when suspicious activity occurs (e.g. 100)+ request API Solution: Wait 24 hours. Change your Mi Account password. Use the official "unlock" app".
If the vacuum cleaner stopped responding to commands after changing the token, perform:
- Reboot the vacuum cleaner (hold the power button for 10 seconds).
- Reset Wi-Fi settings in Mi Home (Device settings β Network reset).
- Re-link to the account.