Introduction: Why operate a Xiaomi vacuum cleaner from a computer?
Xiaomi vacuum cleaners have long since ceased to be just smart mops β they have become full-fledged home assistants with advanced remote control functions. But what if the smartphone is dead and you need to start cleaning urgently? Or if you want to automate cleaning on a schedule directly from your desktop PC? It turns out that it is not only possible to control the Xiaomi vacuum cleaner from your computer, but also opens up new opportunities for integration with other smart home systems.
In this article, weβll look at all the current ways to connect, from the official Mi Home app to advanced solutions like Home Assistant and Node-RED. Youβll learn how to send commands through Python, configure voice control through Alice or Google Assistant, and even how to create your own automation scenarios. And for those who prefer ready-made solutions, weβve tested the best third-party utilities with support for Xiaomi Mi Robot Vacuum, Roborock and other models.
Importantly, not all methods are equally convenient. For example, direct management through the Xiaomi API requires obtaining an access token that can be blocked when used frequently. So we divided the methods by difficulty level, from "beginners" to "enthusiasts." Choose the right one!
Method 1: Official Mi Home app for Windows
The easiest and safest way to do this is to use the desktop version of Mi Home. Unfortunately, Xiaomi doesn't release official PC software, but there are workarounds. First, you can install an Android emulator (like BlueStacks or NoxPlayer) and run a mobile app. Second, you can use unofficial Windows ports that mimic the work of the original client.
We tested both options and recommend the second: emulators consume a lot of resources, and informal versions of the Mi Home (such as the MiHome Desktop) are more stable, you can download them from the developers' Githab repositories, the main thing is to check the relevance of the version, since Xiaomi regularly updates security protocols.
- π₯ Download the latest version of MiHome Desktop from GitHub (check reviews in Issues!).
- π Sign in via Xiaomi account (same as in the mobile app).
- π€ Connect the vacuum cleaner to the same Wi-Fi network as the computer.
- ποΈ Set up the control panel: add widgets for quick access to cleaning, zoning and suction settings.
β οΈ Note: Unofficial customers may request administrator permissions to install virtual device drivers. Before installing, check the hash file on VirusTotal - some builds contain advertising software.
Method 2: Manage through the Home Assistant Web Interface
For those who already use the Home Assistant (or plan to install it), it will take no more than 10 minutes to connect the Xiaomi vacuum cleaner, which gives you maximum flexibility: you can create automations by time, motion sensors, humidity or even weather conditions, such as starting cleaning when you leave for work, or stopping the vacuum cleaner if the window is open (through integration with Aqara sensors).
First, make sure you have a Home Assistant installed (even a version in Docker will work), then add Xiaomi Miio integration:
- Go to Settings β Devices and Services β Add Integration.
- Type in the Xiaomi Miio search and select it.
- Indicate. IP-vacuum cleaner address (you can find it in the router or mobile Mi Home) and access token.
Where to get a token? The most reliable way is to use the MiHome Token Extractor utility on a root-righted smartphone. The alternative is services like mihome.dev, but they require authorization through a Xiaomi account (the risk of blocking when used frequently!).
| Parameter | The Mi Robot Vacuum-Mop 2 | Importance for Roborock S7 |
|---|---|---|
| Type of device (device_id) | miio:vacuum.vacmop2 | miio:vacuum.roborock.vacuum.s7 |
| Max. Cleanup time (min) | 120 | 180 |
| Zoning support | Yes (up to 5 zones) | Yes (up to 10 zones) |
| Required version of Home Assistant | 2023.12+ | 2026.1+ |
Install Home Assistant (or upgrade to the current version)|
Get token access to the vacuum cleaner |
Lock down IP-address of the vacuum cleaner in the router (via DHCP-reservation)|
Check compatibility of the vacuum cleaner model with Miio integration-->
Method 3: Python scripts for direct management via API
If you're familiar with programming, the most powerful tool is direct interaction with the Xiaomi Miio API. The python-miio library allows you to send commands to the vacuum cleaner directly, bypassing the limitations of a mobile application. For example, you can write a script that:
- π Collects statistics on cleaning in Google Sheets.
- π Automatically starts the vacuum cleaner when you leave (by geolocation of the smartphone).
- π¨ Stops cleaning if the smoke detector is triggered.
Example of code to start cleaning:
from miio import Vacuum
import asyncio
Replace your data with your data
VACUUM_IP = "192.168.1.100"
TOKEN = "your_token_here"
async def start_cleaning():
vacuum = Vacuum(VACUUM_IP, TOKEN)
await vacuum.start()
print("Cleaning has begun!")
asyncio.run(start_cleaning())To install the library, do:
pip install python-miioβ οΈ Xiaomi may block tokens if used too often API (For long-term automation, use Home Assistant or proxy server.
How to get around the limitations of the Xiaomi API?
Method 4: Voice control via Alice or Google Assistant
If you use Yandex Station, Google Nest or Amazon Echo, you can connect the Xiaomi vacuum cleaner to voice assistants.
- Make sure the vacuum cleaner is added to Mi Home and tied to your account.
- In the mobile application of the assistant (Alice, Google Home), add the Mi Home service through the Smart Home section.
- Assign a vacuum cleaner room (such as a "living room") for more accurate commands.
Examples of voice commands:
- π€ "Alice, start cleaning the living room"
- π€ "Okay, Google, stop the vacuum cleaner"
- π€ "Alice, turn on the wet cleaning in the kitchen" (for models with the function of washing floors)
Limitation: Voice assistants only support basic commands (start/stop, return to base). For advanced functions (zone cleaning, suction setting), you will need to use Home Assistant or Python scripts.
1. the region of the Xiaomi account (should coincide with the region of the assistant, for example, Russia for Alice).
2. The presence of vacuum cleaner firmware updates (in Mi Home β Device settings).
3. no locks in the router (port 54321 must be open for local management).-->
Method 5: Third-party utilities for Windows/macOS/Linux
If you need ready-made solutions without programming, pay attention to these programs:
| Utility. | Platform | Functions | Reference |
|---|---|---|---|
| MiRobot | Windows, macOS | Zone management, schedule, battery monitoring | GitHub |
| Valetudo | Linux (Docker) | Local management without cloud, cleaning maps | Official website |
| DreameBot | Windows | Support for Dreame models (compatible with Xiaomi) | GitHub |
MiRobot is the easiest solution for beginners. The program simulates a mobile application and supports all the basic functions, including:
- πΊοΈ Editing cleaning maps (addition of virtual walls).
- π Monitoring of wear of brushes and filters.
- π Setting up a schedule with sensors tied (for example, starting at low humidity).
Valetudo is an advanced option for enthusiasts. This system completely replaces the Xiaomi cloud, allowing you to control the vacuum cleaner locally. Minus: requires firmware (risk of loss of warranty!).
Use Home Assistant for Automation, MiRobot for Manual Control
Python scripts for unique tasks (e.g., integration with surveillance cameras).-->
Problem Solving: Frequent Errors and Corrections
Even with the right setup, there can be failures, and we've collected some common errors and ways to fix them:
- π« "Device offline: Check that the vacuum cleaner and computer are on the same Wi-Fi network (not via the same Wi-Fi network) VPN!). Restart router and vacuum cleaner (hold power button for 10 seconds) in router, turn off customer isolation (Client Isolation).
- π "Wrong Token: Get a new token through MiHome Token Extractor. Check the server region in Mi Home (should match the account region).
- β οΈ "Delayed commands: Use local management (IP-Address instead of cloud. Turn off the energy saving mode on the PC network adapter.
If the vacuum cleaner does not respond to commands from Home Assistant, check the integration logs:
logger:
default: debug
logs:
miio: debugAdd this code to configuration.yaml and restart Home Assistant. Logs will help identify the problem (such as an authentication error or network timeout).