Owning a Xiaomi Vacuum Cleaner 1S robot makes it much easier to keep your home clean, but the standard functionality of the Mi Home application often limits the capabilities of an advanced user. To integrate a device into smart home systems such as Home Assistant, or to send specific commands through a local network, it is critical to know the unique access key β a token. Without this 32-character identifier, direct interaction with hardware via miIO protocol is impossible.
Getting a token may seem like a daunting task for a beginner, but there are actually several proven ways to extract this information: We will look at methods that do not require deep programming knowledge, as well as options for power users. It is important to understand that a token is your personal security key, and obtaining it requires certain actions in the application or using traffic sniffers.
In this article, we will discuss in detail the step-by-step algorithm for Xiaomi Vacuum Cleaner 1S. You will learn how to prepare the environment, what applications you will need and how to avoid common authorization errors. Data security remains a priority, so all the methods described are based on legitimate ways to obtain information about your own device.
Preparation for obtaining a device token
Before you start extracting the access key, you need to make sure that your mobile device and the vacuum cleaner are ready to go. The main tool for manipulation is an Android smartphone, since most of the utilities for obtaining a token are designed for this platform. Although there are methods for iOS, they often require a computer or jailbreak, which makes the process unnecessarily complicated.
You will need a stable Wi-Fi connection. Note that Xiaomi Vacuum Cleaner 1S, like many other devices in the ecosystem, only works in the 2.4 GHz band. If your router broadcasts 2.4 GHz and 5 GHz networks under the same name (SSID), there may be connection problems.
- π± Android phone with or without root rights (for some methods.
- πΆ Stable connection to 2.4 GHz Wi-Fi network.
- π€ Installed Mi Home app with registered account.
- π» Computer (optional, for traffic sniffing methods).
β οΈ Warning: Make sure your Mi Home account is tied to a region that matches your location.Devices released for the Chinese market may require you to change region in the app settings to China, which sometimes affects the tokenβs display in the logs.
You should also download the necessary utilities in advance. If you plan to use a method of intercepting traffic, you will need specialized software to analyze network packets. For most users, methods based on analyzing the configuration files of the Mi Home application itself or using third-party plugins will be enough.
Method of obtaining a token through plugins Mi Home
One of the easiest and most affordable ways to recognize the token for Xiaomi Vacuum Cleaner 1S is to use special plugins built into the ecosystem or available as add-ons. Some versions of the Mi Home app (especially modified or older versions) allow you to display the token in the properties of the device.
There is a popular method involving using a Home Assistant plugin called Xiaomi Cloud Map Extractor or similar integrations that can log tokens when first authenticated, but a more direct way is to use an Android emulator on a PC or a real device with a modified application installed that can pull tokens from memory.
Consider a utility that requires login and password from your Xiaomi account, which works through a request to the Xiaomi cloud server. You enter your data, the system authorizes you and returns a list of all the associated devices along with their tokens.
- π You need a login and password from your Xiaomi Cloud account.
- π An active internet connection is required to request API.
- π‘οΈ It is recommended to use a temporary password or two-factor authorization for security.
The process is as follows: you run a script or utility (for example, python-miio or a specialized web tool), enter credentials. JSON-The answer is that it contains the token field. 1S This token will be a string of 32 characters.
It is important to note that using third-party scripts that require passwords carries certain risks. Although open source utilities are often verified by the community, there is always a theoretical possibility of data compromise, so after receiving a token, we strongly advise you to change the password from your Xiaomi account.
Using Android Emulator and Sniffing
A more technically sophisticated but very reliable method is to intercept network traffic between the Mi Home app and Xiaomi servers, using an Android emulator (such as BlueStacks or NoxPlayer) on a computer that has a certificate to decrypt HTTPS traffic (Man-in-the-Middle method).
You'll need to install the Mi Home app on the emulator and configure traffic proxing through a tool like Proxyman, Charles, or Fiddler. Once you install a trusted root certificate on the emulator, you'll be able to see the requests the app sends. The token is passed in the headers or query body when you authorize the device.
Algorithm of action:
- Install an Android emulator and set up a proxy in it.
- Install the sniffer certificate in the emulator.
- Start Mi Home, log in to your account.
- Open the Xiaomi Vacuum Cleaner 1S device or list of devices.
- Search for domains api.io.mi.com or global.api.io.mi.com.
βοΈ Checklist for preparation for sniffing
In a server response or in a client request, you'll find a token that looks like a long hexadecimal string, and that's the key you need for local management. SSL Pinning, which makes interception HTTPS The traffic is extremely complex without modifying the APK-file.
β οΈ Attention: Modification APK-Files and certificates may disrupt the application or result in the account being blocked by Xiaomiβs security team. Use this method only on test accounts or with caution.
If you donβt want to mess with emulators, there are ready-made ones. APK-Mi Home application files with a token output patch already embedded, which are often distributed in Home Assistant developer communities, and once installed, the token can be displayed directly in the interface when the device is connected.
Getting a token through root access on Android
The most direct way for owners of Android smartphones with superuser rights (root) is to extract the token from local application configuration files. When authorized, Mi Home stores the tokens of all connected devices in a secure system directory.
To access these files, youβll need a root-enabled file manager, such as Root Explorer or MiXplorer: /data/data/com.xiaomi.smarthome/files/. This folder may contain files with or without the.txt extension that contain authorization data.
However, in modern versions of Android and Mi Home, data is often encrypted or stored in a SQLite database. The database file is usually called miio.db or is located in the databases folder. Opening this database through a SQLite editor, you can find a table with devices where one of the columns will store the desired token.
- π The path to files: /data/data/com.xiaomi.smarthome/.
- ποΈ Database: Look for files with.db extension in databases folder.
- π Keywords for search: token, did, model.
If you find a file, but you can't open it, it's probably encrypted, and then it helps to copy the file to a computer and try to read it with specialized software. com.xiaomi.smarthome_preferences.xml, Although in modern versions it is rare.
What if the file manager doesnβt see the data folder?
Once you find the string of token, copy it. Make sure you copy the token that matches the Xiaomi Vacuum Cleaner. 1S. The device can be identified by MAC-address ID device (did), which is also displayed in the Mi Home application in the properties of the vacuum cleaner.
Comparison of methods for extracting the access key
The choice of method depends on your technical background and availability of equipment, each method has its advantages and disadvantages. Below is a table that will help you determine the best option for your situation.
| Method | Difficulty | Need a Root/PC | Security | Relevance |
|---|---|---|---|---|
| Plugins/Scripts (Cloud) | Low. | No. | Medium (password transfer) | Tall. |
| Sniffing (Emulator) | Tall. | I need a PC. | High (locally) | Medium (SSL Pinning) |
| Root files (Android) | Medium | I need a Root. | Tall. | Depends on the Android version |
| Modified APK | Low. | No. | Low (trust of the author) | Tall. |
As you can see from the table, using cloud scripts or modified APKs is the quickest way, but requires trust in third parties. Sniffing and root access give full control, but take time to customize the environment. For a one-time token Xiaomi Vacuum Cleaner 1S most often choose cloud utilities.
Remember, the token is tied to a specific Xiaomi account. If you dump the vacuum cleaner and link it to another account, the token changes. The old access key becomes invalid and you have to repeat the procedure for obtaining again.
π‘
Save the token in a safe place, such as a password manager, and youβll need it every time you reinstall Home Assistant or reconfigure integration.
Integration setting and performance verification
After you have successfully received 32-It's a token, it's time to use it, and most often it's required to set up integration in Home Assistant. xiaomi_miio, pointed IP-vacuum cleaner address, received token and device model.
An example of configuration looks like this:
vacuum:
- platform: xiaomi_miio
host: 192.168.1.50
token: YOUR_32_CHAR_TOKEN_HERE
name: Xiaomi Vacuum 1SFor Xiaomi Vacuum Cleaner 1S, the model in configuration is usually listed as dreame.vacuum.mc1808 or is automatically determined. Once the smart home system is restarted, the vacuum cleaner should appear in the list of devices. You can start cleaning, send to the base, adjust the suction power and get card status.
β οΈ Attention: Make sure that IP-The vacuum cleaner address is static (reserved in the router). IP-The address will change after the router restarts, the integration will stop working and you will have to update the settings.
Checking the health of the token is also possible through the command line, if you have a python-miio package installed. --ip 192.168.1.X --token YOUR_TOKEN status should return the detailed status of the device: charge level, filter condition, volume of the dust container and current operating mode.
π‘
Successful status through the console or the appearance of an entity in the Home Assistant ensures that the token is valid and the device is available on the local network.