How to find out the token of the vacuum cleaner Xiaomi 2021: expert guide

Smart device owners often face the need to integrate devices into third-party ecosystems such as Home Assistant, Domoticz or OpenHAB. For robotic models released in 2021, standard methods of authorization through a cloud account are often not enough for advanced management. A key security element in the miIO protocol is a unique 32-character key, without which local interaction with the gadget is impossible.

Receiving this key may seem like a challenge for an untrained user, but there are proven methods to extract the necessary data. In this article, we will detail the algorithms of actions that will help you access your device’s local API. We will look at both software and hardware methods relevant to the Vacuum series models released during this period.

It's worth noting that the process of obtaining the key requires carefulness and consistency. Errors at any stage can lead to the need to re-assign the device in the application. So carefully study all the steps before starting the procedure. Successful execution of the instructions will open up new possibilities for automating the cleaning.

Why the owner needs a device token

The main reason users are looking for a way to recognize the Xiaomi 2021 vacuum cleaner token is to go beyond the standard functionality of the Mi Home app. The official software provides basic settings, but creating complex scenarios, such as running a cleanup when everyone leaves the house or integrating with the voice assistants of a local server, requires direct access.

Without this key, you can't send commands directly over your local Wi-Fi network. This restriction is part of the manufacturer's security policy to protect user data. However, for smart home enthusiasts, it becomes a barrier that needs to be overcome by legal means. Once you get the key, you can control the device even if you don't have the Internet, using only the local network.

⚠️ Warning: Keep the token in a safe place. Anyone who has the key and has access to your Wi-Fi network could theoretically have full control of the device, including starting motors or changing room maps.

In addition, the token allows you to use alternative clients and plugins that can display more detailed statistics or provide features not available in the official firmware, for example, you can set up sending notifications about the filling of a container directly to Telegram or integrate the cleaning status into a common control panel of the house, which turns a regular gadget into a full-fledged element of the Smart Home system.

Preparation for the removal of the security key

Before you start technical manipulation, you need to make sure that your environment is ready to go.First of all, make sure that your smartphone and robot vacuum cleaner are connected to the same Wi-Fi network. It is desirable that this is a network with a frequency of 2.4 GHz, since many models in 2021 do not support the 5 GHz standard for the initial setup or operation of IoT protocols.

You also need a Xiaomi account that the device is linked to. If you use different regions in the Mi Home app, choose the one where the device was registered. Most often these are servers in Europe or Russia, but sometimes users choose China for early access to functions. The server region is critical for correctly generating queries when receiving a token.

β˜‘οΈ Test of preparedness for procedure

Done: 0 / 4

Some methods may require additional software to be installed on a computer or smartphone, such as USB debugging utilities or Python scripts. Make sure you have a stable Internet connection on your PC in advance, as the authorization process often requires you to go to the manufacturer's servers to generate temporary access keys.

Method of obtaining through PC Tools in the Mi Home application

One of the easiest and most affordable ways to find out how to token vacuum cleaner Xiaomi 2021 is to use the built-in function of the developer in the mobile application. This method does not require installing additional software on the computer, but requires access rights to hidden menus. First, open the Mi Home app and go to the home page where all your devices are displayed.

Click on the profile icon in the lower right corner, then select region settings. In some versions of the application, you need to quickly click on the region name (for example, "Russia") several times to activate the hidden developer menu. Once you have a message about the developer mode activation, return to the home screen. Now, additional information or the ability to view details may appear in the list of devices next to each gadget.

However, a more reliable way is to use the plugin "PC Tools" or similar add-on panels, if available in your region. Go to profile β†’ Settings β†’ About the program and quickly click on the application version 5-7 times. This will open the debugging menu. Find "Mi Home Plugin Debugging" or "Single Time Mode." Enable the option "Show Device Token".

  • πŸ”‘ Go to the card of your robot vacuum cleaner in the application.
  • πŸ”‘ Click on three dots in the upper right corner to enter the device settings.
  • πŸ”‘ Select "Device Settings" or "General Settings".
  • πŸ”‘ At the bottom of the list should appear a line with a 32-character key.

If the standard path doesn't work, try the quick-click method on the device icon. In some interface modifications, the token is displayed immediately after entering the control menu if debugging mode is enabled. Write down the character combination as it will be needed to set up the integrations.

Use of Xiaomi Cloud Tokens Extractor

If mobile methods fail, the most reliable way is to use a specialized script on your computer. Xiaomi Cloud Tokens Extractor allows you to pull tokens of all devices associated with your account directly from Xiaomi servers. This method is universal and works for most models released in 2021 and later.

You'll need a computer with Python installed to work, and you'll need to set up the libraries you need to do this first, open the terminal or the command line, and type in the dependency command:

pip install -r requirements.txt

