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.
Thank you! Firewall has to be disabled for the gateway to appear in the inbox. After that adding a rule to the firewall is enough (see attached print screen). To add the rule go to Report, find port 9898 and highlight it, then press the plus button at the bottom to add a new rule. This is for ubuntu 16.04.
I had my firewalls turned off and assumed this wouldn’t/couldn’t be the issue, but the moment I created a rule for port 9898 incoming and deleted the manually created xiaomi things, the Gateway Bridge showed up through regular thing discovery in the Inbox, followed by my other Xiaomi devices after adding it.
The heartbeat is being logged every 10 sec on the debug/trace logs (set via log:set DEBUG org.openhab.binding.mihome and log:set TRACE org.openhab.binding.mihome under the Karaf console via PuTTY)
Devices can also be controlled, including Xiaomi Plug and Gateway, and interactions by Switch and Door/Window sensor are also being recorded and acted on