Connecting the light bulb Xiaomi HomeKit: all the ways and nuances

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 AssistantHomeBridgeAqara 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).

πŸ“Š What kind of connection method you plan to use?
Home Assistant
HomeBridge
Aqara Hub
Another way.
I haven't decided yet.

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:

  1. Install Home Assistant on your chosen device. The Raspberry Pi will fit the Home Assistant image. OS, Docker - Official container.
  2. 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:

  1. 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-aqara

Or Yeelight:

npm install -g homebridge-yeelight

Edit 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:

homebridge

Add 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?
Open the terminal and execute the command: homebridge will appear in the logs QR-code PIN species XXX-XX-XXX. You need to enter it in the Apple Home app when you add a new accessory. PIN It is not displayed, check that in config.json is correct "username" (MAC-address of your device without colons).

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:

  1. Connect the Aqara hub to the outlet and wait until it lights up in blue.
  2. Install Aqara Home and create an account (select China mainland for full functionality).
  3. Add a hub to the app via Add a device β†’ Aqara Hub M2.
  4. 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:

  1. Install Mi Home on your smartphone, sign up and add your light bulb to the app.
  2. Download and install mihome-bin: pip install mihome-bin
  3. 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).
  4. 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 causeDecision
The light bulb is not found in the home Assistant/HomeBridgeLack of support LAN-controlUpdate the light bulb firmware or use a cloud plugin
Error "Cannot connect to device"Wrong. IP-addressCheck the network settings, regenerate the token
HomeKit shows the light bulb as "Not responding"Network connectivity problemsRestart your router and device, check the firewall
The color of the light bulb does not change from HomeKitLimitations of the plugin or firmwareUpdate integration with Home Assistant or use an alternative plugin
The light bulb flashes after connectingConflict of teams from different systemsTurn 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.

FAQ: Frequent questions about connecting Xiaomi light bulbs to HomeKit

❓ Can you connect the Xiaomi light bulb to HomeKit without additional software?
No, native support for HomeKit is not available in Xiaomi light bulbs (except for some Aqara models), but you always need middleware: Home Assistant, HomeBridge or Aqara’s branded hub.
❓ Why the light bulb connects but doesn’t respond to commands from HomeKit?
There could be several reasons: πŸ”Ή The light bulb doesn't support it. LAN-Control (check the model in the compatibility table). πŸ”Ή Wrongly stated. IP-address. πŸ”Ή Conflict with other control systems (e.g. Mi Home) Try disabling all other control methods (e.g., remove the light bulb from Mi Home) and restart Home Assistant/HomeBridge.
❓ Do I need to leave the Mi Home app installed after setting up?
Not if you are using local management (LAN). However, some plugins (e.g. cloud plugins) may require an active Mi Home account. Deleting the application will not affect the work through HomeKit if the setup is already completed.
❓ How to Reset Xiaomi Light bulb to Factory Settings?
For most models: Turn off and turn on the light bulb power 5 times in a row (with intervals) ~The light bulb should start flashing, which is a reset signal. After reset, you can add it back to the Mi Home or Home Assistant. For Aqara lamps, use the reset button on the housing (if any) or the command via the hub.
❓ Does voice control (Siri) work after connecting to HomeKit?
Yes, once integrated successfully, the light bulb can be controlled via Siri or the Control Center on the iPhone: πŸ”Ή "Hi Siri, turn on the lamp in the living room" πŸ”Ή "Hi Siri, Make Lights Warmer by 30% Make sure that the HomeKit settings add a light bulb to the room with the correct name (e.g., "Living Room") so that Siri can identify it.