Xiaomi Aqara Confusion

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.

Oh, it actually is the first time I hear this. Ouch. Let me guess? Yours end with this?

That kinda sucks. Well, I can’t answer that question though. You could try sending it back and order a new one (just the HUB ofc). Try to get a version 2 if you happen to do so.

Otherwise you could indeed just open the device and do it the harder way. (It saves waiting on a new one though). I don’t know what screwdriver you would need but bringing the device to a shop wouldn’t hurt as they are pretty portable. The docs say it looks like a fork. I might look at my own gateway when I get back home and see if I can find it.

Usually soldering wires to a device to flash it or to access terminal (in this case) is pretty simple to do even though it might look very daunting. The commanda you will need are only a few lines so that shouldn’t be a big problem.

I will post here again if I have found the screw that should open the device.

1 Like

Thanks @jimz011 for your help finding the type of screwdriver which I might need to open the Gateway.
I don’t mind the soldering.and the sending of some serial commands as long as it opens up the port and make the box work with hassio,
I think my version, by the way, is a v3. It also says in the name in the info “lumi-gateway-v3” or something similar
I happened to see, somewhere on the net, a picture of two different types of Mijia Gateways which could be identified, on the socket side, by the Chinese writing.
In that article they said “if you have only one line in Chinese near the socket - like in my case - the port 9898 will be always closed and it won’t work with home assistant”.
The same article stated that the other older Gateway which has the port open has the Chinese writings in more lines in a square format near the socket.
I cannot find that article though…:unamused:

I am getting more and more convinced that the Gateway is a useless piece of kit. apart from the light and the Internet Radio (which would be nice to be in different language from Chinese) -
My interest was in the Zigbee sensors, which I initially thought could be easily integrated in hassio via the Gateway.

I am getting more inclined to go the CC2531 route now, somehow, the more I think of what I am trying to solve.

Regarding the “sending the Gateway back”, unfortunately I have not received any response from the seller and, as the Gateway works with MiHome app, it is doing what it was designed to do, right?.

Yes it is designed that way indeed, just tell them you have a faulty device (or that it doesn’t work or something like that). They will probably ask you to send a videoproof of it (and usually they ask you to destroy it and give them proof of that too).

Yeah well the hub doesn’t do much for Europe/US, as it only has a ledlight and a radio (which is useless for us). Oh it has a button as well, but to my knowledge this doesn’t work with HA anyways. So basically the HUB is just for connecting Xiaomi zigbee devices, but this can also be done with a Zigbee stick (you could even make one yourself). And then use something like Zigbee2mqtt to control them.

I actually don’t know what version I have (I also thought I had a v3, but someone in this thread said there were only v1 and v2) after googling it seems there are 4 versions of this hub (a v1,2,3 and an aqara version).

I wonder if you know whether it is possible to put an old version of firmware into the Gateway?

I never heard of that either though, seems unlikely to me unless you can find the original firmware but I don’t think it is freely available on the internet (but who knows, for the xiaomi camera’s this is possible to flash another firmware so maybe).

I can’t find my device version though, will have to take a look on where to find that. Howevet I did find the screws. It looks like a fork indeed, though I have never seen a screw like that before (something chinese maybe? :stuck_out_tongue:) but anyways if you zoom in on the photo you can see the head.

To get to the screws just get a sharp knife and pry under those white rubber thingies. (There are 2 of them, both situated at the top side where the button is).


I tried to put something in the two slots. I have nothing that can do it.
I will try to pop in one of the local shops who replace phone screens, in the hope they have something.

On the usb ZigBee front. I read those dongles don’t seem to have as good network coverage as the Xiaomi gateway.

Mmmmm. Not sure which way to go.

Where can I find the full instructions on how to flash this? Let’s say I do get it open, where can I find info on the wiring and what flash app and file is needed?

The instructions are in

  • Turn on the gateway (220V).
  • Open a serial terminal application (e.g. PuTTY) and connect to the serial port assigned to the USB-UART module (baudrate: 115200).
  • Wait until the gateway is booted up, connect the RX, TX and GND wires to the UART module (don’t connect the Vcc (power) wire!).
  • You will see all the messages from the gateway.
  • Send the command psm-set network open_pf 3 (the command has to end with a CR newline character).
  • Check your settings executing the command psm-get network open_pf to be sure it’s OK.
  • Restart the gateway.

Mine actually worked with hassio without the need of any mods. It was a v2 gateway, maybe they changed something in the latest hassio version.

I use this

Expensive!

Well the Stick is 40€.
The it is directly connected to my Hass.io and the Data is stored locally.
There is no Bridge which is connected to a Chinese cloud and only connected to the Internet, if i let it.
Also i can connect Lights like Hue or osram Smart plugs.
For example osram Smart plugs can be used as mesh repeaters, so i can have a zigbee mesh Network in my whole house.

So I save money, because i only have the conbee Stick and don‘t need a aqara, Hue, osram, Ikea, … Bridge.
All are connected in one zigbee Network and I don‘t have to think about the interference of what all the Bridges could bring.

So 40€ isn‘t really expensive.

1 Like

I think this is doing the same thing, but for much less money?

I don’t have and expirience with this.

Last update messed things up for me, my V2 gateway is not working anymore. Hassio keeps giving me an “invalid config” error for xiaomi-aquara

I can’t find this info in the link you provided, is there a video of this setup?

I managed to open the gateway, connected wires and tried to send the command over the serial port using raspberry pi. It did not change anything . Port 9898 still closed. I also could not find any video. I will try once more sending the command via putty but I need a usb buffer.
Meanwhile I have just received the USB dongle for the raspberry pi where I am running hassio. This dongle is basically a ZigBee gateway which converts sensor signals from ZigBee sensors and switches into mqtt signals.
I programmed the dongle (which cost me £8 from AliExpress) and managed to hook all switches and sensors into hassio. Finally!!!

If you want to use the xiaomi gateway it sounds like Xiaomi has closed the door for integration into hassio or other home assistant ecosystems.
You can still use the Mi App, going to China and back.
Personally I think I will stick with the USB dongle (see the link to AliExpress website). I can help you set it up as I did, if you decide to buy one.
You will need to use an add-on for Hassio (zigbee2mqtt) and then pair all sensors and switches to the dongle (this is a bit tricky but it works with the Xiaomi motion sensors, door sensors, mijia button which I have bought with the Xiaomi gateway)