- Platform information:
- Hardware: CPU: armv7l / ram: 1gb / sd card: 8gb
- OS: Linux 3.10.107-11; Ubuntu 18.04.1 LTS bionic
- Java Runtime Environment: OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.18.04.1-b13)
- openHAB version: OpenHab 2.3.0 (tested on 2.4.0M4)
Hello,
i’ve problem with connection to my Xiaomi Mi Gateway (Original Xiaomi Mijia Upgrade Version Smart Home). I’ve followed steps in documentation (https://www.openhab.org/addons/bindings/mihome/#setup). I’ve enabled ‘wireless communication protocol’ and save password to gateway using Mi Home Android App (and also i’ve confirmed it using “ok” button). I’ve installed mihome binding through paperUI in my openhab server.
I’ve enabled trace logs in openhab and this is all i’ve got there:
[...]
2018-10-04 02:08:09.444 [DEBUG] [g.mihome.handler.XiaomiBridgeHandler] - Having 1 Item Discovery listeners
2018-10-04 02:08:09.449 [DEBUG] [org.openhab.binding.mihome ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={service.id=301, service.bundleid=221, service.scope=singleton} - org.openhab.binding.mihome
2018-10-04 02:08:09.459 [DEBUG] [org.openhab.binding.mihome ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.core.status.ConfigStatusProvider}={service.id=302, service.bundleid=221, service.scope=singleton} - org.openhab.binding.mihome
2018-10-04 02:08:09.505 [DEBUG] [g.mihome.handler.XiaomiBridgeHandler] - Init socket on Port: 9898
2018-10-04 02:08:09.517 [DEBUG] [e.internal.socket.XiaomiBridgeSocket] - Setup socket
2018-10-04 02:08:09.520 [DEBUG] [e.internal.socket.XiaomiBridgeSocket] - Initialized socket to null:-1 on 0.0.0.0/0.0.0.0:9898
2018-10-04 02:08:09.525 [DEBUG] [.mihome.internal.socket.XiaomiSocket] - There are 1 open sockets: {9898=java.net.MulticastSocket@dd837}
2018-10-04 02:08:09.525 [TRACE] [.mihome.internal.socket.XiaomiSocket] - Staring reveicer thread for socket on port 9898
2018-10-04 02:08:09.529 [TRACE] [.mihome.internal.socket.XiaomiSocket] - Thread Thread[Thread-39,5,main] waiting for data on port 9898
2018-10-04 02:08:09.529 [TRACE] [.mihome.internal.socket.XiaomiSocket] - Adding socket listener org.openhab.binding.mihome.handler.XiaomiBridgeHandler@65816f
2018-10-04 02:08:10.164 [WARN ] [e.jetty.util.thread.ThreadPoolBudget] - Low configured threads: (max=8 - required=1)=7 < warnAt=8 for QueuedThreadPool[ServletModel-21]@1cddca7{STARTING,8<=0<=8,i=0,q=0}[ReservedThreadExecutor@17d35ec{s=0/1,p=0}]
2018-10-04 02:08:10.537 [DEBUG] [g.mihome.handler.XiaomiBridgeHandler] - Triggered discovery
2018-10-04 02:08:10.541 [DEBUG] [g.mihome.handler.XiaomiBridgeHandler] - Send to bridge mihome:bridge:04FCFFFF: {"cmd": "get_id_list"}
2018-10-04 02:08:10.544 [TRACE] [.mihome.internal.socket.XiaomiSocket] - Sending message: {"cmd": "get_id_list"} to /192.x.x.x:9898
[...]
And thats all… there is no response…
My openhab server and xiaomi mi gateway are in the same network, i’ve disabled all firewalls (switch to ACCEPT on all policies in iptables). No matter if i turn on ‘wireless communication protocol’ or not this is my nmap scanning result:
# nmap -sU -p 5353,54321,9898 openhab-server
Starting Nmap 7.60 ( https://nmap.org ) at 2018-10-04 07:15 CEST
Nmap scan report for 192.x.x.x
Host is up (0.059s latency).
PORT STATE SERVICE
5353/udp open|filtered zeroconf
9898/udp closed monkeycom
54321/udp open|filtered bo2k
MAC Address: 78:11:00:00:00:00 (Xiaomi Electronics,co.)
Nmap done: 1 IP address (1 host up) scanned in 2.60 seconds
All other ports are closed.
I’ve got same results on openhab 2.3 and 2.4.0M4 version. I can’t open the 9898 port on xiaomi gateway. I’ve started tcpdump on my wifi-router and i’ve discovered that android mi home app doesn’t use this port at all. All communication is through udp port 54321.
When i’m tring to use “autodiscovery” function in paperUI i’ve got only “Xiaomi Mi IO Device 04FC____ (8364____) lumi-gateway-v3_miio8364____” which is correct but this message came from miio add-on (which is used for my xiaomi air purifier) not for mihome add-on. Miio doesn’t support Xiaomi Gateway and only can display if it’s turn on or off. It discovers it as miio:unsupported:04FC____. I’ve tried to completly remove “miio” addon and this didn’t help.
This is from “about tab” from my Xiaomi Mi Gateway downloaded by Android app:
Version code:201
网关ID:8364____
Zigbee通道:15
网关信息:
{"life":19371,"cfg_time":0,"token":"3___________759_______6_______07","mac":"78:11:__:__:__:__","fw_ver":"1.4.1_157","hw_ver":"MW300","uid":17592_____,"model":"lumi.gateway.v3","mcu_fw_ver":"0143","wifi_fw_ver":"SD878x-14.76.36.p84-702.1.0-WM","ap":{"rssi":-69,"ssid":"______________","bssid":"_________________"},"netif":{"localIp":"192.____.___","mask":"255.255.255.0","gw":"192.__.__.___","gw_mac":"__:__:__:__:__:__"},"mmfree":170224,"ot":"otu","otu_stat":[259,230,304,22,281,9040],"ott_stat":[0,0,0,0]}
In the end i would like to write that gateway works fine using android app and connects to 3 sensor without any problems. Why I my gateway doesn’t respond? What am I doing wrong? Do I have not supported device or too new firmware? How can i downgrade it?
Other config files:
gateway.items
Bridge mihome:bridge:04FC____ "Xiaomi Gateway" [ serialNumber="8364____", ipAddress="192.x.x.x", port=9898, key="____________", pollingInterval=600 ] {
Things:
gateway 7811dc______ "Xiaomi Mi Smart Home Gateway" [itemId="7811dc______"]
}
gateway.items
Switch Gateway_AddDevice { channel="mihome:gateway:7811dcf79144:joinPermission" }
Switch Gateway_LightSwitch <light> { channel="mihome:gateway:7811dcf79144:brightness" }
Dimmer Gateway_Brightness <dimmablelight> { channel="mihome:gateway:7811dcf79144:brightness" }
gateway.sitemap
sitemap xiaomi_test label="Testing Xiaomi" {
Frame label="Gateway" {
Switch item=Gateway_AddDevice label="Add device"
Switch item=Gateway_LightSwitch label="Turn on"
}
}