Xiaomi vacuum cleaner token: where is it, how it looks and why you need it

You bought a Xiaomi robot vacuum cleaner and came across the term β€œtoken” (or β€œtoken Β«API-But you don't know what it is or where to look for it? This article will look at everything from the appearance of the token to how it is obtained and used. We will show real screenshots from the Mi Home app, explain why the token is important for integration with Home Assistant, Alice from Yandex or third-party firmware, and warn about the risks of its disclosure.

To be clear, the token is a unique numeral code that identifies your vacuum cleaner in the Xiaomi ecosystem. Without it, it is impossible to connect the device to alternative smart home systems or use advanced features through the use of a new system. API. Externally, it looks like a long string of 32 characters (digits and Latin letters in lower case), for example: a1b2c3d4e5f6...z9y8x7w6v5u4t3s2. But where to find him?

Unlike the serial number (which is usually marked on the case or box), the token cannot be seen physically β€” it is generated software and stored only in the Xiaomi cloud or locally in the application.

What is Xiaomi vacuum cleaner token and why you need it

A token (or API-token) is a password analog for accessing vacuum cleaner control via MiOT (Mi IoT) protocol.

  • πŸ”„ Integrate vacuum cleaner into smart home systems (Home Assistant, OpenHab, ioBroker).
  • πŸ“± Manage your device through third-party applications (such as Mi Home Alternative or Robot Vac).
  • πŸ› οΈ Use advanced functions not available in the official annex (e.g., coordinate zoning).
  • πŸ—£οΈ Connect voice assistants (Alice, Google Assistant) without region restrictions.

Without a token, you are limited to only the basic features in Mi Home, such as:

  • ❌ Set up automatic cleaning on schedule through Home Assistant.
  • ❌ Receive notifications about the completion of cleaning in Telegram.
  • ❌ Use alternative maps with detailed visualization.

Important: the token is tied to a specific device and Mi Account. If you dump the vacuum cleaner to the factory settings or sell it, the token will become invalid. Xiaomi can also block the token if unauthorized access is suspected (for example, if too many requests to the token are made to the token). API).

πŸ“Š Why do you need a Xiaomi vacuum cleaner token?
Integration with Home Assistant
Management through Alice
Third-party applications with advanced functions
Firmware experiments
Other

What the token looks like: format and examples

Xiaomi vacuum cleaner token is a string of 32 symbols, consisting of Latin letters (a-f) and numbers (0-9). Examples:

  • 5f3e2d1c0b9a8f7e6d5c4b3a2f1e0d9c
  • 1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d
  • 9876543210abcdef9876543210abcdef

Please note:

  • βœ… Symbols are always in lower case (no capital letters).
  • βœ… No gaps, dashes or other dividers.
  • βœ… It is always 32 characters long – if you have shorter or longer, it is not a token.
CharacteristicsDescription
Length32 characters
RegisterOnly the bottom (a-f, 0-9)
Examplea1b2c3d4e5f67a8b9c0d1e2f3a4b5c6d
Where it's storedIn the cloud Xiaomi or locally in Mi Home
Duration of validityBefore resetting the device or changing the account

Users sometimes confuse the token with other identifiers:

  • ❌ Serial number (S/N) β€” It is written on the body, consists of letters and numbers, but shorter (for example, 123456789ABC).
  • ❌ MAC-address XX:XX:XX:XX:XX:XX (for example, 1A:2B:3C:4D:5E:6F).
  • ❌ ID Device (did) – a digital identifier in Mi Home (e.g. 12345678).

πŸ’‘

If you see a string that is 64 characters long, it's not a token, it's an encrypted key (for example, for firmware), and the token is always 32 characters.

Where to find a token in the Mi Home app (official way)

Since 2023, Xiaomi has hidden the tokens from users for security reasons, but they can still be extracted legally through debugging mode in Mi Home.

  1. Open Mi Home and go to profile (the human icon in the lower right corner).
  2. Press on. βš™ Settings β†’ About the programme.
  3. Tap the app version 10 times in a row until the notification β€œDeveloper Mode is on” appears.
  4. Return to the main menu, open the device settings (vacuum cleaner) and find a new item Information for developers.
  5. In this section, you will have a Token string – copy it.

For iOS, the way is more complicated:

  • βœ… Requires jailbreak or special software (for example, MiToken).
  • βœ… The alternative is to use MITM-Proxies (e.g. Fiddler) to intercept traffic.

If there is no β€œInformation for Developers” item:

  • πŸ”Ή Update Mi Home to the latest version.
  • πŸ”Ή Check that the vacuum cleaner is connected to the same account from which you logged in to the application.
  • πŸ”Ή For some models (e.g. Xiaomi Mi Robot Vacuum-Mop 2 Pro), the token may be hidden – an alternative method will be required (see next section).

β˜‘οΈ Preparation for the extraction of the token

Done: 0 / 4

Alternative ways to get a token (if it is not in the Mi Home)

If the official method didn’t work, try these options:

1. via the Mi Account web interface

Go to account.xiaomi.com, log in and:

  1. Open the devices. β†’ Your vacuum cleaner.
  2. Press Settings β†’ Additionally.
  3. V URL-The address of the page will be the did parameter=... β€” it ID It can be used to generate a token through API.

2. With Python script (for advanced ones)

Install a python-miio library and do:

from miio import Vacuum


vacuum = Vacuum(ip="192.168.1.100", token="YOUR_TOKEN_HERE")




print(vacuum.info())

Replace 192.168.1.100 with IP-address of your vacuum cleaner in the local network.

3. Through parser applications

