Integrating Xiaomiβs robot vacuum cleaner into smart home systems or third-party applications often requires knowledge of it. IP-Without this data, you can't control your device through Home Assistant, Node-RED, or even some versions of Mi Home after you change region, but how do you get it if you don't provide direct tools?
Many users mistakenly believe that it requires root rights on a smartphone or complex manipulation of firmware. IP-The address can be found in 2 minutes via the router, and the token can be extracted using official Xiaomi tools or third-party utilities. In this article, we will discuss 5 working methods (including the most reliable through Python) relevant to Mi Robot Vacuum, Viomi, Dreame and others on the MiOT platform.
β οΈ Note: Extracting a token through informal methods may violate Xiaomiβs user agreement. Use the data only for personal purposes β transferring the token to third parties gives them full control over your device.
1. How to find out. IP-address of Xiaomi robot vacuum cleaner
IP-The address is for direct connection to the vacuum cleaner over a local network, and you can get it in three ways without using third-party software.
The easiest way is to check the list of connected devices in your router's settings.
- Open the routerβs web interface (usually at 192.168.0.1 or 192.168.1.1).
- Log in (login / password from the sticker on the router case).
- Go to DHCP, Local Area Network, or Connected Devices.
- Find a device called roborock, miio, or vacuum.
If the vacuum cleaner doesn't show up, try restarting it (hold the power button for 5 seconds) and updating the router page. An alternative way is to use the arp -a command in Windows Command Prompt (more in the table below).
| Method | Instructions | Pluses | Cons |
|---|---|---|---|
| Through the router. | Viewing the list DHCP-clientele | It does not require software, it works on any router. | IP may change when rebooting |
| Team arp-a-a-a-a | Perform in CMD after ping vacuum cleaner | Quick, no access to the router. | It requires knowledge. MAC-address |
| Fing appendix | Network scanning in mobile/desktop application | Shows all devices with names | I need to install the software. |
For fixation IP-Addresses (so that it does not change) set up a static lease DHCP router, tethered MAC-vacuum-cleaner address to the selected IP. MAC You can find out on the sticker under the device lid or through Mi Home (Device settings) β General information).
2. Obtaining a token through Mi Home (official method)
If the vacuum cleaner is already tied to a Xiaomi account, the token can be extracted from Mi Home app traffic without root rights.This method works for most models, but requires a Python computer.
You'll need:
- π± Smartphone with Mi Home installed and tied vacuum cleaner.
- π» Computer with Python 3.6+ and the mitmproxy library.
- π‘ Shared network: phone and PC must be connected to the same Wi-Fi.
Step-by-step:
- Install mitmproxy via the command: pip install mitmproxy
- Set up a proxy on your smartphone: Wi-Fi β Network settings β Additional β Proxy Server β Manual. Specify your PCβs IP (learn via ipconfig in CMD) and port 8080.
mitmproxy
Mi Home
Go to the vacuum cleaner settings and wait for traffic capture.
api.io.mi.com
did
token
β οΈ Note: Xiaomi can block unofficial proxies.If traffic isn't captured, try using Charles Proxy with a certificate or method through a ADB (described below).
Install Python 3.6+
Install mitmproxy (pip install mitmproxy)
Connect your phone and PC to the same network
Set up a proxy on your phone (IP PC:8080)
Open Mi Home and go to the vacuum cleaner settings-->
3. Alternative method: token via ADB (for Android)
If the proxy method doesnβt work, you can extract the token directly from the memory of the Mi Home application using ADB (Android Debug Bridge), which requires the developer mode on the smartphone to be turned on.
What needs to be done:
- Activate Debugging by USB on your phone (Settings β About Phone β Assembly Number β tap 7 times, then go back to Settings β Developer).
- Connect the phone to the PC and confirm the debugging permission.
- Install ADB on your computer (download Platform Tools from Google).
- Execute the commands: adb shell pm list packages | grep mihome run-as com.xiaomi.smarthome dbpath sqlite3 databases/miio2.db "SELECT token FROM devices WHERE did='DID_DETECTIVE";" (replace DID_DEVICES FOR ID Your vacuum cleaner from Mi Home).
Device ID (did) can be found in Mi Home: Profile β Settings β Smart Home Network β Your Device β General Information.
What if the ADB canβt see the device?
4. Token extraction via Python script (for experienced)
For users familiar with Python, there is a universal miio-cli script that automates token acquisition, which works even without a proxy, but requires knowledge of the username/password from the Xiaomi account.
Instructions:
- Install the library: pip install python-miio
- Sign in and get a token: miio --discover --sync-seed miio --cloud-token YOUR_PHONE_NUMBER YOUR_PASSWORD (substitute YOUR_PHONE_NUMBER and YOUR_PASSWORD Your Xiaomi account information).
- The script will return the list of devices with their tokens.