Owners of Xiaomi smart appliances often face the desire to expand the functionality of their devices beyond the standard Mi Home application. Integrating a robotic vacuum cleaner into a single smart home system, such as through the Home Assistant platform, requires obtaining specific authorization data. IP-Addresses and unique tokens of local management devices are not possible, which limits the possibilities of automating cleaning scenarios.
Receiving this data may seem like a complex technical process that is only available to advanced users, but there are proven methods to extract the necessary information. In this article, we will discuss the current ways to determine the network parameters of your vacuum cleaner robot using both mobile applications and network analyzers. It is important to understand that a token is a security key that is periodically updated, so it sometimes requires a re-retrieval procedure for its receipt to work consistently.
Before you start technical manipulation, you need to make sure that your mobile device and vacuum cleaner are connected to the same local network. MAC-So changing your region or account will require re-extracting the key, so let's look at what tools are needed to successfully complete the task and how to avoid common errors when setting up local access.
Why do we need to? IP-address and token for integration
Standard cloud management via Xiaomi servers provides basic functionality, but has delays and Internet dependency. Local Area Network (LAN) allows you to send commands directly to your device without the cloud. To do this, the MIOT protocol or older miio requires a cryptographic signature that is generated based on a unique token. Without this key, the server will not accept the command, even if it is sent inside your home network.
IP-The address is required so that the smart home system knows where to send data packets. Since the router can give different addresses each time you connect, it is recommended to set up a static lease. IP down MAC-This ensures that after restarting the vacuum cleaner or router, the address of the device will not change, and the automation will not stop working.
Itβs worth noting that some vacuum cleaners, especially newer versions that support HomeKit or Matter, may use other authorization methods that donβt require manual token input. However, for the vast majority of Roborock, Mijia and Viomi models, manual token input remains the only way to fully integrate locally, and understanding this mechanism is important for diagnosing communication problems.
Preparation of equipment and network
The first step is to ensure a stable connection. Your smartphone, which will be set up, and the vacuum cleaner should be on the same subnet. If you have set up the separation of 2.4 GHz and 5 GHz bands into different SSIDs, make sure that both devices are connected to the 2.4 GHz network, as many models of Xiaomi smart appliances do not support 5 GHz frequency.
βοΈ Pre-testing
Youβll also need to install specialized traffic analysis or token extraction software. The most popular and proven tool to date is a bunch of Android or iOS apps that can intercept data or request it directly through the Xiaomi API. Your computer may need to install Python and related libraries if you choose the command line method.
β οΈ Warning: Make sure the vacuum cleaner has the latest firmware installed. Older versions of the software may have exploited vulnerabilities that have been closed, making some old methods of obtaining a token unworkable.
Method of obtaining a token through an extractor application
The easiest way for Android users is to use specialized extractor applications, such as Get Token or analogues available from third-party app stores. These utilities request access to your Xiaomi Cloud account, scan a list of devices and output a token for each of them. The process takes no more than a minute, but requires entering the username and password from the Mi Account into a third-party application.
For iOS users, the situation is more complicated due to operating system limitations. Traffic sniffering or jailbreaking devices are often used here. The alternative is to use the web version of Xiaomi Cloud through an Android emulator on a PC or specialized online services, which, however, carry potential security risks. The safest method for iOS is to use Home Assistant with Xiaomi Miio integration, which can try to extract the token if there are administrator rights on the network.
Security of Third Party Applications
Once you run the app and log in, you'll see a list of all the devices that are linked to your account. Search your vacuum cleaner (usually labeled as a vacuum or model number, such as roborock.vacuum.m1s) Next to it, you'll see a 32-character hexadecimal key, which is the token you're looking for. Copy it, as it's going to be used to set up the integration.
Definition IP-router
Find out. IP-You can access the vacuum cleaner address via your router's web interface. Log in the router control panel (usually at 192.168.0.1 or 192.168.1.1) using the administrator credentials. Find a section that may be called Client List, Connected Devices or DHCP In the list of connected devices, look for a name containing Xiaomi, Roborock or Mijia.
An alternative way is to use network scanners on a smartphone, such as Fing or Network Analyzer, which scan the local network and show a list of all active devices from their devices. IP and MAC-You can identify the vacuum cleaner by manufacturer (OUI part MAC-The address often points to Xiaomi or Beijing Xiaomi. Write down the address, it's usually formatted. 192.168.x.x.
| Parameter | Where to find out. | Example of meaning |
|---|---|---|
| IP-address | Router settings / Fing application | 192.168.1.45 |
| token | Extractor App/Sniffer | 4a3b2c1d5e6f7g8h9i0j... |
| Model | Mi Home app (about the device) | roborock.vacuum.s5 |
| MAC-address | Sticker on the case / Router | AA:BB:CC:11:22:33 |
π‘
For permanent access, secure IP-address MAC-vacuum-cleaner address in settings DHCP This will prevent a situation where, after the power outage, the vacuum cleaner will receive a new one. IP and will stop responding to commands.
Setup integration in Home Assistant
Once you have the data you need, you can start setting up the integration. In Home Assistant, go to Settings. β Devices and services and click Add Integration. find in the list of Xiaomi Miio. IP-Address and token. Enter the data obtained in the previous stages.
If the data is entered correctly, Home Assistant will discover the device and create the essence of the vacuum cleaner. In the interface, buttons will appear to start cleaning, return to base, adjust the suction power and water level (for models with wet cleaning), and will be available advanced attributes such as charge level, filter condition and area of the reclaimed area.
β οΈ Note: If you change the password from Wi-Fi or dump the vacuum cleaner to the factory settings, the token may change, in which case the integration will cease to work, and the procedure for obtaining a new token will have to be repeated.
For advanced users, configuration is available via configuration.yaml, which allows you to set additional parameters such as device name and forced status updates.
vacuum:
- platform: xiaomi_miio
host: 192.168.1.45
token: 4a3b2c1d5e6f7g8h9i0j...
name: Xiaomi Vacuumπ‘
Local integration via IP and token works even in the absence of the Internet, ensuring high response speed and complete privacy of cleaning data.
Diagnosing Connection Problems
A common problem is when IP-The address is correct, but the device is not responding, and this may be because the vacuum cleaner has gone into sleep mode, and some Xiaomi models fall asleep to save energy and stop responding to ping requests. In this case, it helps to configure the router to prohibit sleep for this device or periodic ping.
Another common mistake is the wrong token, and if you change your Mi Account password or you link your device to another account, the old token becomes invalid, you need to re-extract the key, and you also need to make sure that the router firewall doesn't block local tokens. UDP-ports used by the miio protocol (usually port 54321).
If integration is not stable, check the smart home logs, and an Invalid token or Connection timed out will indicate the direction of the problem, and in some cases, restarting the integration module itself or restarting the smart home server can help.