Home Assistant Community

Xiaomi Aqara Confusion


Hi guys I’m looking to purchase some items from the Xiaomi ecosystem but there seems to be numerous hubs, names of devices etc.

Can anyone tell me what Gateway 100% works with HA, the Aqara switches and the Xiaomi sensors? I can’t find anywhere that says the Aqara switches definitely work the Gen 2 hub

Thanks guys

1 Like
Can't configure Xiaomi gateway

i have the 2 x v2 hubs and both Xiaomi and Aqara devices work fine with them.

1 Like

You have 2 hubs? How come? Is the integration with HA easy enough?

Could you send me a link to the exact Gateway you have?


I originally used Domoticz before transferring to HA , they have avery good wiki here


Basically the hub need to be compatible with the xiaomi app Mi Home. HA, Domoticz and openhab all require the developers code generated by the Mi home app to communicate with the hub. The latest Aqura Hub uses a different app and that does not have a developers code . The only issue I have is the dual wired wall switches do not support decoupled mode. This means you cannot use the switch as individual wireless switches as you can in the mihome app


I can’t find a product named Xiaomi Gateway Aqara, I can find Xiaomi Gateway and the new Homekit enabled one which I know isn’t compatible.

Decoupled? So you can use the WIRED switches as wireless switches? What scenario would you want to do that?


Not compatible




Decoupled mode is very useful in two way switches. Upstair light switch turning on a downstairs hall light and vise versa

1 Like

Each hub has a limit of 30 zigbee attached devices, i have 50, so i split them based on which is the closest hub to the sensor where possible.

After enabling the developer mode for each gateway, i basically added the correct config for them to my configuration.yaml

  discovery_retry: 10
    - mac: 34ce008ae62d
      key: !secret xiaomi_key
    - mac: 7811dc64dd69
      key: !secret xiaomi_key2

Also multicast is required.

i will try and dig out my purchase of the hubs as it was over a year ago

Also, when getting the keys from the gateways, try and use an Android device, ios has issues with getting incorrect keys and multiple attempts maybe required


You guys are ace! Thank you


If you are confused, you may check out this link. It bridges zigbee and MQTT together to communicate. So you don’t need any gateway to connect aqara sensors to HA. There is a github page for further information and tutorial.

1 Like

Where did u find the information about limitations of 30 zigbee devices …because I think I reached the limit as I cannot add another sensor … I’ll also go for a second hub I think


From gearbest site and also there is a thread in mi forum

Original Xiaomi Mi Smart Multifunctional Gateway WiFi Remote Center Control 16 Million RGB Lights - Updated Version

Main Features:
• Original Xiaomi smart multifunctional gateway for daily use.
1200 Internet Radio Broadcast: Multi live online radio optional, you can enjoy beautiful life.
16 Million RGB Lights: The gateway can bu used as the small night lights, lights can adjust color and brightness.
Custom Ring: Not only can upload MP3 (only applicable to Android), but also can record your favorite sound as a bell. The unique personality doorbell ring will make your home more different.
Nightlight Function: It will automatically open when someone pass by when match the human body sensor
APP Control: More convenient to use
• Variety ways to put and install
• Suitable for all kinds of household environment
• A Xiaomi multi-functional gateway can connect up to 30 sub devices


Thanks a lot …just bought the second one :wink:


Do I need to enable multicast on my router?
Because I have the same settings and my second gateway is not responsing normaly - it seems as.that feedback is not comming to HA…


So the model ZHWG11LM (homekit) is not compatible. Ty!


Correct. The Aqara Hub is not compatible (at this moment int time) with HA


Can someone please confirm if Aqara sensors work with Mi gateways?


Just get a mija control hub (DO NOT GET THE AQARA HUB).

I can confirm that everything works fine with HA. Mija as well as Aqara sensors (I use aqara door and temp sensors).

The only downside is, no native homekit integration, but seeing you want to use it with Home Assistant this shouldn’t be a problem. If you use Homekit you should be able to push the entities from HA to Homekit anyways.

Oh and not to forget, you need the Mi Home App for those hubs (NOT THE AQARA APP).

So to summarize:
Get a Mi Home Gateway (aka, mija gateway, xiaomi gateway etc.) make sure you get version 2 or 3 (I got version 3, but the other versions should work as well)

Most if not all aqara sensors, buttons etc can be paired to this gateway with the added bonus of the possibility of adding mija sensors as well (which can be cheaper in some cases). Read up on the HA docs to see which devices are not supported even with this Gateway.

Here a summary of what will most certainly not work:

Unsupported Devices

  • Xiaomi Aqara Gateway (lumi.gateway.aqhm01), as it is not possible to activate dev mode in the Mi Home App.
  • Gateway Radio
  • Gateway Button
  • Xiaomi Mi Air Conditioning Companion (lumi.acpartner.v2)
  • Aqara Intelligent Air Conditioner Controller Hub (lumi.acpartner.v1)
  • Decoupled mode of the Aqara Wall Switches (Single & Double)
  • Additional alarm events of the Gas and Smoke Detector: Analog alarm, battery fault alarm (smoke detector only), sensitivity fault alarm, I2C communication failure
1 Like

Thank you so much! I couldn’t find Gateway v3 online, all I found is Gateway v2 (DGNWG02LM)


Hm not sure actually if there is a v3 haha. I got the latest one before the aqara version came out. Probably version 2 then.

1 Like

Hi all.
I agree about the confusion of the Xiaomi Gateways.

I took a punt and bought this bundle from Aliexpress

My plan was to extend my HomeAssistant and NodeRed system (so far I have integrated SONOFF/TASMOTA smart-switches, Nest thermostat - grrrr, don’t get me started - Ring Camera and Alexa). Having a set of door switches to tell my HASSIO/NODERED that my wife has left the windows opened, while the heating is on, would allow me to turn off the heating, right? to do that I thought the door-switches in the bundle would be perfect.

The Gateway looks very similar to the one recommended by @lonebaggie as workig with HA.

I followed the instructions, but the Gateway cannot be discovered by my HASSIO

Though I cannot find a straight answer anywhere, the reason for the failure of my Gateway being discovered by HASSIO could be either of these:

  • The Gateway I have has the Chinese writings at the bottom all in one line, as opposed to Chinese writings in a rectangle (sorry for the bad explanation, I have seen a picture of the two different Mijia Gateway I am talking about, and apparently, the one I have would not work with HA)
    The Gateway recommended by @lonebaggie has the same Chinese writings as mine
  • I believe I updated the firmware of the Gateway from the Mi-Home app before entering into Developer Mode, and this closes, from what I understood in different articles, port 9898 and 4321 of the Gateway
    I won’t be able to give you the exact firmware number of my Gateway, as I am not at home for the next couple of days
  • Gateway faulty? (unilikely, as it works very well with Mi-Home)

My questions:

  1. Is there anyone who can put some clarity in the two different Mijia Gateways, if known
  2. Is it possible to use the Gateway without being connected to the Internet?
  3. Is it possible to connect the Gateway to a European locale/server, rather than China only?
  4. How do I open the three screws at the bottom of the gateway, if I wanted to open the ports with the USB-UART, as described in the user guide in the link above, also included elsewhere in the topic? These screws I am referring to are non-standard (nearly flat, with a metal dimple in the middle, what kind of tool do I use to unscrew them?)

Thanks for your patience and answers in advance.
I spent a couple of days already and am in three minds whether to give up and buy another gateways, which gateway should I buy that works with HA, look at alternative solutions to my initial problem (i.e. door switches that connect to HA without all of these confusing Xiaomi/Mijia/Aqara echosystem)