Where to get a token for a vacuum cleaner Xiaomi: all the ways of 2026

Lost access to control of the robot vacuum cleaner Xiaomi through Mi Home or third-party applications like Home Assistant? Without a token, the device will not respond to commands from the outside, neither through APIs nor through voice assistants. This article will help find or generate a token for any model, from the Mi Robot Vacuum first version to Xiaomi Vacuum-Mop 2 Ultra.

We'll look at 5 working methods, from official receipt via Mi Home to workarounds for devices with a China-based connection, and explain why a token might stop working and how to fix it. Importantly, the procedure is different for devices released before and after 2021 β€” more on that below.

What is Xiaomi vacuum cleaner token and why you need it

The token is a unique 32-digit access key that Xiaomi servers generate when you first link the vacuum cleaner to your account.

  • πŸ”— Integration with Home Assistant, ioBroker or other smart home systems.
  • πŸ“± Control through informal applications (for example, Valetudo for cloud-free firmware).
  • πŸ—£οΈ Voice control via Alice, Google Assistant or Siri (unless Mi Home is used).
  • πŸ› οΈ Debugging and diagnostics through Python scripts or MQTT.

Without a token, the vacuum cleaner will only work through the original Mi Home app (or Xiaomi Home for new models), and if you reset your device to factory settings or change your account, the token will automatically be canceled and you will have to re-receive it.

πŸ“Š What kind of vacuum cleaner Xiaomi you have?
Mi Robot Vacuum 1/1S
Mi Robot Vacuum-Mop 2
Xiaomi Vacuum-Mop 2 Ultra
Another model

Method 1: Receiving a token through Mi Home (official method)

The easiest way is to extract the token from the Mi Home app traffic, which works for devices linked to an account in China, Europe, Russia (but not for servers in Singapore or India).

  • πŸ“± Android smartphone (on iOS method does not work due to restrictions) HTTP-traffic).
  • πŸ”Œ A vacuum cleaner already linked to your Mi Home account.
  • πŸ’» Computer with Fiddler or Charles Proxy (for interception of traffic).

Step-by-step:

  1. Install Mi Home on Android and log in.
  2. Set up Fiddler to intercept HTTPS-Traffic (enable Decrypt) HTTPS traffic).
  3. On the smartphone in the Wi-Fi settings, specify a proxy server (IP of your PC and port 8888).
  4. Open Mi Home, go to the vacuum cleaner page and update the data (pull the screen down).
  5. In Fiddler, search for the domain api.io.mi.com with the path /app/genToken – the answer will be the line β€œtoken”: β€œyour token”.

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

Done: 0 / 5

⚠️ Note: If there is no token in the server response, check the account region. For Chinese servers (cn), the token can be transmitted in encrypted form - additional decoding via miio-cli will be required.

Method 2: Removing a token from a Mi Home backup

If you have a Mi Home data backup (made through Settings β†’ About β†’ Backup), the token can be extracted from the file without intercepting traffic.The method works for backups created before April 2023 (after which Xiaomi changed the encryption format).

Instructions:

  1. Download the backup to your computer (file with the.mihome extension).
  2. Rename the extension to.zip and unpack the archive.
  3. Open the mihome.sql file in the text editor.
  4. Find the line with "token" = "- after it will be your key.

For new backups (after 2023), you will need a mihome-bin-decrypt tool:

python3 mihome_bin_decrypt.py -i backup.mihome -o output.sql
How to find out the date of creation of the backup?
Open the.mihome file in the archiver (e.g. 7-Zip) and see the date of change of the mihome.sql file – this is the backup date.

Method 3: Using a miio-cli script for new models

For vacuum cleaners released after 2021 (such as the Xiaomi Vacuum-Mop 2 Pro or DreameBot L10 Ultra), Xiaomi has implemented additional protection.The token is now tied to a unique device ID (did) and requires confirmation through the Mi Home API.

The receiving algorithm:

  1. Install Node.js and the miio-cli library: npm install -g miio-cli
  2. Sign in to Mi Home via the console: miio login (enter the login / password from the account to which the vacuum cleaner is attached).
  3. Get a list of devices: miio devices Find your vacuum cleaner in the list and copy it did.
  4. Create a token: miio token --did your did

