Where to get a token for Xiaomi Vacuum Cleaner 1S: all manner of

Access token is a unique numeral key that is required for the integration of Xiaomi Mi Robot Vacuum Cleaner. 1S with third-party smart home systems such as Home Assistant, ioBroker or Node-RED. Without it, connecting to alternative platforms is impossible, since the manufacturer limits the official API Apps: Mi Home or Xiaomi Home.

Many users face a problem: the token does not appear in the device settings, and standard methods for extracting it (for example, through Packet Capture on Android) stopped working after firmware updates. In this article, we will analyze all the current ways to obtain a token for Vacuum Cleaner. 1S, including official and workarounds, as well as common errors that interfere with successful connection.

If you plan to use a vacuum cleaner with voice assistants (Alice, Google Assistant) or automate cleaning through scripts, the token will become a prerequisite.It is important to understand that its issuance does not violate the warranty, but requires caution - improper actions can lead to locking the device in the Xiaomi account.

๐Ÿ“Š Why you need to token Xiaomi Vacuum Cleaner 1S?
Integration with Home Assistant
Connection to ioBroker
Automation through Node-RED
Another option
I don't know, just curious.

What is a token and why is it needed

Token is an analogue of a password for interacting with API It is generated by Xiaomi servers when you first connect the vacuum cleaner to your account and is used to authorize requests. Without the token, third-party systems will not be able to send commands to Vacuum Cleaner. 1S, The server will reject them as unauthorized.

The main scenarios where a token is required:

  • ๐Ÿ”„ Integration with Home Assistant or OpenHAB to control vacuum cleaner through a single smart home panel.
  • ๐Ÿค– Automating cleaning on schedule or triggers (for example, in the absence of people at home).
  • ๐Ÿ“ฑ Use of alternative applications with advanced features (e.g. Valetudo for open source firmware).
  • ๐Ÿ”Š Voice control via Alice or Google Assistant without official Xiaomi app.

Important: the token is tied to a specific device and account, and if you dump the vacuum cleaner to the factory settings or reconnect it to another Xiaomi account, the old token will stop working and you will have to re-acquire it.

Since 2022, Xiaomi has tightened its security policy, and now the token is not displayed openly in the Mi Home app.This is due to the risks of data leakage and unauthorized access. However, there are legal and semi-official ways to extract it, which we will discuss below.

Official method: request token via Mi Home (if available)

The easiest method is to get the token directly from the Mi Home app.Unfortunately for Xiaomi Vacuum Cleaner 1S It doesn't always work, because newer versions of the app have a hidden option, but it's worth a try:

  1. Open Mi Home and go to your vacuum cleaner page.
  2. Press three points (โ‹ฎ) top-right โ†’ Select Settings.
  3. Scroll down to the General block and find Device Information (or About in English).
  4. If the token is available, it will be displayed in the Token or Communication token field.

If there is no token item, then your version of the app or vacuum cleaner firmware does not support this method, in which case move on to alternative options.

๐Ÿ’ก

Before searching for a token, update the Mi Home app to the latest version, sometimes an option appears after an update.

Alternative method: extracting the token through Packet Capture (Android)

This method works on Android smartphones and requires the installation of additional software. The essence of the method is to intercept network traffic between the Mi Home application and Xiaomi servers, where the token is transmitted in an unencrypted form.

Step-by-step:

  1. Install the Packet Capture app from Google Play.
  2. Launch Packet Capture and press Start. The app will ask you to install the certificate โ€” confirm.
  3. Open Mi Home and wait until the vacuum cleaner connects to the network (should display the status Online).
  4. Return to Packet Capture, stop recording and search the logs for api.io.mi.com or miot-spec.org.
  5. In the body of the answer, look for the line โ€œtokenโ€: โ€œ...โ€ โ€“ this is the desired key.

If the token is not found, try:

  • ๐Ÿ”„ Reboot Mi Home and Repeat Traffic Capture.
  • ๐Ÿ“ฑ Use a different Android smartphone (some Packet Capture models are unstable).
  • ๐Ÿ”ง In Packet Capture settings enable Decrypt option HTTPS.
Why canโ€™t the token be displayed in Packet Capture?
On new firmware Xiaomi encrypts the token using the protocol MIOT, In this case, only the method using miio-cli or appealing to Xiaomi to receive the token manually will help.

Receiving a token through miio-cli (for advanced users)

If previous methods failed, you can extract the token using the Miio-cli utility, a command line for working with Xiaomi devices (Linux/macOS) or PowerShell (Windows).

Instructions for Windows:

  1. Install Node.js from the official website (nodejs.org).
  2. Open PowerShell on behalf of the administrator and execute the command: npm install -g miio-cli
  3. Connect to the vacuum cleaner (replace) IP_DRESS to the real thing IP Devices in your network: Mio discover --sync If the vacuum cleaner is not found, indicate IP hand-held --ip IP_ADRES INFO
  4. In the output command, look for the token line: โ€œ...โ€ is the token.