Then download the token extractor script itself from the official GitHub repository. Starting the program requires entering a login and password from your Mi Account. The program sends a request to the server, receives a list of devices and their tokens, then displays them in the console or saves them to a file. It is important to use the account to which the vacuum cleaner is attached.

⚠️ Note: Transferring your login and password to a third-party script carries potential risks. Use this method only if you trust the source of the code or run the script in an isolated environment.

After successful execution of the script, you will see a list of all your devices from their IP-address, MAC-Find your vacuum cleaner by model or MAC-Address (it's on the sticker at the bottom of the device) Copy the 32-character string corresponding to the token.

Comparison of data extraction methods

The method you choose depends on your technical background and the specific device model. Mobile methods are simpler, but often depend on the version of the application and the server region. Computer methods are more reliable, but require basic command line skills. Below is a table comparing the basic approaches.

MethodDifficultyRequired SOFTWARESecurity
Mi Home (Developer Mode)Low.Mi Home appendixTall.
PC Tools (Plugin)MediumPlugin inside Mi HomeTall.
Xiaomi Cloud ExtractorTall.Python, GitMedium
Root rights on AndroidVery high.Tadb, Root accessLow.

As you can see from the table, for most users, the best option is to use built-in functions of the application or plugins. Only if mobile methods are completely unavailable should you resort to using Python scripts, which minimizes risks and simplifies the process.

It's also worth considering that once you update the vacuum cleaner or the Mi Home app itself, the way you get a token can change, manufacturers regularly close vulnerabilities that allowed you to access the data, so the method that worked a month ago may no longer be relevant today.

πŸ“Š What method of obtaining a token you used?
Through the Hidden Menu at Mi Home
With Python script on PC
Through root rights on Android
Couldn't get a token.

Solving common problems and errors

Users often encounter common errors in the process of obtaining a token, one of the most common being a message about an incorrect password or the inability to log in to scripts. This may be due to the fact that the account has two-factor authentication (2FA) enabled, in which case, instead of the usual password, you may need to create a special password for applications in the security settings of the Xiaomi account.

Another problem is that the device is not listed after the script is executed. Make sure you select the right server region. If the vacuum cleaner is tied to the server "Europe", and you choose "China", the data will not be received. Also check that the device is displayed in the application and is in the status "Online".

If neither of the software methods works, the last, but most difficult, way is to get a token through a traffic sniffer (like Wireshark) or through USB (ADB) debugging on Android with root rights, a method that requires analyzing encrypted traffic and searching for key packets that only experienced professionals can do.

  • πŸ›‘ Check the correctness of the characters input (the token is case sensitive).
  • πŸ›‘ Make sure the firewall does not block the connection to Xiaomi servers.
  • πŸ›‘ Try re-tethering the device in the application (remove and add again).

In rare cases, the problem may be on the side of Xiaomi servers: If services are overloaded or technical work is underway, receiving a token may be temporarily unavailable.

Set up integration after receiving the key

Once you have identified the Xiaomi 2021 vacuum cleaner token, it must be properly implemented into the management system. In Home Assistant, this is usually done through the configuration.yaml file or through the Xiaomi Miio GUI. IP-Device address, received token and, in some cases, device model.

Example configuration for YAML:

vacuum:


- platform: xiaomi_miio




host: 192.168.1.50




token: 32-character token here




name: Xiaomi Vacuum

Once you add the configuration, restart the system. If done correctly, a new device with full functionality will appear in the interface: start, pause, return to base, select cleaning mode, and you can also see the battery level, the volume of the dust container, and the status of the filters.

Now you can create automation, like running a cleaning operation when a smartwatch detects you're out of the house, or stopping a vacuum cleaner when the front door is open, and the possibilities are limited only by your imagination and the functionality of your smart home system.

Frequently Asked Questions (FAQ)

Does the token change after the vacuum cleaner is dumped to factory settings?
Yes, in most cases, when you completely reset or reassign the device to another account, the token is generated again. You have to repeat the procedure for extracting the key. However, a simple restart or update of the firmware does not change the token.
Can I get a token without connecting a vacuum cleaner to Wi-Fi?
No, the token is generated when the device is linked to the Xiaomi cloud via the Internet. Without initial configuration through the Mi Home application and connection to the network, it is impossible to obtain a valid token.
Is it safe to use third-party integrations with a token?
Using proven open source integrations (like in Home Assistant) is considered safe, as the code is open for audit, but transferring the token to unknown services or cloud platforms is not recommended, as this gives full control over the device.
What if the model of the vacuum cleaner is not supported by integration?
If standard integration doesn’t see the device, try adding it manually, specifying the IP and token. If that doesn’t help, then the command protocol for your model may be different, so you should look for specific plugins or integration forks for your particular model (for example, Dreame, Roborock, Viomi).