Hi there!
I’m a fan of the Xiaomi smart home gadgets, using over 50 devices. I’m successful running 5 gateways integrated into openHAB 2.3 (via openHABianPi).
Now I’m struggling with integrating a sixth gateway:
- I’ve added the gateway to the Xiami app and can access it from there. I can even add sensors to it.
- I’ve enabled the Wireless Communication Protcol and obtained an access key.
=> But openHAB does not discover the gateway – for the other five gateways I could see the gateway in my Inbox
What I’ve tried so far:
0. I’ve updated the gateway to the latest firmware version (1.4.1-159).
- I started with connecting the gateway to a new WiFi network, physically separated from the WiFi network I successfully used. When activating the Wireless Communication Protocol I had to give it a few tries before it work. As for the unsuccessful attempts I received timeout errors. => no auto-discovery
- I restarted openHAB, restarted the gateway => no auto-discovery
- I paired the gateway again => no auto-discovery
- I connected the gateway to the WiFi network on which the other five gateways run smoothly. I’ve enabled the Wireless Communication Protocol and retrieved a new key => no auto-discovery
- I’ve set the log-level for the Xiaomi binding to TRACE. I’m receiving Datagram packets for the five gateways which work smoothly, but there a no Datagram packets from the new, not working gateway.
- I’ve created a things-file without any contained things, just to see if the gateway’s state changes from
initializing
.
Bridge mihome:bridge:7c49ebxxxxxx "Xiaomi Gateway" [ serialNumber="7c49ebxxxxxx", ipAddress="192.168.0.xxx", port=9898, key="XXXXXXXXXXXXXXXX", pollingInterval=6000 ] {
Thing mihome:gateway:7c49ebxxxxxx "Xiaomi Mi Smart Home Gateway" [itemId="7c49ebxxxxxx"]
}
I derived the serial number 7c49ebxxxxxx from the gateway’s MAC address (as I concluded from the working gateways). The key attribute is the key from the Wireless Communication Protocol screen in the Mi Home App. I obtained the IP address from my router where I can see the device to be successfully connected to my WiFi network.
VS Code underlines mihome:gateway:7c49ebxxxxxx
because of an error: "Provide a thing type ID and a thing ID in this format: ". To me this seems correct, it’s like in the sample of the Xiaomi Binding documentation.
When I remove the mihome:gateway declaration, I can see the following in my openHAB logfile:
2018-10-27 13:16:48.298 [DEBUG] [g.mihome.handler.XiaomiBridgeHandler] - Triggered discovery
2018-10-27 13:16:48.300 [DEBUG] [g.mihome.handler.XiaomiBridgeHandler] - Send to bridge mihome:bridge:7c49ebxxxxxx: {"cmd": "get_id_list"}
2018-10-27 13:16:48.302 [TRACE] [.mihome.internal.socket.XiaomiSocket] - Sending message: {"cmd": "get_id_list"} to /192.168.0.xxx:9898
In the PaperUI I can see the gateway as INITIALIZING
. But when I add the mihome:bridge entry the thing disappears from PaperUI and I do not see the discovery attempt in the log.
Using this things-file, the gateway remains in state initializing.
So, now my question: What am I doing wrong? What else can I do to connect my new gateway to openHAB?
Best regards,
cd_