For Linux/macOS The steps are similar, but instead of PowerShell, use Terminal.

Typical errors and decisions:

Mistake.Reason.Decision
Error: Device not foundThe vacuum cleaner is not in the same network with a smartphone / PCConnect both devices to the same Wi-Fi network
Error: Invalid tokenToken is obsolete or incorrectGet a new token by one of the described methods
Error: Handshake failedBlocking by XiaomiReboot the vacuum cleaner and try again

โ˜‘๏ธ Preparation for work with mio-cli

Done: 0 / 4

How do you know? IP-Address of the Xiaomi Vacuum Cleaner 1S

Without knowledge. IP-Most methods of obtaining a token will not work. There are several ways to determine it:

Method 1: Through the Mi Home app

  1. Open Mi Home and go to the vacuum cleaner page.
  2. Press three points (โ‹ฎ) โ†’ Settings โ†’ Device information.
  3. IP-The address will be listed in the Local Network or Wi-Fi info section.

Method 2: Through the router

  1. Go to your routerโ€™s web interface (usually at 192.168.0.1 or 192.168.1.1).
  2. Find Connected Devices (or DHCP Clients)
  3. In the list, find a device called roborock.vacuum. or miio: โ€“ this is your vacuum cleaner.

Method 3: Through the command line (Windows)

  1. Open the Command Prompt (Win + R โ†’ enter cmd).
  2. Follow the command: arp -a
  3. In conclusion, look IP, near-indicated MAC-address 78:11:DC or 7C:01:9E (Typical prefixes for Xiaomi devices).

๐Ÿ’ก

IP-The vacuum cleaner address may change when you restart the router if you do not have a binding set up on the router. MAC. To avoid problems, fix IP customized DHCP router.

What to do if the token is not found: alternative solutions

If none of the methods worked, there are a few workarounds:

1. Call for support for Xiaomi

In rare cases, support can provide a token on request if you confirm ownership of the device.

  • ๐Ÿ“ง Please contact us with the request for Mi Home device token.
  • ๐Ÿ“„ Attach a check or photo of the device with the serial number.
  • ๐Ÿ”‘ Indicate Device. ID (You can find it in Mi Home. โ†’ Settings of the device).

2. Use a cloud token (less secure)

Some services (such as Home Assistant) support a cloud token connection that can be accessed in Mi Home:

  1. Open Mi Home โ†’ Profile โ†’ Account settings.
  2. Find the Beijing Mi Cloud or Account Management section.
  3. Create a Cloud Token (if available).

The disadvantage of this method is dependence on Xiaomi servers: if they are inoperable, vacuum cleaner management will be unavailable.

3. Install custom firmware (for experienced users)

Firmware like Valetudo or Dustcloud can bypass the limitations of Xiaomi, but require unlocking the bootloader and firmware through the UART. This is a risky process that can disable warranties and disable the device.

๐Ÿ’ก

Before installing custom firmware, back up the original miio-cli command miio backup.

Security: How not to lose the token and not to lock the device

The token is the key to controlling your vacuum cleaner, so leaking it can lead to unauthorized access.

What NOT to do with the token:

  • ๐Ÿšซ Publish in open sources (forums, GitHub, social networks).
  • ๐Ÿšซ Transfer to third parties, even if they promise to help with the setup.
  • ๐Ÿšซ Store in cloud services (Google Docs, Dropbox) without encryption.

How to properly store the token:

  • ๐Ÿ” Save it to an encrypted file (e.g. KeePass or 1Password).
  • ๐Ÿ“„ Print and store in a safe place (if you are afraid of digital leaks).
  • ๐Ÿ“Œ Use a password manager with two-factor authentication.

If you suspect that the token has been compromised:

  1. Untie the vacuum cleaner from your Xiaomi account (Mi Home) โ†’ Settings of the device โ†’ Remove the device).
  2. Reset the device to factory settings (press the Reset button for 5 seconds).
  3. Get a new token and set up the integration again.

๐Ÿ’ก

Check the list of connected devices in Mi Home regularly, and if an unknown device appears, change the password from your Xiaomi account.

FAQ: Frequent questions about the Xiaomi Vacuum Cleaner token 1S

Can I use one token for several vacuum cleaners?
No, the token is tied to a specific device and account, and you need to get a separate key for each vacuum cleaner.
What happens if you drop the vacuum cleaner to the factory settings?
The token will become invalid. Once reset, you'll have to reconnect the device to the Mi Home and retrieve the new token.
Does the method work with Packet Capture on iPhone?
No, Packet Capture is only available for Android. On iOS, you can try it out. HTTP Toolkit, but success is not guaranteed due to Apple's restrictions.
Can I get a token without root rights on a smartphone?
Yes, Packet Capture and miio-cli do not require root. Root is only for deep analysis of traffic at the system level.
How often should the token be updated?
Officially, the token is valid indefinitely, but Xiaomi can reset it if you suspect a hack or after updating the vacuum cleaner firmware.