Xiaomi smart light bulbs are some of the most popular lighting devices in the smart home ecosystem, but their native integration with Appleβs HomeKit is often questionable. Unlike Philips Hue or Nanoleaf devices, which support HomeKit out of the box, Xiaomi products (including the Yeelight series, Mi series) LED Smart Bulb and Aqara require additional manipulations.This article will help you understand how to connect the light bulb to the HomeKit, what tools you will need to do this, and how to avoid typical errors.
The main problem is that Xiaomi uses its own Mi protocol. Home/Mi Home (China), which is not directly compatible with HomeKit, but there are several workarounds: through Home Assistant (the most reliable way), through converter bridges (such as HomeBridge), or through Aqaraβs branded hubs (for a limited list of devices). We will consider all options, evaluate their pros and cons, and give recommendations on choosing the optimal solution for your tasks.
It is important to note that the integration process may vary depending on the light bulb model and firmware version. For example, Yeelight lamps with Mi Home firmware require one approach, and Aqara devices (for example, Yeelight lamps with Mi Home firmware require one approach, T1 Bulb, another. It's also worth checking your model's compatibility with your chosen connection method in advance to avoid wasting time.
HomeKit and Xiaomi Light bulb compatibility: What you need to know before you start
Not all Xiaomi smart bulbs can be connected to HomeKit, and this is the first point to look out for. Below is a table of compatibility of popular models with basic integration methods:
| Model light bulb. | Home Assistant | HomeBridge | Aqara Hub (native) | Notes |
|---|---|---|---|---|
| Yeelight LED Bulb (Color) | β Yes. | β Yes. | β No. | Requires firmware with support LAN-control |
| Mi LED Smart Bulb (Basic) | β Yes. | β οΈ Partially. | β No. | Support for Mi Home Tokens |
| Aqara T1 LED Bulb | β Yes. | β Yes. | β Yes. | Native Support via Aqara Hub M2 |
| Xiaomi Philips Eyecare Lamp | β No. | β οΈ Limited. | β No. | Requires workarounds through Tuya Convert |
If your model is not in the table, check its compatibility on official resources:
- πΉ Home Assistant Documentation for Yeelight
- πΉ HomeBridge plugin for devices Xiaomi/Aqara
- πΉ List of Aqara devices with HomeKit support
Key point: light bulbs running through the Mi Home cloud (e.g. older Mi models) LED Bulb, which may require a Chinese Xiaomi account to be available for access tokens, may require restrictions. API, If you plan to use HomeBridge, make sure your model supports local management beforehand (LAN mode).
Method 1: Connecting through Home Assistant (recommended method)
Home Assistant is an open platform for smart homes that allows you to integrate Xiaomi devices with HomeKit without intermediaries.
- π§ Local management (no matter what the Xiaomi cloud is)
- π‘οΈ Security (data is not transferred to third-party servers)
- π Automation support (you can create complex scenarios)
You'll need to set up:
- π₯οΈ Computer or Raspberry Pi to install Home Assistant
- π± Home Assistant Mobile App App (iOS/Android)
- π Xiaomi light bulb with support LAN-control (see table above)
Install Home Assistant on Raspberry Pi or Docker|Connect the light bulb to the Wi-Fi network|Get the Mi Home Access Token (if required)|Establish integration Yeelight/Xiaomi Miio in HA
-->
Step-by-step:
- Install Home Assistant on your chosen device. The Raspberry Pi will fit the Home Assistant image. OS, Docker - Official container.
- Go to the Home Assistant web interface (http://[IP-address]:8123) Add integration: For Yeelight: Settings β Devices and services β Add integration β Yeelight For Other Xiaomi Lamps: Settings β Devices and services β Add integration β Xiaomi Miio
If you need a token, get it through the Mi Home app (instructions below in the section "How to get a Mi Home token").
After adding the device, go to Settings β Devices β [Your light bulb] β Settings and enable the option Expose to HomeKit.
Open the Apple Home app on iPhone/iPad Add a new device through the scan. QR-code (it will appear in the Home Assistant interface).
Possible problems and solutions:
- π¨ No light bulb detectable: check that it's connected to the same Wi-Fi network as the Home Assistant. IP-address.
- π¨ Authentication Error: Make sure the Mi Home token is valid (they may expire).
- π¨ No Expose to HomeKit: Update Home Assistant to the latest version.
yeelight:
devices:
192.168.1.100:
name: "Living lamp"(substitute IP topical).-->
Method 2: Using HomeBridge to Integrate with HomeKit
HomeBridge is a lightweight server that emulates HomeKit bridges for non-optional devices, which, unlike Home Assistant, requires fewer resources but has limitations on functionality, and is suitable if:
- πΉ You donβt want to deploy a full-fledged Home Assistant.
- πΉ Your light bulb supports LAN-control or cloud management
- πΉ You need a quick setup without complex automations
What you need:
- π₯οΈ Computer or Raspberry Pi (you can use the same as for Home Assistant)
- π± HomeBridge application or installation via npm
- π Plugin for Xiaomi devices (e.g. homebridge-mi-aqara or homebridge-yeelight)
Instructions for setting:
- Install HomeBridge: Raspberry Pi: Sudo apt install -y homebridge macOS/Windows: via npm install -g homebridge
Install a plugin for your light bulb:
npm install -g homebridge-mi-aqaraOr Yeelight:
npm install -g homebridge-yeelightEdit the configuration file config.json (situated ~/.homebridge/). An example for Yeelight:
{
"bridge": {
"name": "HomeBridge",
"username": "CC:22:3D:E3:CE:30",
"port": 51826,
"pin": "031-45-154"
},
"platforms": [
{
"platform": "Yeelight",
"name": "Yeelight",
"devices": [
{
"name": "Bedroom lamp,"
"ip": "192.168.1.100"
}
]
}
]
}Attention:
username
pin
homebridge
Launch HomeBridge:
homebridgeAdd a bridge accessory to the Apple Home app via scan QR-code (it will appear at the terminal at launch).
β οΈ Note: If you use a cloud plugin (e.g. homebridge-mi-cloud), note that it requires a Chinese Xiaomi account with a linked phone number. +86. Without it, you can't get a token. The alternative is local plugins, but they only work with devices on the same network.
How to generate PIN-code?
Method 3: Native connection via Aqara hub (for a limited list of devices)
Aqara, a subsidiary of Xiaomi, has released several hub models that support HomeKit directly, the easiest way to integrate, but it only works with a limited list of devices, including:
- π‘ Aqara T1 LED Bulb (color and monochrome)
- π‘ Aqara LED Bulb (Tunable White)
- π Aqara Smart Plug (Special Models)
What you need:
- π Hub Aqara Hub M2 Or Aqara Camera Hub. G2H (HomeKit-enabled)
- π‘ Compatible Aqara light bulb
- π± Aqara Home app (available from the App Store)
Step-by-step:
- Connect the Aqara hub to the outlet and wait until it lights up in blue.
- Install Aqara Home and create an account (select China mainland for full functionality).
- Add a hub to the app via Add a device β Aqara Hub M2.
- Connect the light bulb to the hub: Turn the light bulb into the socket and wait for the blink. In the Aqara Home app, select Add the device β Lighting β [Follow the instructions on the screen (usually you need to press the button on the hub).
After successful addition, go to Hub Settings β Integration with HomeKit and follow the instructions for linking to Apple Home.
β οΈ Aqara hubs with HomeKit support are much more expensive than standard models (from 5000-7000). β½). If you already have a hub without a HomeKit (like Aqara Hub) M1S), It can not be updated software - you will need to buy a new model.
Advantages of the method:
- πΉ Native support (no delays like when using HomeBridge)
- πΉ Stable operation (no reliance on third-party servers)
- πΉ Support for Automations in the Apple Ecosystem
Disadvantages:
- πΉ Limited list of supported devices
- πΉ The high cost of the hub
- πΉ Need to use the Aqara Home app for initial setup
5. How to get Mi Home token for integration (if required)
Many Home Assistant and HomeBridge plugins require the Mi Home access token to manage devices, which can be obtained in several ways, but the most reliable is through the Mi Home app using the mihome-bin tool.
What you need:
- π± Smartphone with Mi Home installed (version for China mainland)
- π₯οΈ Computer with Python 3 and pip
- π The Mihome-bin utility
Instructions:
- Install Mi Home on your smartphone, sign up and add your light bulb to the app.
- Download and install mihome-bin: pip install mihome-bin
- Connect your smartphone to your computer and run a command to receive the token: mihome --discover --sync-device-info Enter the username and password from the Mi Home account (if required).
- After successful execution, a line of the form will appear in the terminal: Token: 5c1e2e3a4f... (Copy it and use it in the Home Assistant or HomeBridge configuration files.
β οΈ Note: Mi Home tokens may expire or be blocked when used frequently. If the light bulb has stopped responding, repeat the procedure for obtaining the token. Also note that for some regions (for example, Russia) tokens may not work β in this case, you will need to change the region of the account to China mainland.
π‘
If you use two-factor authentication in Mi Home, temporarily disable it in your account settings before receiving the token, otherwise the utility mihome-bin will not be able to log in.
6. Solving typical connection problems
Even with the correct following of the instructions, errors can occur, and here is a list of the most common problems and ways to solve them:
| Problem. | Possible cause | Decision |
|---|---|---|
| The light bulb is not found in the home Assistant/HomeBridge | Lack of support LAN-control | Update the light bulb firmware or use a cloud plugin |
| Error "Cannot connect to device" | Wrong. IP-address | Check the network settings, regenerate the token |
| HomeKit shows the light bulb as "Not responding" | Network connectivity problems | Restart your router and device, check the firewall |
| The color of the light bulb does not change from HomeKit | Limitations of the plugin or firmware | Update integration with Home Assistant or use an alternative plugin |
| The light bulb flashes after connecting | Conflict of teams from different systems | Turn off control via Mi Home, leave only HomeKit |
Additional advice:
- πΉ If the Yeelight light bulb does not respond to commands, try resetting it to factory settings (5 times to turn on / off the power).
- πΉ For Aqara devices, check that the hub is updated to the latest firmware.
- πΉ If you use HomeBridge, keep an eye out for homebridge logs. -D) error-diagnosing.
Frequent questions on the web:
- πΆ Light bulb and Home Assistant/HomeBridge Do you have to be on the same network? Yes, it's a requirement for local management. Cloud plugins (e.g. mi-cloud) don't require this, but they're slower.
- π Can I use it? VPN? Yes, but only if VPN Devices on the LAN must "see" each other.
- π What if after updating the firmware, the light bulb stopped working? roll back the firmware (if possible) or wait for the plugin update.
7. Alternative ways of connecting (for experienced users)
If standard methods don't work, alternative integration options can be considered, requiring more technical knowledge, but sometimes being the only solution.
1. firmware of alternative software (e.g. Tasmota or ESPHome)
Some Xiaomi light bulbs (for example, based on chips) ESP8266) You can reflash it to open source software like Tasmota or ESPHome, and you can manage it through the Internet. MQTT Integration with HomeKit through Home Assistant.
Warning: Third-party firmware is warranty-free and may cause the device to fail. Make sure your model is supported before you start (the list of compatible devices is available on Tasmota's website).
2. use of cloud services (e.g, IFTTT)
If local integration is not possible, you can configure automation through IFTTT:
- πΉ Create an applet with a trigger from Mi Home and action for HomeKit.
- πΉ The disadvantage of the method is delays of up to 5-10 seconds and dependence on the cloud.
3. Bridges from third-party manufacturers (e.g. Athom Homey)
Devices like the Homey Pro support a variety of protocols, including the Xiaomi Mi Home and HomeKit. They are more expensive than the HomeBridge, but offer more stable performance and advanced automation capabilities.