Appleβs smart home ecosystem offers iPhone and iPad users an exceptional level of security and convenience, but many Xiaomi owners face compatibility issues. The standard Mijia protocol does not have native support for Apple HomeKit, making it impossible to directly control the vacuum cleaner through the Home app or Siri voice commands without the use of additional intermediaries.
Fortunately, modern technology can bypass this limitation by creating a reliable bridge between the two ecosystems: you donβt have to give up your favorite robot vacuum cleaner or change all the smart appliances in your apartment. Hybrid setting requires a local server that will broadcast statuses and commands, making the device visible to iOS.
In this article, we will discuss in detail the technically competent integration method that will ensure stable operation even in the absence of the Internet. You will learn to configure the software gateway that will turn the regular Xiaomi Vacuum into a full member of the Apple Home network, available for creating complex automation scenarios.
Technical requirements and equipment preparation
Before you start software setup, you need to make sure that your hardware is up to date with the Homebridge Bridge, which acts as an Apple accessories emulator, allowing you to add devices that donβt have an official HomeKit certificate to your system. The main requirement is a permanent computer or a single board computer, such as the Raspberry Pi, that will act as a server.
The second critical component is the vacuum cleaner itself. To be successfully integrated, the model must support local Wi-Fi management, not just through a cloud server. Most current models in the Roborock, Viomi and Xiaomi (Mijia) series support this functionality, but older versions may require alternative firmware.
You also need a stable LAN, and make sure your router keeps your devices running on the same subnet and allows you to open the necessary ports for local traffic, and without that step, the commands from the iPhone will simply be lost, without reaching the janitor's actuator.
β οΈ Note: Using third-party vacuum cleaner control software can theoretically lead to loss of manufacturer warranty.All actions to change the configuration you perform at your own risk, although practice shows that reading data through the use of a vacuum cleaner can be used to control the vacuum cleaner. API rarely causes a device to be blocked.
Installation and basic settings Homebridge
The process starts with deploying the Homebridge platform on your chosen server, which is a Node.js server that emulates the HomeKit protocol, making it possible to add third-party devices. If you use a Raspberry Pi, the easiest way to do this is to install a finished Hassbian image or use an automatic installation script that configures all the dependencies you need.
After installation of the basic package, you need to access the configuration file config.json. This is where all the connection settings are written down. The management interface is usually accessible via a web browser at the address. http://IP-server-address:8581, This makes editing options much easier for users who are not familiar with the Linux command line.
It is important to auto-start the service when the server is powered on, and to do this, Linux uses the sudo systemctl enable homebridge command, which ensures that the bridge between ecosystems is raised immediately after the hardware is restarted. Without this step, the integration will only work until the server is turned off.
βοΈ Checking before installing plugins
Selection and installation of a plugin for Xiaomi
The heart of the system is the right plugin. At the moment, the most stable and functional solution is considered the homebridge-xiaomi-roborock-vacuum plugin. It supports a wide range of models and provides access to most functions, including starting a cleanup, returning to base and even controlling the suction power level.
To install the plugin, go to the Plugins section of the Homebridge web interface and search for the name homebridge-xiaomi-roborock-vacuum. Once the plugin is installed, it will need to be activated in the configuration file. It is important to avoid syntactic errors, since the JSON format is extremely sensitive to commas and quotation marks.
The key is to get a unique device token, which is a digital key that allows the server to log into the vacuum cleaner's local network, and you can get it through an Android debugging app, or a Python script if you're familiar with programming, and without that token, you can't have a server-cleaner connection.
How to get a device token?
Connection configuration and token acquisition
Getting a token is the hardest step for beginners, but integration is impossible without it. There are several methods, but the most versatile is using the Python library miio. You'll need to install Python on your computer, then execute the pip install python-miio command on the terminal. After installation, run the discovery command to search for devices on the network.
In return, you will receive a list of devices from them. IP-Write down this data, it's going to be used to fill out the configuration file. config.json It should look a certain way, including the name, ip and token fields.
Below is an example of a proper configuration structure for a single device. Note that each setting should be double quotes and the lines separated by commas.
{
"platform":"XiaomiRoborockVacuum",
"name":"Roborock S5",
"ip":"192.168.1.55",
"token":"ffffffffffffffffffffffffffffffff",
"pause": true,
"waterBox": true
}After making changes to the configuration file, you must restart the Homebridge service with the sudo systemctl restart homebridge command. If all parameters are entered correctly, a message will appear in the system logs about the successful connection to the device using the specified command. IP-address.
π‘
Save a copy of the config.json file before making changes. In case of an error in the JSON syntax, the server will not start, and you will have to look for the error in the code from scratch.
Adding an accessory to the βHomeβ app
After successfully configuring the plugin and rebooting the server, your vacuum cleaner should appear in the Home app on your iPhone or iPad. Open the app and click Add Accessory. The system will automatically detect the new Homebridge bridge if your phone and server are on the same network.
During pairing, the application is asked to enter a confirmation code (PIN-This code is displayed in Homebridge logs or in the Access Code field in the plugin's web interface. Enter the code carefully, as it only acts once when you first set up the code.
Once you add the device, you can rename it, assign a room, and customize the icon. It's recommended that you give the device a clear name, like "Kitchen Vacuum" or "Living Robot," so that Siri's voice commands are recognized as accurately as possible. The wrong name can cause the assistant to confuse the devices.
| Parameter | Description | Where to find out. |
|---|---|---|
| IP Address | Local address of vacuum cleaner | Router/Mi Home app |
| Token | Access key (32 characters) | Python-miio / Extractor |
| Model | Model of the device | The sticker from below / Mi Home |
| Platform | Type of plugin platform | Plugin documentation |
Creating Automations and Cleaning Scenarios
The main value of integration in Apple Home is the ability to create complex scenarios: you can set up an automatic start of cleaning when all family members leave the house (the geolocation of the iPhone shows the exit from the Home zone), this is implemented through the Automation tab in the Home app.
Notification settings are also available, for example, you can create a scene that sends a push notification to the Apple Watch when the dust container is full or when the robot is stuck, and the plugin must have the appropriate status switches enabled.
Voice control with Siri opens up new possibilities: you can say, "Hi Siri, turn on the quiet cleaning in the living room," and the robot switches to the appropriate mode, which is especially convenient when hands are busy or the phone is in another room.
β οΈ Note: When creating geolocation automation, consider the late location of the iPhone. 5-10 minutes after actually leaving the house.
π‘
Automation is a key feature of Apple Home. Properly configured scenarios allow you to completely eliminate manual vacuum cleaner control, making the cleaning process invisible to the user.
Diagnosis and stability of work
In the process of operation, there may be situations when the device becomes inaccessible, most often this is due to a change in the device. IP-vacuum cleaner addresses, if the router does not reserve a static address. DHCP your router and secure IP-address MAC-robot-address.
Another common problem is status desynchronization, where the Home app can show that the robot is on base even though it's already gone to clean up, and where it's done, the Homebridge reboot by the sudo systemctl restart homebridge team updates the cache of the states.
If the robot has stopped responding to commands, check server logs. Connection errors often indicate network problems or an expired token (although tokens are usually perpetual, changing the Wi-Fi password can reset the network settings on the vacuum cleaner itself).