How to find a token robot vacuum cleaner Xiaomi Vacuum: a full guide

Owning modern smart tech is often a fascinating quest, especially when standard functionality no longer meets the needs of the advanced user. Xiaomi’s robot vacuum cleaners and their sub-brands (Roborock, Dreame, Viomi) are famous for their effectiveness, but full integration into Home Assistant, HomeBridge, or using third-party plugins requires a unique access key. This key, known as a token, is the digital passport of your device, without which local command transfer is impossible.

Many users are faced with a situation where the Mi Home app is stable, but the attempt to add the device to the alternative ecosystem fails due to the lack of this secret code.Token is a 32-digit hexadecimal string that is generated when the device is associated with a Xiaomi account. Without it, any attempts to communicate directly with the robot over Wi-Fi will be rejected by the security server.

In this article, we will take a closer look at all the current ways to get a token in 2026, given the Chinese giant’s constant updates to security protocols. We will look at methods from simple scripts for PCs to complex manipulation of traffic sniffers, and discuss what to do if none of the methods work.

Why do we need a token and where does it apply?

Before you start searching, you need to understand the architecture of Xiaomi’s ecosystem: the company uses a closed encryption protocol to exchange data between the application and the device. The token acts as an encryption key that allows your local server or script to “pretend” to be an official application and give commands to the robot directly, bypassing cloud servers in China or Europe.

The most common way tokens are searched for integration into Home Assistant, a popular smart home platform that allows you to combine devices from different brands into a single interface. With a token, you get complete control: you can program the vacuum cleaner to start when you leave the house by geolocating your phone, or you can activate quiet mode while watching a movie on your TV.

⚠️ Warning: A token is confidential information, and by transferring it to third parties or entering it into unverified scripts, you theoretically give them complete control over your device, and keep the string in a safe place, and don't publish it in public.

The token is also required for custom cards in the Home Assistant (such as valetudo or xiaomi-vacuum-map-card), which allow you to see in real time the cleaning card, the current position of the robot and the battery level directly on the tablet mounted on the wall, without the token, these integrations will show the status of "Unavailable".

📊 What is your main purpose of obtaining a token?
Integration in Home Assistant
HomeBridge (Apple HomeKit)
Use of third-party plugins
Just for the sake of interest and experimentation.

Preparation: What you need before starting

The process of extracting a token requires some preparation. You don't expect it to work out the first time without first setting up your environment. You'll need a computer (Windows, macOS or Linux) with Internet access and Python installed (version 3.7 or higher). Python is necessary to run extractor scripts that interact with authorization servers.

The second important component is the Xiaomi account itself, which the vacuum cleaner is attached to. Make sure you remember the username and password. If you have two-factor authorization enabled, prepare your phone to receive the confirmation code. It is also crucial to know the region of your account (China, Europe, Russia, USA), because their authorization servers are different, and an error in choosing a region will lead to the wrong result.

☑️ Checklist of preparations

Done: 0 / 5

Also, some methods require temporarily shutting the vacuum cleaner off the network or resetting it to factory settings, so make sure you have free time to do the procedure.If you use a Keenetic or Mikrotik router, you may need skills to set up routing rules or packet installation, but we'll look at simpler, more versatile ways as well.

Method 1: Use of plugins and extensions (the easiest one)

The most affordable method for beginners is to use ready-made browser plugins or specialized utilities that automate the process of obtaining a token. One of the most popular tools in the past is a browser plugin that intercepted tokens when logged into the web version of the cloud. However, due to increased security, this method is unstable.

A more reliable option is to use Xiaomi Cloud Map Extractor integration into Home Assistant, which, if you're already using this platform, allows you not only to get a token, but also to set up the card right away, and the process is you add integration, you enter your account, and the system extracts the keys for all the devices in the house, and it's safe because the code is open and verified by the community.

For Windows users, there's a tool called Xiaomi Vacuum Token Extractor, which is a graphics application where you just type in your login, password, and region, and it will contact the server itself, get a list of devices, and give you tokens, and it eliminates the need to work with the command line.

MethodDifficultySkills requiredRelevance 2026
Home Assistant PluginLow.BasicTall.
Python script (miio)MediumWork with the consoleMedium
Traffic Sniffer (Fiddler)Tall.AdvancedLow (difficult)
Receipt through ADB (Root)Very high.ExpertDepends on the model.

⚠️ Note: Exe files from unverified sources are at risk of stealing your account data, and it is recommended to use only open source scripts from platforms like GitHub with a large number of stars and an active community.

Method 2: Working with Python and the Miio Library