If the command returns the Invalid device id error, it means:

  • πŸ”΄ The device is linked to another account.
  • πŸ”΄ Vacuum cleaner not connected to Wi-Fi.
  • πŸ”΄ Your account is linked to the cn server (China) and you are using the European version of miio-cli.

πŸ’‘

If the miio-cli does not find the device, try to manually specify the region:

miio --region cn devices
miio --region ru devices

Method 4: Receiving a token through Valetudo (for hardwired devices)

If your vacuum cleaner is running on Valetudo custom firmware (an alternative to Mi Home without the cloud), the token can be generated directly in the web interface:

  1. Connect to the vacuum cleaner IP-address (e.g, http://192.168.1.100).
  2. Go to Settings β†’ Cloud Interface β†’ Mi Home Token.
  3. Press the Generate Token and the system will create a new key.

Advantages of this method:

  • βœ… Token is not tied to Xiaomi account – works even after reset.
  • βœ… No dependency on Mi Home servers (suitable for blocking by region).
  • βœ… You can use Home Assistant without cloud intermediaries.

⚠️ Note: Valetudo firmware will void the warranty and may result in the device being locked if Xiaomi detects a modification.Before installing, back up the original firmware!

Method 5: Buying a token from third parties – risks and alternatives

Offers for the sale of tokens for Xiaomi vacuum cleaners (for example, on AliExpress or thematic forums) are usually priced at 200-500 rubles, but this method has critical drawbacks:

RiskEffects of consequencesHow to avoid
πŸ”“ Account data breachThe seller can access your Mi Home and other devices.Use a separate account for the vacuum cleaner.
🚫 Locking the deviceXiaomi may block the vacuum cleaner for suspicious activity.Buy tokens only from trusted sellers with a guarantee.
⏳ Temporary tokenThe key may stop working in 1-3 months.Check with the seller the expiration date.

Alternatively, you can rent a cloud server (like Nabu Casa for Home Assistant) that manages the authorization itself, starting at $5 per month, but without the risk of being blocked.

πŸ’‘

Buying a token is a last resort, and try Valetudo’s official methods or firmware first if you’re ready to lose your warranty.

Frequent mistakes and their solutions

If the token does not work or the vacuum cleaner does not respond to commands, check:

  • 🌍 Server Region: China (cn) firmware devices will not work with tokens received through European servers (eu). β†’ Region).
  • πŸ”„ Reset device: After hard reset (holding the button 10 seconds), the token is reset.
  • πŸ“‘ Lockdown IP: If you frequently request a token, Xiaomi may block your IP 24 hours. Use it. VPN (The region is the same as the Mi Home server).
  • ⏱️ Token expires: Keys obtained through miio-cli are valid for 1 year.

If the vacuum cleaner gives an error Device not found when using the token, check:

  1. Is it connected to the same Wi-Fi network as the device that sends the commands?
  2. Hasn't he changed? IP-Address (use static address) IP router).
  3. Has the device firmware been updated (sometimes Xiaomi changes the protocols of interaction).

FAQ: Answers to Frequent Questions

Can I use one token for several vacuum cleaners?
No. The token is tied to a specific device (did) and account. Each vacuum cleaner needs a separate key, except if the devices are linked to a single Mi Home account and managed through Valetudo.
Why did the token stop working after the firmware update?
Xiaomi periodically updates security protocols. If after the update the vacuum cleaner stopped responding to commands through the API, try: Get a new token through miio-cli. roll back the firmware (if there is a backup). Use Valetudo to bypass cloud restrictions.
How to check if the token is valid?
Send a test command via miio-cli: miio call your did miIO.info If the answer contains device data (model, firmware, charge) - the token is working. If the error Invalid token - the key is invalid.
Can I get a token without root rights on my phone?
Yes. Root is not required for any of the methods described. Enough: Traffic interception (Fiddler/Charles) Access to the backup Mi Home. Using miio-cli or Valetudo. Root may only be needed to modify the system files Mi Home, but it is not safe and not recommended.
What if the vacuum cleaner is linked to a Chinese account (cn) and I am in Europe?
There are 3 options: Change your account region (the risk of locking your device); use a VPN with a Chinese IP when you receive a token; flash Valetudo and abandon Mi Home; the most reliable way is Valetudo, but it requires technical skills.