Xiaomi Aqara Confusion

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

https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)

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

https://www.gearbest.com/access-control/pp_009984932110.html?wid=1433363

compatible

https://www.gearbest.com/living-appliances/pp_344667.html?lkid=12972004

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

xiaomi_aqara:
  discovery_retry: 10
  gateways:
    - mac: 34ce008ae62d
      key: !secret xiaomi_key
      host: 10.0.0.125
    - mac: 7811dc64dd69
      key: !secret xiaomi_key2
      host: 10.0.0.129

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

http://en.miui.com/thread-493295-1-1.html

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

2 Likes

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)

There are actually 3 hubs. A version 1 a version 2 and an aqara one. The first two work fine with Home Assistant, the Aqara one doesn’t (I explained this already in this thread, just three messages above this one).

The Aqara one is super easy to distinguish, IF the hub had a “compatible with Apple Homekit” sticker than you are in bad luck. It is the aqara hub that does NOT work with Home Assistant. Both Mija hubs (they won’t have the word aqara in them anywhere) work fine with Home Assistant though the version 1 has some limitations.
As can be found in the docs:

Remember the following: Aqara devices will work with Home Assistant just NOT the hub. So you CAN get Aqara doorsensors, but you will have to pair them to your MIJA hub.

The Mija hub for example does not use the Aqara app, but the MiHome app, and the Aqara hub used the Aqara app, and as there is no way to enable the developer mode on an aqara hub this is not supported.

You can not connect to a European server if you want to enable developer mode, you can not pair xiaomi camera’s to the hub if you set the server to Europe either.
If you do not want the hub to dial out, you could either block traffic coming from the hub (numerous ways to do this). Or you should get a zigbee stick, that way you won’t need the Hub at all.

Lastly, Why would you want to open the Hub?

If you have default_config: setup in your configuration than you won’t need to add the hub manually to get the devices. Though if you want to control the hub (e.g. sound, light) you will have to enter the developer code into your configuration.yaml

It would look something like this:

# Xiaomi Aqara/Mija
xiaomi_aqara:
  gateways:
    - key: YOUR_CODE_HERE
  discovery_retry: 3

Edit: seeing the bundle you have bought, it is a version 1 which should be able to work with Home Assistant! Make sure you have followed the steps right to enable developer mode. I did this on Android as it was (don’t know about the present) nearly impossible to do this on an iphone. Don’t have an Android device like me? You could just simply download an emulator like memu/bluestacks or any other Android emulator. Good luck!

Blockquote
Why would you want to open the Hub?

At the bottom of the Home Assistant instruction link for Xiaomi Gateway it states " If your gateway’s MAC address starts with 04:CF:8C , there is a good chance that the required port 9898 is closed" … and it continues by saying …

  • Find a specific screw bit (like a fork) to open the gateway case.
  • Find a USB-UART cable/module and connect it to your computer.
  • Solder 3 wires - RX, TX and GND like here.

I followed the instructions to integrate into home assistant with little luck (no gateway detected).
I changed the key from the Mi-App (hence, from what you say, my Gateway is not an AQARA, and it does not say AQARA anywhere) several times and restarted the pi after changing the new key. Still no luck.

Gateway not detected.

I think I will use the gateway to turn lights on/off around the different rooms, but for the door switches I will go for the TI Zigbee emulator USB stick.