Owners of Xiaomi equipment often face a dilemma: the brandβs devices have excellent functionality, but do not have native support for the Apple ecosystem, which creates a disparity in the management of the smart home, where climate control has to be managed through a separate application, but there is a proven way to combine everything into a single Apple Home system.
Integration of the humidifier, whether it is the popular Xiaomi Smartmi Evaporative Humidifier 2 model or newer versions, requires the use of an intermediate link.Naturally, these gadgets work through the Mi Home protocol, which is not directly compatible with HomeKit without the use of special gateways or software.
In this article, weβll break down all the current connectivity methods, learn how to turn your Android phone or Raspberry Pi into a bridge between the worlds of Xiaomi and Apple, allowing you to create complex automation scenarios and manage voice moisture through Siri.
Equipment and training required
Before you start software configuration, you need to make sure that there is a basic set of equipment. Without the right hardware, software emulation of the gateway will be impossible or unstable.
You need a stable local area Wi-Fi network. The router needs to keep multiple devices running simultaneously, because the constant exchange of data between the gateway and the humidifier can load the channel, and it is also critical that all devices are on the same subnet.
- π± iPhone with the installed application "Home" (Home).
- π‘ The Gateway Device (Raspberry Pi, Apple) TV, Mac or Android phone).
- π Xiaomiβs humidifier itself, already configured in the Mi Home app.
- π Access to Xiaomi account (Mi Account) to receive device token.
β οΈ Warning: Make sure your humidifier is connected to the server you plan to use.If you change region in the Mi Home app, the device may require a reset.
Special attention should be paid to the versions of the operating system on your iPhone. For the correct operation of new plugins and widgets, it is recommended to use the current version of iOS. Older versions may not support some types of accessories or data formats.
Receiving a token of the Mi Home device
A key step in integration is to get a unique identifier, Token, which is a 32-character string that allows third-party software to gain control over your humidifier bypassing standard protocol constraints.
There are several ways to mine this token, and the easiest and safest way for iOS users is to use jailbreak tools or special utilities for macOS that intercept traffic, but if you don't want to use sophisticated tools, you can use the method through an Android emulator or root rights.
The process is as follows: you need to install the Mi Home application on a device where you can run a traffic sniffer, or use special scripts that log in under your login. Once successful, the script will display a list of devices and their tokens.
Device: zhimi.humidifier.ca1
Token: 32_character_hex_string_here
IP: 192.168.1.45Keep the information in a safe place. The token is the actual access key. If you reset the humidifier to the factory settings or re-attach it to another account, the token changes and you have to repeat the procedure.
π‘
Write down the token and IP-the device address in the notes immediately after receipt. IP-addressing in the router setting will work more stable even after restarting the router.
Method 1: Using Homebridge on Raspberry Pi
The most reliable and popular integration solution is the Homebridge platform installation.This is a lightweight Node.js server that emulates the HomeKit accessory and allows third-party plugins to stream the status of Xiaomi devices to Apple Home.
The ideal platform for Homebridge deployment is the Raspberry Pi single board computer, which consumes minimal electricity, operates silently and can function 24/7.
After installing the Homebridge itself, you need to go to the management interface (usually available via port). 8585) and find the homebridge-xiaomi-humidifier plugin or the universal homebridge-mi-humidifier. config.json.
| Parameter | Description | Example of meaning |
|---|---|---|
| platform | Type of plugin platform | XiaomiHumidifier |
| name | Device name in HomeKit | Bedroom Humidifier |
| ip | Local. IP-address | 192.168.1.45 |
| token | 32-character key | ffffffffffffffffffffffffffffffff |
| model | Model of the device | zhimi.humidifier.ca1 |
After making changes to the configuration file, you need to restart the Homebridge service. If all the parameters are specified correctly, the Home app on the iPhone will request to add a new accessory.
βοΈ Checklist of Homebridge installation
Method 2: Integration with Home Assistant
For advanced users looking to gain maximum control over a smart home, Home Assistant is a powerful open source platform that supports thousands of integrations, including the Xiaomi ecosystem.
Unlike Homebridge, Home Assistant offers deep data analysis and the ability to create complex automations, for example, the humidifier can only turn on when the temperature sensor is above 22 degrees and the humidity drops below 40%.
Installation is similar to Homebridge, often on the same Raspberry Pi, but in the form of a Docker container or virtual machine. After deployment, in the "Settings" section β "Devices and services", you need to add Xiaomi Miio integration.
The system will automatically detect devices on the network if you provide it with account details or IP-Added to Home Assistant, devices can be tossed into Apple HomeKit through the built-in HomeKit Bridge.
β οΈ Warning: Home Assistant requires more resources to work than Homebridge. On older Raspberry Pi models (before version 3), the system can run slowly.
The main advantage of this method is independence from the cloud servers of Xiaomi after initial setup, all commands are executed locally, which provides instant response and work even in the absence of the Internet.
What if the Home Assistant canβt see the device?
Setting up scenarios and automation
With the successful addition of a humidifier to the Home app, a world of automation is opening up. The standard Mi Home app is limited in this regard, while Apple Home allows you to link devices from different manufacturers.
You can create a Good Morning script that includes a humidifier along with a coffee maker and curtain lifting, or set up an automatic shutdown when you leave the house (iPhone geolocation determines exit from the Home zone).
You can use voice commands to control it through Siri, and you can just say, "Hi Siri, turn on the humidifier in the bedroom," or "Hi Siri, set the humidity level at 50 percent," and the system recognizes the device by the name you set up.
- π Automatic turn on at night when humidity drops below 35%.
- π Turn off all climate devices when activated "Nobody is home".
- π§ Notification on iPhone if water level in tank is critically low.
- π‘οΈ Turning on the humidifier only if the room temperature is above 20Β°C.
It's important to name devices and rooms correctly, and it has a direct impact on the accuracy of voice commands, avoid complex names, use simple words that speech recognition algorithms understand.
π‘
Local automation through HomeKit works faster and more reliable than cloud, as it does not depend on the speed of the Internet and servers of the manufacturer.
Diagnostics and troubleshooting
During the setup process, users may encounter a number of typical problems, most often related to network settings or incorrectly specified parameters of the token.
If the device appears in HomeKit as βNo responseβ, check if it has changed. IP-It is recommended to fix the address. IP-address of the humidifier in the router settings (Static) DHCP), so that it will always remain unchanged.
A common mistake is to use a token from another device or an outdated token. If you reset the humidifier or changed the Wi-Fi password, the token could change, in which case the procedure for obtaining the access key would have to be repeated.
| Problem. | Possible cause | Decision |
|---|---|---|
| "No response" device | Changed. IP-address | Secure IP in the router |
| Token error | Wrong or old key | Get a new token |
| Management delays | Weak Wi-Fi signal | Improve network coverage |
| Not visible at Home. | Different Wi-Fi networks | Check the gateway and iPhone |
Also, consider that some Xiaomi humidifier models have protection against frequent requests. If you set up a status survey every second, the device can temporarily block connections. The optimal survey interval is 5-10 seconds.
β οΈ Note: When you update the humidifier firmware through the Mi Home app, the integration may temporarily fail. After the update, check the health and reconnect the device if necessary.