Owners of the Apple ecosystem often face a situation where Xiaomi appliances, despite their functionality, do not appear in the standard Home app, a limitation due to the lack of native support for the HomeKit protocol from the vacuum cleaner manufacturer. However, there is a proven way to circumvent this limitation and merge the devices into a single network.
To implement this plan, you will need middleware that will broadcast commands between the servers of Xiaomi Cloud and Apple HomeKit. Most often for this purpose, the Homebridge platform, running on the basis of Node.js. The setup process requires care, but the result is worth it: you will have full control over cleaning through Siri and automation.
Before you start technical manipulation, make sure that your robot vacuum cleaner is already connected to the Mi Home or Xiaomi Home app and works correctly. It is also critical to determine the model of your device, since it depends on the choice of plugin. Some old models may require local connection, while new ones work through the cloud.
Preparation of equipment and software
The foundation for the integration will be a computer or a single board computer, which will be deployed on the Homebridge server. This can be a Raspberry Pi, Mac Mini or even a virtual machine on the Internet. NAS-The main requirement is a stable connection to the local network and Internet access to work with cloud services.
You need to install an operating system if it is not already installed and provide it with a static operating system. IP-Dynamic address change can break the connection between smart home hubs. For Linux or macOS family operating systems, the installation process goes through the terminal.
- π Computer with macOS, Linux or Windows (for Homebridge server).
- π‘ Stable Wi-Fi or wired Ethernet connection.
- π€ Xiaomi robot vacuum cleaner connected to Mi Account.
- π± Smartphone with iOS 14 and newer for management.
Pay special attention to the versions of the operating system on the server. Homebridge prefers to use the latest version of Node.js, as older versions may not support the necessary dependencies of plugins.
Installation and configuration of Homebridge
The process of installing Homebridge varies depending on the platform you choose. For macOS and Linux users, the easiest way is to use the command line. You will need to enter the command to install the global package through the npm package manager.
Once the basic package is installed, the server needs to be started. When you first start up, the system will create a config.json configuration file that will store all the plugin settings, and that file will later need to enter your Xiaomi account details.
β οΈ Attention: Configuration file config.json It contains the username and password of your Mi Account in plain form. Never publish screenshots of this file in public sources or share it with third parties.
For Windows users, there is a handy Homebridge UI installer that allows you to manage the server through the browser. This greatly simplifies the process of adding plugins and monitoring logs. The interface provides visual access to the configuration file system.
Make sure the firewall doesn't block the ports needed to run the server. By default, Homebridge uses port 8581 for the web interface and ports for communicating with HomeKit. If you're using Docker, make sure that you configure a host or port-over network.
βοΈ Checklist of server preparation
Selection and installation of a plugin for Xiaomi
The key link is a plugin that interprets between protocols, and currently the most stable and functional solution is the homebridge-xiaomi-roborock-vacuum plugin, which supports a wide range of models, including the Roborock, Viomi and Dreame series.
Install the plugin through the Homebridge UI interface or the command in the terminal. Once the plugin is installed, a device card that requires customization will appear in the plugin menu. You need to click the Settings button and go to edit the configuration.
In the configuration of the plugin, you must specify the following parameters: login (phone number or email), password from Mi Account, as well as server region. An error in choosing a region (for example, ru instead of cn) will lead to the inability to log in.
List of supported regions for plugins
If you have two-factor authorization, the process may require a temporary token. Some plugins support token login, which is safer than password storage. The token can be obtained through third-party utilities on Android or through the web interface extraction tools.
Device configuration and token acquisition
For some models of vacuum cleaners, simply entering a password is not enough, a unique device token is required. This is a 32-digit key that identifies a particular robot on the Xiaomi network. Without it, the plugin will not be able to send commands directly to the device.
There are several ways to get a token, and the easiest way is to use an Android app with root rights or by debugging USB on iOS (using tools like get-miio-token), and there are online services where you can download the Mi Home database backup.
| Method of obtaining | Difficulty | Essential tools | Security |
|---|---|---|---|
| Through Android (Root) | Tall. | Root right, explorer file | Medium |
| Through iOS Backup | Medium | Mac/PC, iPhone Backup Extractor | Tall. |
| Python | Tall. | PC, Python, libraries | Tall. |
| Online extractor | Low. | Database file | Low (risk of leakage) |
Once the token is received, it must be entered into the token field in the plugin configuration. If you use the cloud authorization method (login and password only), the token field can be left empty, but the functionality can be limited.
Remember to restart Homebridge after you have made configuration changes. You should see a message in your logs about a successful connection to your device. If you see a "Device offline" or "Invalid token" error, check the data entered.
π‘
Save the received device token in a safe place (for example, in the password manager). When you reset the vacuum cleaner settings or change the Wi-Fi network, the token can change, and the procedure will have to be repeated.
Adding an accessory to the βHomeβ app
When the plugin is configured and the server is error-free, you will see the "Running" status in the Homebridge app. Now you can move to the final step of adding an accessory to the Apple ecosystem. Open the Home app on your iPhone or iPad.
Click the + button in the upper right corner and select Add Accessory. If the devices are not automatically located, select No Code or Can't Find and enter the data manually. The Access Code (PIN) is listed in the Homebridge interface or in the pin configuration file.
Once successfully paired, the robot vacuum cleaner will appear on the room list, and you can rename it, assign a room, and adjust the type of device. The vacuum cleaner typically has the following characteristics: start, pause, return to base, and charge level.
β οΈ Warning: If HomeKit doesn't see the accessory, check that the iPhone and Homebridge server are on the same subnet.Isolating Wi-Fi (Client Isolation) clients on the router can block detection.
Now you can control the cleaning with your voice through Siri. Phrases like "Siri, turn on the kitchen vacuum cleaner" or "Siri, send the Robot to base" will be executed instantly. The team delay is usually 1 to 3 seconds.
Scenario creation and automation
Integration into Apple HomeKit opens up opportunities to create complex scenarios not available in the native Mi Home app.You can link the start of a cleanup to other home events using geolocation or time.
For example, you can set up automatic vacuum cleaner start when all family members leave the house (no one status), or you can also prevent cleaning when windows are open (if you have smart opening sensors), which improves efficiency and safety.
- π Gone From Home Scenario: Turn on the vacuum cleaner if the charge is above 20%.
- π Scenario "Night": Send to the base and turn off the lights if the robot began cleaning.
- ποΈ Schedule: Start quiet cleaning on Tuesdays at 14:00.
For advanced users, integration with the Shortcuts app is available, which allows you to create buttons on the desktop for specific cleaning modes that are not displayed in the standard HomeKit interface using web queries to the Homebridge API.
π‘
The main value of the integration is the ability to combine the Xiaomi robot vacuum cleaner with devices of other brands (Philips Hue, Aqara, IKEA) in single scenarios Apple HomeKit, creating a truly smart home.
Problem solving and issues
Users may encounter a number of typical problems during the setup process, most often network settings or server-side changes, and understanding how the network works will help them quickly troubleshoot problems.
If the robot stopped responding to commands after updating the firmware, try removing the accessory from HomeKit, restarting the plugin and adding it again. Sometimes you need to update the plugin to the latest version, as developers quickly respond to API changes.
β οΈ Warning: Frequent reconfiguration or frequent device status requests may result in temporary lockdown IP-Make pauses between attempts to connect to the debugging.
Also, keep in mind that HomeKitβs Cleanup status can be delayed, which is normal for cloud integrations, and local protocols are best for instant response if the vacuum cleaner model and plugin support it.