Connection to Xiaomi Bridge not working


i have a xiaomi gateway installed but was not able to bind it to openhab2. I am running the latest “testing”, configured everything according to the documentation but the item remains in “INITIALIZING” and then goes to OFFLINE after a while. I am pretty sure to have configured the correct ip address and Developer Key.

Anyone with the same issue and solved it?

BR, Jens

here a little bit more info:

15-Okt-2018 21:26:04.394 [DEBUG] [openhab.binding.mihome.handler.XiaomiBridgeHandler] - dispose
15-Okt-2018 21:26:04.395 [DEBUG] [penhab.binding.mihome.internal.socket.XiaomiSocket] - Interrupting Thread Thread[Thread-182,5,main]
15-Okt-2018 21:26:04.397 [DEBUG] [penhab.binding.mihome.internal.socket.XiaomiSocket] - Closing socket
15-Okt-2018 21:26:04.399 [TRACE] [penhab.binding.mihome.internal.socket.XiaomiSocket] - Receiver thread was interrupted
15-Okt-2018 21:26:04.400 [DEBUG] [penhab.binding.mihome.internal.socket.XiaomiSocket] - Receiver thread ended
15-Okt-2018 21:26:04.410 [DEBUG] [openhab.binding.mihome.handler.XiaomiBridgeHandler] - Init socket on Port: 9898
15-Okt-2018 21:26:04.412 [DEBUG] [.binding.mihome.internal.socket.XiaomiBridgeSocket] - Setup socket
15-Okt-2018 21:26:04.417 [DEBUG] [.binding.mihome.internal.socket.XiaomiBridgeSocket] - Initialized socket to null:-1 on
15-Okt-2018 21:26:04.419 [DEBUG] [penhab.binding.mihome.internal.socket.XiaomiSocket] - There are 1 open sockets: {}
15-Okt-2018 21:26:04.421 [TRACE] [penhab.binding.mihome.internal.socket.XiaomiSocket] - Staring reveicer thread for socket on port 9898
15-Okt-2018 21:26:04.423 [TRACE] [penhab.binding.mihome.internal.socket.XiaomiSocket] - Thread Thread[Thread-188,5,main] waiting for data on port 9898
15-Okt-2018 21:26:04.421 [TRACE] [penhab.binding.mihome.internal.socket.XiaomiSocket] - Adding socket listener org.openhab.binding.mihome.handler.XiaomiBridgeHandler@d91977
15-Okt-2018 21:26:04.440 [DEBUG] [openhab.binding.mihome.handler.XiaomiBridgeHandler] - Cancelled running timer
15-Okt-2018 21:26:05.440 [DEBUG] [openhab.binding.mihome.handler.XiaomiBridgeHandler] - Triggered discovery
15-Okt-2018 21:26:05.445 [DEBUG] [openhab.binding.mihome.handler.XiaomiBridgeHandler] - Send to bridge mihome:bridge:d30fcfbb: {"cmd": "get_id_list"}
15-Okt-2018 21:26:05.447 [TRACE] [penhab.binding.mihome.internal.socket.XiaomiSocket] - Sending message: {"cmd": "get_id_list"} to /

Version code:201

[{“model”:“”,“did”:“lumi.158d0002325d11”,“name”:“Temperature and Humidity Sensor”}]

and a tcpdump

21:43:04.730471 IP > UDP, length 22
21:43:05.131457 IP > ICMP udp port 9898 unreachable, length 36
21:43:09.757646 ARP, Request who-has tell, length 28
21:43:09.759202 ARP, Reply is-at 7c:49:eb:1c:d5:72, length 46

ok… now i see by myself that the gateway told openhab that the port 9898 is unreachable… BUT WHY… ?

No one a clue? :frowning:

Hi Jensen,

Looks like the gateway (.54) replied to your openhab server that port 9898 was unreachable. Perhaps it is not open? I’m wondering if you are having the same problem as me down the bottom of this forum post. I’m currently trying to get to the bottom of this.

Can you use nmap to check if the port is responding? Also; can you run tcpdump to check if you see multicast packets being sent on


Hi Aaron,

to be honest: I gave up on this. It seems as if some bridges are simply “broken”. I switched to zigbee2mqtt an a USB-Zigbee Stick.


Hi Jensen,

I’m guessing you’re using zigbee2mqtt with Xiaomi devices? Are you finding that works without any issues? That might be a safer option rather than continuing to buy gateways until I find one that works…

Hi Aaron,

yes, that is exactly what i am doing. First i tried the Zigbee Bindung from OpenHAB, but it was not stable enough for me. I had issues with updates from sensors and was also not able to connect a ZigBee router to extend the network. I switched to Zigbee2mqtt and the mqtt Binding and it works for me.


1 Like

Hi Jens,

do you have a tutorial for that?


Hi Sven,

i used a combination from and Howto use zigbee2mqtt with openHAB, removing proprietary bridges / gateways