Hi, This is my first post here on this forum and my first steps in setting up openHAB. First of all many thanks for this wonderful project.
I have a xiaomi gateway (v3) and also a temperature & humidity sensor (round). Since three days i am trying to get this to work but with no success. I have searched, read and tried a lot on this forum with no success.
I can see the gateway and the sensor are online (paperUI) but no communication. The temperature gets only updated when I restart openHAB and the gateway is dead. No problem with the app. This were my steps taken:
Install the xiaomi mi smart home binding:
Install xiaomi mi smart home bridge manually with network address and developer key (took me a while to find this out as this is not explained in the bindings docu).
After this the temp sensor popped up in the inbox and I installed from there. all data are showing but never get updated.
I installed the xiaomi mi smart home gateway manually (didn’t show up in the inbox). All functions are showing but dead. Cannot activate anything nor does it show any manipulation from the app e.g. light on.
I am running the latest snapshot build #1060 on a ubuntu 16.04 system.
I would be very grateful if somebody could guide me in the right direction to find out how to make this work.
Thank you very much.
didn’t work. Now everything double and no data as well. I don’t think it’s the items as everything is showing correct in PaperUI, just no updates on the temperature sensor (only after restarting the system) and absolutely no data from the gateway but I can see all functions and things and items (channels) are all good.
BTW, where do you get the ID from for the gateway (I use the mac address from the gateway info in the app)?
I have checked the log files and found this error message:
2017-10-14 12:18:59.499 [ERROR] [ternal.profiles.DefaultMasterProfile] - Exception occurred while calling handler: java.lang.NullPointerException
at org.eclipse.smarthome.core.common.SafeMethodCaller.executeDirectly(SafeMethodCaller.java:220) ~[?:?]
Caused by: java.lang.NullPointerException
at org.openhab.binding.mihome.internal.EncryptionHelper.encrypt(EncryptionHelper.java:69) ~[?:?]
at org.openhab.binding.mihome.internal.EncryptionHelper.encrypt(EncryptionHelper.java:42) ~[?:?]
at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.getEncryptedKey(XiaomiBridgeHandler.java:291) ~[?:?]
at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.createDataJsonString(XiaomiBridgeHandler.java:277) ~[?:?]
at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.writeToBridge(XiaomiBridgeHandler.java:273) ~[?:?]
at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.writeBridgeLightColor(XiaomiActorGatewayHandler.java:188) ~[?:?]
at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.writeBridgeLightColor(XiaomiActorGatewayHandler.java:184) ~[?:?]
at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.execute(XiaomiActorGatewayHandler.java:73) ~[?:?]
at org.openhab.binding.mihome.handler.XiaomiDeviceBaseHandler.handleCommand(XiaomiDeviceBaseHandler.java:104) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.profiles.DefaultMasterProfile$1.call(DefaultMasterProfile.java:54) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.profiles.DefaultMasterProfile$1.call(DefaultMasterProfile.java:1) ~[?:?]
at org.eclipse.smarthome.core.common.SafeMethodCaller.executeDirectly(SafeMethodCaller.java:218) ~[?:?]
… 27 more
Perhaps this might be the cause of the problems I have. Would be really nice if one of the xiaomi binding devs could jump in here.
Thank you Brian for your response - greatly appreciated. I also think it could be a token problem but how can I solve that? I don’t think that i can influence the token in openHAB.
Anyway, I have a bigger problem now as I get error 503: Service unavailable. I have opened another post for that but sadly no response. I think I have to wait until openHAB is really stable.
Yes, I have read the thread (not everything, too long :-). Your print screens looks the same as mine, except I have a different MiHome device ID (of course). I got the ID from the Mi Home app in about, gateway information and from there the “mac” ID. The gateway hasn’t shown up in the inbox so I had to add the gateway manually (thing) and enter the ID. BTW, my gateway is version lumi_gateway.v3.
The gateway has it’s own ip address which I added to the Xiaomi Bridge (thing) but everything is in the same wifi network. I don’t really understand the subnet question.
The gateway definitely doesn’t appear in the inbox. The temperature and humidity sensor does (weard?).
Thanks a lot Sergey for your patience - really appreciated.
I just installed everything from scratch (openHAB) with the same result.
When I install the binding (addons) nothing happens. Only when I also manually add Xiaomi Mi Smart Home Bridge as a thing the temperature sensor shows up in the inbox but no gateway.
I checked the subnet and everything is in the same subnet. port 9898 is open as per netstat but only udp6 but no state, no tcp.
tomorrow, if there is time, I will try to reinstall the gateway and write as I did, but I do not promise, I’m sick, I can not come to work at
write how the port was checked, I will do it at myself, I will show the result
Thank you Sergey. First get healthy again, that’s much more important. Perhaps there is somebody else who knows a bit more about ports than we do. I now belief it’s the port 9898 which causes the problem.
Wish you good recovery.
Thanks a lot olymp for the print screens.
In my case the Xiaomi Gateway (Xiaomi Mi Smart Home Bridge) isn’t being detected. I have to install manually (+ button) and then the Temperature & Humidity Sensor are in the inbox but not the Xiaomi Mi Smart Home Gateway. The temp. & hum. sensor shows all information but never gets updated when temp/hum changes.
I have installed Home Assistant just to check whether I will have same problems. After installing HA the gateway is detected and I just have to add the key, mac, and ip address in the config file. Temperature & Humidity are shown but never updated. Gateway I cannot turn on light.
So the situation is that HA detects the gateway whereas openHAB doesn’t (needs to be manually installed). But the result is In both cases the same: temperature. & humidity is shown but not updated and the gateway isn’t responsive.
Conclusion is that there must be something wrong with the gateway (but app is working fine) or the router.
I read here and in HA forum that a few people were successful with resetting the gateway. I have tried this once with the same result and I don’t wanna do that again as I had great difficulties to get the gateway connected again (app).
Unfortunately my adventure into home automation hasn’t had a good start. I will wait and perhaps there will be a firmware update for the gateway in the near future (has been mentioned in a forum somewhere).
Thanks again for the help - really appreciated.
BTW: testing connection with sudo nmap -sU -p9898 192.168.x.xxx showed everything okay.
Starting Nmap 7.01 ( https://nmap.org ) at 2017-10-20 14:03 JST
Nmap scan report for 192.168.x.xxx
Host is up (0.090s latency).
PORT STATE SERVICE
9898/udp open unknown
MAC Address: xx:xx:xx:xx:xx:xx (Unknown)
Nmap done: 1 IP address (1 host up) scanned in 0.58 seconds
Update: finally I got it working - just before I wanted to give up. It was the firewall (ubuntu). I turned it off and the gateway popped up in the inbox. Now I have created a rule in the firewall and all is good. Firewall and openHAB are living peacefully together now.
Thanks for all the help!
PS. Perhaps somebody could make a hint to check firewall in the installation guide.