Binding Xiaomi Mi home getway

  • Platform information:
    • Hardware: Laptop 8GB ram
    • OS: Windows 7

Hellow
I am trying to bind the xiaomi Gateway v2 hub.
I followed the instructions here: https://www.openhab.org/addons/bindings/mihome/
But it seems that it cannot find the getway.
The openhab and the getway in the same network.
I tried to click 3 times on the getway when click on “search” and still the item is not discovered.

What can I do?

I had to try mine two of three times before it worked.

I assume you put the app into dev mode and followed that process with entering the key etc?

Hellow
I do not understand it.
There are 2 kind of xiaomi bindings :

  1. Xiaomi Mi IO Binding
  2. Xiaomi Mi Smart Home Binding

When I am adding the first binding it discover the getway but no sensor attached.
But I understand that I need the second binding.
So after I installed the second binding (Xiaomi Mi Smart Home Binding) nothing discovered.
What could be the probelm ?

Hi Inmar,

I’ve also just started with the Xiaomi Binding. As Crispin already said, it will only work if you follow the instructions on the Xiaomi Mi Smart Home Binding page. This is the only Binding you should need.

Especially important is that you enable the Developer Mode, and there note down the developer key AND turn On the switch to enable the WiFi functions.

All the best.

Hi
I am in developer and have the key.
But what are the steps to follow?
I installed the binding plug in of Xiaomi MI Smart binding and then what? The getway is not discovered in the Inbox :frowning:
Attached the info of the getway.
Maybe there is compatiability issue with getway v3 and OH?

This is not the page described in the binding setup, the required page does have the switch to enable the WiFi functions and the developer key stated underneath.

When you go back on the page you showed above and go into the option before or after going into this page, then you should get the correct page with the WiFi functions switch and the developer key.

Is your Gateway the HomeKit enable version currently on sale in Europe?

Hi
I attached the Hub info… the other page you talked about is attached now.
What do you mean by " HomeKit enable version "
I bought the getway from this link:
https://www.aliexpress.com/item/32970092903.html?spm=a2g0s.9042311.0.0.27424c4d4kc5ak

Yes, this is the correct page, with the wireless protocol turned on and the required developer key (aka password).

I got my fateway from China as well, and it also shows up as v3, same as yours. As far as I know the current HomeKit enabled version of the Aqara gateway does not allow this developer support and therefor inclusion into openHAB with the binding.

I created all my Things and Items through text files, but they also show up for me in the Inbox in PaperUI.

What exactly do you mean by “I tried to click 3 times on the getway when click on “search” and still the item is not discovered.” Do you see the gateway, but not the sensors in PaperUI?

Hi
I meant that after verifing that the wireless is on, that the getway and the HA are in the same network and after installing the binding of Xiaomi MI Smart Binding still nothing appears at the inbox.
When I installed the other binding “Xiaomi Mi IO Binding” the gateway ware found so I really don’t know what is the issue here …

I tried anything… even trying to click 3 times on the gateway… nothing worked for the Xiaomi MI Smart Binding

Ok, yes, this is weird. Now you have only the Xiaomi Mi Smart Home Binding installed, the Xiaomi Mi IO Binding is deactivated again, right?

Have you tried a restart with this configuration, after activating and deactivating the different bindings?

Also, as noted on the binding page:

  • The binding requires port 9898 to not be used by any other service on the system.
  • Make sure multicast traffic is correctly routed between the gateway and your openHAB instance

Have you checked the multicast traffic in your machine running openHAB, and can you see the regular heartbeat from the gateway?

Xiaomi Mi IO Binding is deactivated.
I tried to restart as well.

How can I know if " port 9898 to not be used by any other service on the system" ?
How can I make sure multicast traffic is correctly routed between the gateway and your openHAB instance?

I checked and there is a ping between the Ha and the Gateway.

Thank you for your help.

Have a go through the Troubleshooting section of the binding page, depending on your setup.

Hopefull this will narrow down the problems.

Great I will try to troubleshoot and update.
Thanks.

I am unable to connect to Mi Smart Home Hub / Gateway.
I purchased the product in Hong Kong, which is convenient as it is the same plug type as where I live in the UK.
However when I download the Xiaomi Home app, the version is later (3.3.10_116) than what is specified in the Binding documentation instructions (2.xx.x).
In latter version there is no ‘About’ option, which would allow me to obtain the developers key, which is required to initiate the Binding.
Does anyone else have this problem and is able to resolve?

Please help

Hello,
I have the same problem.
I have a Xiaomi Gateway v3, have login the gateway in the developer mode and install the binding “Xiaomi Mi Smart Home Binding”.
But I do not see the “xiaomi Gateway” who I can input the developer key.

Have everybody an idea?
Thank you!
Michael

1 Like

I have a lot of problems with Xiaomi Mi Smart Home Binding. I have done a lot of tests because all of the next problems appears to me with a Windows 10 computer… all of them are on diferent old posts. The consequences of all of this are the same: you can see the Gateway, you can connect but in a few minutes, all devices goes off-line. This is because OpenHAB needs to receive de heartbeat packets that are regulary send by Gateway.

1- Xiaomi Gateway don’t send multicast packets to 9898. If this happens, you need to open Gateway Hardware, solder two wires with a serial port debugger and do some stuff. You can check if this is happening using Wireshark on promiscuous mode in the same LAN as Gateway and reading old posts with this problems (the detailed procedure is explained there).

2- Xiaomi Gateway is sending packets and “heartbeat” packets, but they don’t arrive to device with OpenHAB. Probably Router configuration. Not all devices work correctly with multicast packets, or could be deactivated. Check router configuration while read network packets in same network as OpenHAB is running.

3- Xiaomi is sending multicast heartbeat packets, you can see them on your computer with OpenHAB, but only in promiscuous mode. With the network card on “normal mode”, no multicast packets are received. This is hard to solve, I can’t give a correct solution, because I am not sure if is due a Router Configuration, a Routing configuration on PC (route table), or also due to the next problem (number 4).

4- You can see the heartbeat packets with Wireshark on normal (non promiscuous mode), but yet your OpenHAB disconnect the Gateway after a couple of minutes. Viewing the log of OpenHAB, you can see that it doesn’t reading heartbeat packets. This is due a bug on Binding, because it opens an incorrect network card to wait multipackets (I have read that try to open the first card, that is the loopback card). I think that this only happens on Windows machines. There are a “patched version” of Binding that opens a listening socket on every network card found… and with this! I am finally capable of connecting correctly with Xiaomi Gateway without disconnections. I don’t know if this bug (it is reflected on GitHub) is actually corrected.

BUT, I can actually read sensors connected to Xiaomi Gateway, but I can’t actuate to the Gateway, if I try to switch on the light for example, nothing happens… I don’t know why… More investigation time needed!

Hello!
Is anyone able to comunicate with Smart Lock?
Xiaomi Smart Lock

I plan to use some Xiaomi temperature and humidity sensors connected to the Xiaomi Mi getway v2. I would like to have my raspberry pi with openhab just with ethernet and no wifi. It will work this way or the raspberry pi and xiaomi hub have to be in the same wifi network?

Same network is sufficient. For most users: if your raspberry is connected to the same router as the gateway it will work.

Nice. Thank you for the information.