The Xiaomi Robot Vacuum Token is a unique digital key that allows third-party applications (such as Home Assistant, ioBroker or Node-RED) to control the device via a device. API, Without this token, you wonβt be able to integrate a vacuum cleaner into a smart ecosystem, automate scheduled cleaning, or use advanced features like zoning through Alice Yandex.
The problem is that Xiaomi doesnβt provide the token openly β it needs to be extracted independently. Since 2020, the company has tightened protections, and old methods (like receiving through mi.io without authorization) have stopped working. In this article, we will discuss 5 current ways to get a token for Mi Robot Vacuum, Dreame, Viomi and others, including bypassing new restrictions.
β οΈ Note: Removing the token may violate Xiaomiβs user agreement. Use it only for personal purposes. Do not distribute the tokens publicly, this will lead to the device being blocked.
1.What is a robot vacuum cleaner token and why is it needed
The token is a 64-digit hex key that identifies your device in the Xiaomi cloud.It is tied to a specific Mi Account account and vacuum cleaner model.Without the token, third-party systems will not be able to send commands through the Xiaomi cloud. API, Xiaomi server will reject the request as unauthorized.
The main scenarios where a token is required:
- π Integration with Home Assistant or ioBroker to control the vacuum cleaner through the dashboard.
- π€ Automating trigger cleaning (for example, starting after you leave home).
- πΊοΈ Extended zoning (indication of exact coordinates of cleaning areas not available in the official annex).
- π± Control via voice assistants (Alice, Google Assistant) with custom commands.
- π§ Debugging and diagnostics of the device through API (check status, errors, charge level).
Without a token, you are limited to the functionality of the Mi Home app, where, for example, you can not clean a schedule in increments of less than an hour or tie a vacuum cleaner to geofences. D9) In Russia, there are no functions that can be unlocked through API.
β οΈ Warning: The token is valid until you log out of your Mi Account on the device or reset it to factory settings.
2. Method 1: Receiving a token through HTTP-Interception (Mi Home App)
This is the most reliable method for 2026, working for most models (Mi Robot Vacuum-Mop 2 Pro, Dreame). L10 Pro, Viomi V3 The idea is to intercept the network traffic of the Mi Home app at the time of device authorization.
You'll need:
- π± Android smartphone (on iOS traffic interception blocked).
- π Annex HTTP Toolkit or Packet Capture (for interception) HTTPS).
- π Mi Account Account with a tied vacuum cleaner.
Step-by-step:
- Install. HTTP Toolkit on PC and connect your smartphone to the same network.
- In Android settings, activate the developer mode (Settings) β The phone. β Build number - tap 7 times) and turn on Debugging by USB.
- Launch it. HTTP Toolkit, select Intercept β Android and Follow the Instructions for Certificate Installation.
- Open Mi Home, go to your vacuum cleaner page and update the data (pull the screen down).
- V HTTP Toolkit search for a request to the domain api.io.mi.com with the path /app/genToken or /home/rpc/....
- The server response will be the line "token": "your token here" - copy it.
Install HTTP Toolkit on PC
Enable debugging on USB Android
Connect your smartphone and PC to the same network
Installation of certificate HTTP Toolkit
Update data in Mi Home
Find a request to api.io.mi.com-->
πΉ Challenges and solutions:
- β No requests visible: Check that Mi Home is disabled VPN and the intercept is on. HTTPS into HTTP Toolkit.
- β Token not found: Try restarting the application or using another interceptor (e.g. Fiddler).
- β Certificate Error: Remove Old Certificates in Settings β Security β Trusted credentials.
π‘
If the token does not appear in the answer, try to start cleaning through the application β sometimes the key is transferred in the request. /home/rpc/MiRobotVacuum_....
3. Method 2: Use of the Miio-Cli utility (for experienced ones)
If the traffic interception didnβt work, you can extract the token using Xiaomiβs official miio-cli utility, which requires command line knowledge but produces 100% results for devices connected to the same account as the PC.
Requirements:
- π» Computer with Node.js (version 14)+).
- π Login and password from Mi Account.
- π‘ The vacuum cleaner and PC should be on the same network.
Instructions:
- Install miio-cli via command: npm install -g miio-cli
- Log in to Xiaomi: miio login your email@mail.ru Your password (if two-factor authentication is enabled, use the key) --password app-password).
- Get a list of devices: miio devices Find your vacuum cleaner in the list - the Token column will have the desired key.
πΉ Advantages of the method:
- β It works even if the traffic interception is blocked.
- β Does not require manual analysis HTTP-request.
- β You can get tokens for all Xiaomi devices in your account.
β οΈ Note: If you have an Invalid credentials error when logging in, check if your account is linked to the cn region (China). --country cn:
miio login your email@mail.ru your password --country cnInterception. HTTP-traffic
Miio-cli utility
Third-party applications (Token Extractor)
Manual input via Mi Home API
Another way.-->
Method 3: Third-party applications (Token Extractor)
For users who don't want to deal with command line or traffic interception, there are specialized utilities.
- π± Mi Home Token Extractor (Android) β automatically extracts the token from the Mi Home cache.
- π₯οΈ Xiaomi Cloud Tokens Extractor (Windows) β works through authorization emulation.
- π Online services (for example, yaho.smarthome.hu) β require login / password.
How to use Token Extractor on Android:
- Download. APK-GitHub file (check repository reputation!).
- Install the application by pre-allowing installation from unknown sources.
- Sign in to Mi Home and start Token Extractor.
- Click Get Token and the key will appear in the list of devices.
πΉ Risks of using third-party utilities:
- β οΈ Phishing: Some "extractors" steal logins/passwords. download only from trusted sources (GitHub, 4PDA).
- β οΈ Account lock: Xiaomi may regard automatic token extraction as hacking and temporarily block access.
- β οΈ Outdated versions: Many utilities have not been updated since 2022 and do not work with new models of vacuum cleaners.
How to verify authenticity APK-file?
5. Method 4: Manual input via Mi Home API (developer)
This method is suitable for those who understand API And I'm willing to work with Postman or cURL. It allows you to get a token without third-party utilities, but it requires technical knowledge.
Algorithm of action:
- Get your vacuum cleaner's deviceID (can be found in Mi Home) β Settings of the device β General information).
- Generate nonce and signature for authorization (use Python script from this repository).
- Send. POST-request https://account.xiaomi.com/pass/serviceLoginAuth2 with parameters: {"clientId": "your_client_id", "password": "your_encrypted_password", "serviceToken": "your_service_token", "nonce": "generated_nonce", "signature": "generated_signature" }
- The answer will be miotSpec with a token.
πΉ Ready-made scripts for automation:
| Language | Repository | Supported models |
|---|---|---|
| Python | mihome-binary-protocol | Mi Robot, Dreame, Viomi |
| Bash | mihome-binary | Devices with MiHome protocol |
| Node.js | miio-api | All models with Miio support |
β οΈ Note: When you manually generate requests, it is easy to make a signature error, which will result in a 30-minute lock.
Method 5: Alternative methods (for Chinese firmware)
If your vacuum cleaner is bought in China or sewn into the cn region, standard methods may not work.
Method 1: Resetting to global firmware
- π§ Use the MiHome Hack utility to change the region of the device to ru or eu.
- π After resetting, the token can be obtained by any of the methods described above.
Method 2: Receiving a token through Mi Home (China)
- Install the Chinese version of Mi Home (APK You can download it from APKPure).
- Sign in with a Chinese phone number (required) SMS-confirmation).
- Add a vacuum cleaner to the app and use it HTTP-interception).
Method 3: Appealing for Xiaomi
In rare cases, support can provide a token on request if you prove ownership of the device.
- Write to the chat Mi Home (Feedback section).
- Attach a photo of the box with the serial number and a purchase check.
- Indicate the reason: βYou need to integrate a vacuum cleaner into a smart home through API".
π‘
For Chinese models (Mi Robot Vacuum-Mop 2 Lite C), the token can be obtained only after changing the region to a global one or through the Chinese version of Mi Home.
7 How to check the token for performance
Once you get a token, you have to check it to make sure it's correct.
Method 1: Through miio-cli
miio --debug call your deviceID infoIf the token is correct, the team will return it. JSON with device data (model, charge, status).
Method 2: Through Python scripting
from miio import Vacuum
vacuum = Vacuum(ip="IP_ vacuum cleaner", token="your token"
print(vacuum.info())Method 3: Through Postman
Send. GET-request:
http://IP_ vacuum cleaner/miIO/infoIn the headings, indicate:
X-MIIO-TOKEN: Your TokenπΉ Frequent errors and their causes:
| Mistake. | Reason. | Decision |
|---|---|---|
| Invalid token | Wrong token or device is not online | Check it out. IP-vacuum address and token |
| Device not found | The vacuum cleaner is off or not on the same network | Restart the device and router |
| Permission denied | Token is tied to another account | Get a new token for your current account |
β οΈ Note: If the vacuum cleaner produces a Token expired error, it means that the key has been reset (for example, after updating the firmware), in which case you will have to receive the token again.