For those who are not afraid of the command line, the classic and most reliable way is to use the miio library (formerly known as python-miio), which works at the API level and allows you not only to get a token, but also to control the device. First, you need to install the library itself. Open the terminal or command line and type in the command:

pip3 install python-miio

Once installed, you will need a script to get the token. In the zvldz developer repository or in the official python-miio documentation, you can find current versions of the script. extract_tokens.py. The launch is carried out by a team where you specify your credentials. 2026 Xiaomi servers may require additional device hash transmission, so use only the latest versions of scripts.

If the script worked successfully, you will see a list of all devices in your account with their IP-address, MAC-And the tokens, you know, are going to be addresses, and most importantly, tokens, and you save that information, and the token will look like a long string of numbers and letters, 32b1c8d9e4f5a6b7c8d9e0f1a2b3c4d5). This is the line you will need to insert into your integration settings.

What to do if the script gives an authorization error?
If you get an error called "Invalid credentials" or "Login failed," check if two-factor authorization is enabled. In some cases, you need to create a temporary password for applications in the security settings of your Xiaomi account. IP-The address is not blocked by the server due to frequent requests – try to wait 15-20 Alternative methods: Traffic sniffering and Root When standard methods fail, heavy artillery is used - analysis of network traffic. This involves installing a sniffer program like Fiddler or Charles Proxy on your computer and setting up your phone to transmit all traffic through that computer, and you have to install a certificate on your phone and in the Mi Home app. You start recording traffic, open the Mi Home app and go to the vacuum cleaner control menu. At that point, the application sends a request to the server with the token, and your task is to find a request in the sniffer logs to the domain api.io.mi.com or similar and extract the token parameter from the token. URL It's complicated, because traffic is often encrypted (SSL Pinning, and you need a modified version of the application. The most radical but guaranteed way is to get the Root rights on the robot vacuum cleaner itself. UART or ADB. By connecting to the debugging contacts on the board, you can read the configuration files directly. However, this method requires soldering, Linux knowledge, and carries a high risk of turning the device into a brick if you do not work. Depending on the region of sale (Global, China, EU) and specific model, data exchange protocols may differ. Below is a summary table that will help you navigate the features of obtaining a token for popular lines. Series vacuum cleaner Connection type Complexity of obtaining a token Features Xiaomi Vacuum 1 / S50 Wi-Fi 2.4 Low Old Protocol, easy to take Roborock scripts S5 / S6 Wi-Fi 2.4 GHz Medium Requires Up-to-date versions of Dreame libraries D9 / F9 Wi-Fi 2.4 GHz Medium Often Requires Wi-Fi Reset to Reconnect Xiaomi X10 / X20 Wi-Fi 2.4/5 It is important to consider that some models, especially those released exclusively for the domestic market of China, may have stripped down functionality when connecting to a European server, and the token in this case may not work for some teams. Always try to tie the device to the region it is intended for. When searching for a token, users often face typical problems, one of the most common is a “Token not found” error or an empty response from the server. This often happens if Xiaomi’s account was created a long time ago and has a legacy of old devices or attachments. Try creating a new, clean account, tying only a vacuum cleaner (by dropping it beforehand) and trying to get the token back. IP-If you run scripts or plugins too often, the security system may temporarily deny access. Solution: wait a few hours or use the VPN other IP-Also make sure your computer has the correct time and time zone, as authorization protocols are sensitive to time desynchronization. ⚠️ Note: If you change your password from your Xiaomi account, all previously received tokens become invalid, you will have to re-extract the procedure for each device, a security measure that cannot be circumvented. Remove the Mi Home app completely from your phone, clear the cache, and re-install it, and then you need to re-authorize and re-link the device, and at that point, the chance of intercepting the token is the highest. 💡The most stable and secure way to get a token in 2026 is to use proven Python scripts or open source integrations. Avoid questionable online services that require password input. Frequently asked questions (FAQ) Can you get a token without a computer only from your phone? Theoretically, yes, using terminal applications (like Termux on Android) and running Python scripts there. However, this requires high skill. For the average user, having a PC (even an old laptop) will make it much easier to use graphical utilities for extraction. What happens if I dump the vacuum cleaner to factory settings? When you reset (usually by clamping two buttons on the case), the Wi-Fi settings are removed, but the device token stored on Xiaomi's server remains the same. However, if you reset your account or untigate the robot, they may not be able to change the token for a month, if you don't log into the new device. If you change your password, update your robot firmware (sometimes it changes your encryption keys), or untie your device, the token will become invalid. You will have to re-extract it. Is it safe to enter your login and password into scripts? The use of official libraries (like python-miio) is safe, as they use standard Xiaomi authorization protocols and do not store your data. The danger is only closed exe files of unknown origin. Always check the source code on GitHub before launching.