Xiaomi vacuum cleaner integration in Apple Home: the full guide

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.

πŸ“Š What kind of vacuum cleaner Xiaomi?
Roborock S5/S6
Xiaomi Vacuum Mop
Viomi V2/V3
Another model

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

Done: 0 / 4

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?
The token can be extracted using the Mi Home app on Android with debugging mode enabled USB, Or through the python-miio utility. For iOS users, it is easiest to use third-party apps.-extractor, available in the App Store that reads tokens from the Xiaomi Cloud account after authorization.

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.

ParameterDescriptionWhere to find out.
IP AddressLocal address of vacuum cleanerRouter/Mi Home app
TokenAccess key (32 characters)Python-miio / Extractor
ModelModel of the deviceThe sticker from below / Mi Home
PlatformType of plugin platformPlugin 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).

Why Homebridge doesn't see a vacuum cleaner after rebooting the router?
The vacuum cleaner probably got a new one. IP-address DHCP server, while in the configuration file config.json It's old. You need to reserve static. IP for MAC-vacuum cleaner addresses in router settings or update IP plug-in configuration.
Can I control the vacuum cleaner with my voice if the Homebridge server is turned off?
No, Apple Home will not work, as Homebridge is the only bridge for Siri, but direct management via the Mi Home app will remain available because it runs through Xiaomi’s cloud server.
Is it safe to transfer the device token to a third-party server?
The token is stored locally on your server (Homebridge) and is not transmitted anywhere to the Internet unless you set up the port port port port to the outside. Unlike cloud solutions, local Homebridge provides a high level of data privacy.
Does the integration of a cleaning card in the Home app support?
A standard plugin usually only transmits statuses (works/charges/error) and basic management. Displaying an interactive map in the Home app is not natively supported by the HomeKit protocol, you need to use the manufacturer's native application.
What if Siri has confused the vacuum cleaner with another device?
Go to the accessory settings in the Home app, select Name, and add alternate names or synonyms, and change the device type to a more specific one to help Siri better classify the object.