Why you need a token Xiaomi Mi Robot Vacuum Mop P and where to look for it
The Xiaomi Mi Robot Vacuum Mop P device token is a unique 32-digit key that unlocks advanced robot features through third-party apps (such as Home Assistant, IoBroker or Valetudo). Without it, you wonโt be able to integrate a vacuum cleaner into a smart home, use automation on a schedule, or manage it through voice assistants (such as Alice or Google Assistant) without the official Mi Home app.
The problem is that Xiaomi does not provide the token openly โ it needs to be extracted independently. In this article, we will discuss all the current ways to obtain a token for Mi Robot Vacuum Mop P (models). STYJ02YM, STYTJ01ZHM And similar, including Mi Home, batch sniffing, alternative apps, and even manual firmware extraction, youโll also learn how to circumvent Xiaomiโs token issuance restrictions for devices tied to Chinese servers.
โ ๏ธ Important: Some methods require root rights on a smartphone or use PC s Windows/Linux. If you are a beginner, start with the simplest ways (sections) 2 and 3).
Method 1: Receiving a token through the official Mi Home app (without root)
This is the safest and most legal method, but it only works for devices tied to servers outside of China (e.g. Russia, Europe, Singapore). If your vacuum cleaner is connected to the Chinese region (cn), go to Method 4.
Instructions:
- Open the Mi Home app and go to your robot profile (Devices โ Mi Robot Vacuum Mop P).
- Press three points (โฎ) in the upper right corner and select Settings.
- Scroll down to General and click About the program.
- Slip on the firmware version 5 times in a row - the hidden developer menu will open.
- In this menu, select Get Token, and the system will generate the key and copy it to the clipboard.
โ ๏ธ Note: If there is no Get Token item, then:
- ๐น Your device is linked to a Chinese server (cn).
- ๐น You have an outdated version of Mi Home (update the app).
- ๐น Xiaomi has blocked the issuance of tokens for your model (relevant for new firmware after 2023).
Checklist before token extraction
โ๏ธ Preparation for obtaining a token
Method 2: Use of alternative applications (Token Extractor)
If the standard method didnโt work, you can use third-party utilities that extract the token from traffic between the smartphone and Xiaomi servers.
- ๐ฑ Mi Home Token Extractor (for Android) โ works without root, but requires permission to capture packets.
- ๐ฅ๏ธ Python-script miio-cli (for the PC) โ Suitable for advanced users.
- ๐ Bash-Xiaomi Web Service โ extracts the token through the browser (risky, as you transfer data to third parties).
Instructions for Android (without root):
- Return to Token Extractor โ the token will appear in the log (look for the line โtokenโ: โ...โ).
โ ๏ธ Note: Some antiviruses (e.g. Avast) may block Token Extractor as "potentially dangerous software." This is a false positive - the application does not steal data, but only analyzes network traffic.
๐ก
If the token doesnโt show up, try turning off Wi-Fi on your smartphone and turning on mobile data โ sometimes this helps get around Xiaomiโs limitations.
Comparison of methods of token extraction
| Method | Root is required. | It works with Chinese servers. | Difficulty | Risks. |
|---|---|---|---|---|
| Through Mi Home (Hidden Menu) | โ No. | โ No. | โญEasy | No. |
| Token Extractor (Android) | โ No. | โ Yes. | โญโญMedium | False positives of the antivirus |
| miio-cli (Python) | โ No. | โ Yes. | โญโญโญHard | Requires skills to work with the terminal |
| Sniffing traffic (Wireshark) | โ Yes. | โ Yes. | โญโญโญโญExpert | Hard for beginners. |
Method 3: Manual token extraction for devices on a Chinese server (cn)
If your Mi Robot Vacuum Mop P is tied to a Chinese region, the standard methods will not work, and you will have to use one of the following methods:
Method A: Change server region (without data loss)
This is the most reliable way, but it requires the vacuum cleaner to the factory settings.
- In Mi Home, remove the vacuum cleaner from your account (Device Settings โ Delete Device).
- Reset the robot to factory settings: press the Power button for 10 seconds until you hear the beep.
- Connect the vacuum cleaner to Wi-Fi, but donโt add it to the Mi Home.
Method 1
Method B: Extracting a token through firmware (for advanced)
This method requires access to the robotโs file system and works only on firmware to the 3.5.8_004076.
Detailed instructions for extracting the token from the firmware
โ ๏ธ Attention: Mishandling your firmware can permanently incapacitate your vacuum cleaner. If you are unsure of your skills, use Method 2 or consult a specialist.
๐ก
Changing the server region is the only officially supported way to get a token for devices on Chinese servers, and all other methods may stop working after a firmware update.
Method 4: Receiving a token through batch sniffing (Wireshark)
This method is suitable for Windows/Linux PCs and requires minimal knowledge of networking technology, the point being to listen to traffic between your smartphone and Xiaomi servers when you are operating a vacuum cleaner.
Required SO:
- ๐ฅ๏ธ Wireshark (for packet capture).
- ๐ฑ Packet Capture (for Android, it requires root).
- ๐ง mitmproxy (an alternative to advanced).
Step-by-step:
- Connect your PC and smartphone to the same Wi-Fi network.
- Run Wireshark on PC and set up the filter: tcp.port == 80 || tcp.port == 443.
- On your smartphone, turn on the proxy server (IP of your PC, port 8888).
- In Mi Home, perform any action with a vacuum cleaner (for example, start cleaning).
- In Wireshark, look for packages with api.io.mi.com or cn.api.io.mi.com.
- In the body of the package (Take Follow โ TCP Stream tab), look for the line "token": "...".
๐ How to speed up your search: Use the filter http.request.uri contains "miio" or json contains "token".
๐ก
If the token is not located, try filtering traffic by MAC-You can find it in the router settings or through the arp command. -a terminally.
Method 5: Buying a token from third parties โ is it worth the risk?
On the Internet you can find offers for the sale of tokens for Xiaomi Mi Robot Vacuum Mop P (price is usually 100-500). โฝ). However, this method has critical risks:
- ๐ด Fraud: 80% of โsellersโ disappear after paying.
- ๐ด Data Leak: To generate a token, scammers can request access to your Mi Home account.
- ๐ด Device lock: Xiaomi may ban vacuum cleaner for suspicious activity.
- ๐ด Irrelevant token: The key can be generated for another model or outdated firmware.
๐ก Alternative: If you need a token to integrate with Home Assistant, try using a cloud connector (like Mi Home Binary Sensor.
๐ก
Buying a token from third parties is the worst option. Even if you are not cheated, Xiaomi can block the device for suspicious activity.
Frequent mistakes and their solutions
When you extract a token, you're faced with typical problems, and here's how to solve them:
| Mistake. | Reason. | Decision |
|---|---|---|
| There is no Get Token item on the menu | Device on a Chinese server or outdated firmware | Use Method 3 or Method 2 |
| Token Extractor does not find a token | Block traffic with antivirus or VPN | Turn off VPN and add Token Extractor to antivirus exceptions |
| The token consists of one zero (0000...) | Incorrectly copied or outdated | Repeat the procedure or check the relevance of the firmware |
| Wireshark does not see packages with token | Traffic encrypted (HTTPS) | Use mitmproxy to decrypt SSL |
โ ๏ธ Note: If after receiving the token vacuum cleaner stopped responding to commands from Mi Home, follow:
- Reboot the robot (hold the power button for 5 seconds).
- Remove the device from your account and add it again.
- Check if the token has changed after the firmware update.