Applications like Mi Token Extractor (Android) or Token Grabber (Windows) automatically extract the token from Mi Home traffic.

  • ⚠️ The possibility of transferring data to third parties.
  • ⚠️ Blocking your account with frequent requests.
What to do if the token does not work?
If the token stopped working, check: - Have you changed the password from the Mi Account (token is reset). - Have you dumped the vacuum cleaner to the factory settings. - Has the device software been updated (sometimes Xiaomi forcibly resets the tokens). Has Xiaomi blocked your account for suspicious activity (e.g., too many requests to your account)? API short-term).

Risks and security: what happens if the token falls into the wrong hands

The token gives you complete control of your vacuum cleaner, and if it's stolen, the intruder can:

  • 🚨 Start/stop cleaning at any time.
  • πŸ“ Get a map of your home (with the layout of walls and furniture).
  • πŸ”Š Turn on voice alerts or sounds.
  • πŸ”„ Update the firmware of the device (potentially β€œbrick” it).

⚠️ Warning: Never publish a token in open sources (forums, GitHub, chats). Use environment variables or encrypted storage to integrate with Home Assistant.

How to defend yourself:

  • πŸ”’ Store the token in a password manager (e.g., KeePass or Bitwarden).
  • πŸ”„ Change your Mi Account password regularly (this will reset all active tokens).
  • πŸ›‘οΈ Set up two-factor authentication in Mi Account.
  • πŸ“΅ Limit access to the vacuum cleaner on the local network (for example, through router rules).

If you suspect a token leak:

  1. Change your password from your Mi Account immediately.
  2. Reset the vacuum cleaner to factory settings (Settings) β†’ Reset at Mi Home).
  3. Create a new token (it is generated automatically after a reset).

πŸ’‘

A token is like a key to your apartment, but for a vacuum cleaner. Keep it as carefully as real keys.

Examples of Token Use: From Home Assistant to Alice

Let’s consider the popular scenarios of the use of the token.

1.Integration with Home Assistant

Add to the configuration.yaml file:

vacuum:


- platform: xiaomi_miio




host: 192.168.1.100




token: YOUR_TOKEN_HERE

2. Management through Alice (Yandex)

In the settings of the skill "Xiaomi" in the Yandex application, specify:

  • IP-vacuum-dress.
  • Token.
  • Model of device (e.g, roborock.vacuum.a1).

3. Alternative applications (e.g. Robot Vac)

When you first connect, enter:

  • IP-vacuum cleaner address (find in router or via Mi Home).
  • Token.
  • Region (usually cn for China or ru for Russia)
ServiceWhat can I do?Example of team
Home AssistantAutomatic cleaning on scheduleautomation: trigger: platform: time pattern: "08:00:00" action: service: vacuum.start entity_id: vacuum.xiaomi_vacuum
Alice.Voice-activated cleaning"Alice, run the vacuum cleaner in the living room."
Robot VacZoning by coordinatesSet the zone: [20000,20000,25000,25000]
miio --ip 192.168.1.100 --token YOUR_TOKEN info

If the team returns information about the vacuum cleaner (model, charge, status) – the token works.-->

Frequent mistakes and how to fix them

If the token does not work, check:

⚠️ Attention: Device not found often means that the vacuum cleaner and the device you are sending the command from are on different networks.

Mistake.Reason.Decision
Invalid tokenWrong token or dropped accountGet a new token (see section above)
Device offlineThe vacuum cleaner's off the grid.Check the Wi-Fi connection on the vacuum cleaner
Unsupported deviceThe wrong model in the configurationPlease indicate the correct do or model.
Too many requestsExceeded the limit of requests to the APIWait 10-15 minutes or change the token

If the vacuum cleaner does not respond to commands:

  1. Reboot it (hold the power button for 5 seconds).
  2. Check if the router firewall is blocking traffic to port 54321 (used for MiOT).
  3. Update the vacuum cleaner firmware through Mi Home.
Can I use one token for several vacuum cleaners?
No, every vacuum cleaner has a unique token tied to its did (ID If you have two vacuum cleaners, you need to get two different tokens.
What to do if the token reset after updating the firmware?
A firmware update doesn't always reset the token, but if it did: Remove the device from Mi Home. dump the vacuum cleaner to factory settings (hold on Wi-Fi) + 3 seconds power button. Reconnect and retrieve the new token.
Can I get a token without root rights on my phone?
Yes, Android is enough developer mode in Mi Home (see instructions above). MITM-proxy or third-party services (e.g. mihome.bindha.cn).
How to find out the model of the vacuum cleaner for configuration?
Model indicated: On the box (e.g. Xiaomi Mi Robot Vacuum-Mop) 2 In Mi Home: Device settings β†’ About the device β†’ Model. Through the command (if the token already exists): miio --ip 192.168.1.100 --token YOUR_TOKEN info | For Home Assistant, the model is listed in roborock.vacuum.{code}. Popular codes: Mi Robot Vacuum-Mop 2 Pro β†’ roborock.vacuum.a15 Mi Robot Vacuum-Mop P β†’ roborock.vacuum.m1s Mi Robot Vacuum-Mop 2 Lite β†’ roborock.vacuum.c1
Legal: Does Xiaomi allow the use of the token for third-party systems?
Xiaomi does not officially prohibit the use of the token for personal purposes (for example, integration with Home Assistant).However: It is forbidden to distribute tokens publicly. Xiaomi may block account if abuse is suspected API (For legal use, it is recommended: Do not exceed the limit of requests (no more than 10 requests per minute), Do not transfer the token to third parties, Use the token only on the local network (no cloud services).