Xiaomi Gateway (Aqara) and DGNWG02LM lumi.gateway.v3

Hi guys, I have been reading for a couple of days but only for the Gateway 3 it seems to be there is a solution. Is there any hope for activating LAN access for the DGNWG02LM? I cannot find a way to integrate my door sensors into HA. I tried Xiaomi Miot but it gives ma a lot of strange false events and I understand polling it not the best option for binary sensors.

Currently the gatway is running 1.4.1_176

Update:
So the solution: You do not need to downgrade. Just open 3 screws, solder 3 wires and send 1 command to the gateway to open the LAN port. I bought a cheap CP2102 USB to UART adapter and used putty.

Speed 115200.

First you need an (old) android phone to side load an old version of the Xiaomi home app, I used Version 5.1.37

There you also see the password which you need later for home assistant.

Send the command a couple of times just to make sure

1 psm-set network.open_pf 3

Just do NOT hard reset the gateway or it will close the port again.

You can then test the port if you want, on linux (fedora)

sudo nmap -sU -p9898 192.168.178.31

Spanish manual: Integrar gateway V3 de Xiaomi en Home Assistant - Domology 2.0

uart0
uart1

Bildschirmfoto vom 2024-01-10 18-35-30

Bildschirmfoto vom 2024-01-10 18-42-45

3 Likes

looks interesting. that will be my next project. Let’s see where I can get the old Android version.

1 Like

I use an old fire tablet for this. Should be available for 10€ somewhere

1 Like

Putting this here for myself as I’ve connected via serial several times to two devices I have. Had to reset one recently and then go though the dance of getting it back online.

Despite running psm-set network.open_pf 3 multiple times and confirming I got ‘3’ with psm-get network.open_pf, the required ports were still closed. After 2hrs, I remembered :bulb:that I had to also enable LAN mode but this feature has been removed years ago in the Mi Home App. I downloaded version 5.6.68 from APKMirror here and told Android to install it anyway. Logged in to China Mainland and the ‘About’ page allowed me to click the ‘Plug-in version’ several times to access the hidden menu and reach the ‘Wireless communication protocol’ settings where I could turn that on and copy the password. After that, running nmap returned that the ports were now open and the Xiaomi Gateway (Aqara) integration could now talk to it!:hugs::hugs::confetti_ball::tada::balloon: