How to control the vacuum cleaner Xiaomi from a computer: 5 proven ways

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.

πŸ“Š What kind of vacuum cleaner Xiaomi you have?
Mi Robot Vacuum-Mop 2
Roborock S7
Mi Robot Vacuum-Mop P
Another model
I haven't bought it yet.

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:

  1. Go to Settings β†’ Devices and Services β†’ Add Integration.
  2. Type in the Xiaomi Miio search and select it.
  3. 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!).

ParameterThe Mi Robot Vacuum-Mop 2Importance for Roborock S7
Type of device (device_id)miio:vacuum.vacmop2miio:vacuum.roborock.vacuum.s7
Max. Cleanup time (min)120180
Zoning supportYes (up to 5 zones)Yes (up to 10 zones)
Required version of Home Assistant2023.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?
If your token is blocked, try: 1. Create a new Xiaomi account and link the vacuum cleaner to it. 2. Use alternative libraries like miio2 with cloud bypass support. 3. Set up a local Home Assistant server with command caching. Remember that circumventing restrictions may violate Xiaomi's terms of use!

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.

  1. Make sure the vacuum cleaner is added to Mi Home and tied to your account.
  2. In the mobile application of the assistant (Alice, Google Home), add the Mi Home service through the Smart Home section.
  3. 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.PlatformFunctionsReference
MiRobotWindows, macOSZone management, schedule, battery monitoringGitHub
ValetudoLinux (Docker)Local management without cloud, cleaning mapsOfficial website
DreameBotWindowsSupport 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: debug

Add this code to configuration.yaml and restart Home Assistant. Logs will help identify the problem (such as an authentication error or network timeout).

Can you control Xiaomi vacuum cleaner from a computer without the Internet?
Yes, but only if the computer and vacuum cleaner are on the same local network. IP-Cloud services (e.g. Mi Home) require Internet, but local API works without him.
How to start cleaning a particular room from a computer?
Area cleaning requires: A saved vacuum cleaner map (made during the first cleaning), Zone coordinates (available through Home Assistant or MiRobot). Example for Python: await vacuum.clean_zone([18000, 22000, 22000, 26000]) # Coordinators: x1, y1, x2, y2 Coordinates are indicated in millimeters relative to the base of the vacuum cleaner.
Why does the vacuum cleaner not save the card when operating from a PC?
This problem arises from: No first manual cleaning (vacuum cleaner must go around the room at least once), reset after updating the firmware, use of informal firmware (for example, Valetudo), Solution: run a full cleaning from the mobile Mi Home, then try again from the PC.
Can I control multiple Xiaomi vacuum cleaners from one computer?
Yes, but there are nuances: In Home Assistant, add each device as a separate Xiaomi Miio integration. In Python scripts, create separate Vacuum instances for each vacuum cleaner. Make sure each device has a unique one. device_id (Limitation: You can send commands to only one vacuum cleaner at a time (delay between teams β€” 2-3 seconds).
How to protect the vacuum cleaner from hacking?
Safety recommendations: πŸ” Use a local network instead of cloud management. πŸ›‘οΈ Set up a guest network in the router for IoT devices (including a vacuum cleaner). πŸ”„ Regularly update the vacuum cleaner firmware and Home Assistant. 🚫 Do not share access tokens or store them in open repositories. If you use Valetudo, enable password authentication in your web interface settings.