Cannot connect Xiaomi Gateway (lumi.gateway.v3) to HA

Then it looks like you have a gateway firmware where Xiaomi has disabled psm-set on.

I suggest another zigbee solution. Your sensors are still useful.

Quite why Xiaomi wants to make their gateways inoperable with other solutions is beyond me. Something to do with gathering all you base[1], or delivering advertising I guess.

[1] are belong to us!

Looks like I was lucky to get one of the last gateways with the psm-set command included. It was a pain to do the soldering but at least I got i working.
…and maybe I should take a look at Deconz if I ever approach the limit for number of devices connected to my Xiaomi gateways :wink:

@hmargera & @nikuha58; Be sure to keep us updated if you find a solution.

or zigbee2mqtt.

My gateway have been working about year. Today morning I saw that all my sensor are unavailable. Rebooted everything and no help. After trying and trying I finally checked with nmap and it says ports are closed! Unbelievable! How is it possible…? I haven’t upgraded firmwares for many months.
Only think I did was upgraded my phone software to new android and needed to relogin with Xiaomi app. Can this close ports somehow ?
Maybe I’m forced to open gateway and open ports via serial port…

I opened gateway, soldered wires and connected with Putty. Sent command psm-set network.open_pf 3 few times, check with psm-get network.open_pf - command status which showed result network.open_pf = 3 (1 bytes). So assume it should be okay. Shut down gateway, wires off and power on…Nmap shows:

Nmap scan report for 192.168.1.127
Host is up (0.0060s latency).
PORT     STATE  SERVICE
4321/tcp closed rwhois
9898/tcp closed monkeycom

Aarrgghh… do I have any other option than buy new gateway…? Tried many times, did factory reset etc. Nothing helps. Am I missing something ?

rid yourself of these problems and move to zigbee2mqtt

That could be good option. I was just wondering differences between zigbee2mqtt and Conbee 2 ? Also Nortek HUSBZB-1 looks interesting as I have two Z-wave devices. I have read that two usb sticks in ubuntu with NUC is sometimes challenging to get work.

Always disconnect my gateway from HA. About 1 moth ago it is working good. Not port problem because when I receive the error message after try the nmap and the port are open. What can I do with this? I have zigbee2mqtt with all my sensor but I want to use the gateway for bell night light etc.

Now lost again the connection:
HA show this error in the log:

Logger: xiaomi_gateway
Source: components/xiaomi_aqara/light.py:106
First occurred: 14:03:52 (2 occurrences)
Last logged: 14:03:52

Cannot connect to Gateway
No data in response from hub None

And after try nmap, and show this:

PORT STATE SERVICE

4321/udp open|filtered rwhois

9898/udp open monkeycom

MAC Address: 7C:49:EB:B1:84:37 (Xiaomi Electronics,co.)
Blockquote

So not port problem this cannot connect gateway…

Sometimes after a update to home assistant I need to unplug and replug the xiaomi gateway and then restart ha.

Hi, I would like to ask if it is compatible with (lumi.gateway.v2). Both 9898 and 4321 ports are close and I am trying to open. The port location for the serial communication is different from the others. Will it be able to integrate it to Home Assistant. Btw the model is DGNWG01LM.

In case of Conbee 2 you can use the ZHA functionality that is built into HA. So you don’t need Zigbee2MQTT and Mosquitto running as addons.

Ok, thanks! As a fast solution I got Samsung Smartthings hub from work. Duckdns wasn’t very reliable and I changed to use FreeDNS. After this change everything have been running smooth. Working range of ST hub is quite good so its positive side. But when I have time I need to check out Conbee.

1 Like

Hi Swaq.

I was do all the steps but for some reason it’s doesn’t work form me.
Look:

  1. psm-get network open_pf
  2. network.open_pf = 1 (1 bytes)
  3. psm-set network open_pf 3
  4. psm-get network open_pf
  5. network.open_pf = 3 (1 bytes)

Then I restart the gateway and looking for the open ports but de nmap query still tell me that both ports are close… :frowning:

PORT STATE SERVICE
4321/udp closed rwhois
9898/udp closed monkeycom
54321/udp open|filtered bo2k
MAC Address: 7C:49:EB:1D:63:18 (Xiaomi Electronics,co.)

If I doing again the steps on the serial connection, the first query show me again the number 1…

psm-get network open_pf
network.open_pf = 1 (1 bytes)

So… I think that the gateway doesn’t saved the “psm-set network open_pf 3” command.

Any suggestion?

Thanks in advance.

Hi teemurama.

How do you resolve this finally? I’m in the same page right now. Just like you, I want to use the gateway for doorbell, alarm and light stuff… my entire zigbee devices are connected to HA with zigbee2mqtt and CC2531. I really don’t want to give up with Xiami Gateway I invested a lot of time, but I want to throw it to the garbage right now lol

Thanks ind advance.

Hi!

I gave up :roll_eyes: Tried many times but nothing helped so ended up to buy Samsung Smartthings hubs ( two pieces ). It was only way to get things work again in fast schedule. Of course I lost siren which was build in on Xiaomi. Smartthings hub works over cloud so theres very small delay ( under 1 sec ) e.g. with motion sensor but otherwise I’ve been quite happy with those. That was also easy way to get another hub to my garage. Now zigbee cover is very good generally.

Wow… sorry to hear that… I Will give to the Xiaomi Gateway another chance… If I find the solution… I will tell you.

Hugs from Chile