SmartThings Community

Mi Connector (Xiaomi and Yeelight)

Has any one else rebooted their Mi connector server and lost connection to everything ?

Im struggling to see what i have done wrong… I have tried it on both Centos and Ubuntu.

Think i maybe have sorted this . Now i have the correct Token ( didnt realised it changed when reset) i have now changed the mode on the server settings from manual to auto . Seems it now reconnects when i reboot the mi connector server.

My issue now is with the App URL,ID etc in the test2 image. I seen a previous message above about them not auto filling using the test2 image. Seems this is correct… :frowning:

I found the connector.log. Looks like this is the error I’m getting.

error: Interval >> Error SyntaxError: Unexpected token u in JSON at position 0

Hi Fison67,

I have the following devices. Which is mi_connector version that I should use? (I am using 0.0.3.12 now, should be test2 or 3.) Thanks for your advise.

Xiaomi Power Socket ( chuangmi.plug.v1, chuangmi.plug.v2, chuangmi.plug.v3, chuangmi.plug.m1 )
This chuangmi.plug.m3 is not supported now

Xiaomi Flora ( ble.flora ) [Only Beta Version]
Xiaomi Temperature & Humidity Sensor ( ble.mitemperature ) [Only Beta Version]

Yeelight Color ( yeelink.light.color1, yeelink.light.color2, yeelink.light.strip1)

Thanks
SK

Hi,

Tested to install below. All doesn’t work with “This chuangmi.plug.m3 is not supported now”. Please help.

Model is zncz04cm.

  • test - Last update: 14 days ago
  • test2 - Last update: 2 months ago
  • test3 - Last update: a month ago
  • latest - Last update: 6 months ago

Not yet supported.
Is it a model that can check the amount of electricity?
Let me know that url to buy it

It looks like a broken file(config.json).
Remove a config.json and Restart a docker.
config.json file will be made.

1 Like

It cannot check the amonut of electricity. (Wifi version).

【新品小米米家智能插座WiFi版基础版增强版智能插线板手机远程控制】https://m.tb.cn/h.3EANgZU?sm=849d2a 点击链接,再选择浏览器咑閞;或復·制这段描述¥ihvVbFdRPrW¥后到👉淘♂寳♀👈

Update a smartapp & Re Download docker image test3.

Hi @fison67 I tried your guide notes written in October to get Bluetooth devices to work. But although both the ble.flora and the ble.mitemperature are shown on the dashboard only the flower sensor shows up on smartthings and it doesn’t show any data. Do you know what I’m doing wrong? I’m on the test version.

Many thanks. All work.

I can’t know without log.

Hi fison67,

I would like to know that you are prefer to use static IP or dynamic IP when using Mi Connector?

SK

Use a static ip

Here’s my log. Thanks
2019-02-28 10:04:50 [Mi-Connector] info: WebSocket init
2019-02-28 10:04:53 [Mi-Connector] info: Initiallize Ping Processor
2019-02-28 10:04:53 [Mi-Connector] info: Mi Connector Version >> 0.0.3.12
2019-02-28 10:04:54 [Mi-Connector] info: {“st”:{“app_url”:"",“app_id”:"",“access_token”:""},“connector”:{“port”:30000,“websocketPort”:30001},“xiaomi”:{“find_limit_time”:“30000”,“motion_reset_time”:“4900”,“find_mode”:“auto”,“polling_time”:5000},“devices”:{“list”:},“db”:{“host”:“localhost”,“port”:33006,“password”:“password”}}
2019-02-28 10:04:54 [Mi-Connector] info: Save Config >> {“st”:{“app_url”:"",“app_id”:"",“access_token”:""},“connector”:{“port”:30000,“websocketPort”:30001,“address”:""},“xiaomi”:{“find_limit_time”:“30000”,“motion_reset_time”:“4900”,“find_mode”:“auto”,“polling_time”:5000},“devices”:{“list”:},“db”:{“host”:“localhost”,“port”:33006,“password”:“password”},“graph”:{“height”:40},“log”:{“enable”:true},“ble”:{“enable”:false,“flora”:{“pollingTime”:60},“temperature”:{“pollingTime”:60}},“ir”:{},“ping”:{“list”:}}
2019-02-28 10:04:54 [Mi-Connector] info: DB Config >> {“host”:“localhost”,“port”:33006,“user”:“root”,“password”:“password”,“database”:“mi_connector”}
2019-02-28 10:04:54 [Mi-Connector] info: ----------------------------------
2019-02-28 10:04:54 [Mi-Connector] info: Initialize >> Auto Detect Device!
2019-02-28 10:04:54 [Mi-Connector] info: ----------------------------------
2019-02-28 10:04:54 [Mi-Connector] error: DB is disconnected >> Error: Connection lost: The server closed the connection.
2019-02-28 10:04:54 [Mi-Connector] warn: Finded >> But Mi-Connector can’t get token from this device!!! id(94269196)
2019-02-28 10:04:54 [Mi-Connector] warn: Finded >> But Mi-Connector can’t get token from this device!!! id(131300877)
2019-02-28 10:07:28 [Mi-Connector] info: Save Config >> {“st”:{“app_url”:"",“app_id”:"",“access_token”:""},“connector”:{“port”:30000,“websocketPort”:30001,“address”:""},“xiaomi”:{“find_limit_time”:“30000”,“motion_reset_time”:“4900”,“find_mode”:“auto”,“polling_time”:5000},“devices”:{“list”:},“db”:{“host”:“localhost”,“port”:33006,“password”:“password”},“graph”:{“height”:40},“log”:{“enable”:true},“ble”:{“enable”:true,“flora”:{“pollingTime”:“60”},“temperature”:{“pollingTime”:“60”}},“ir”:{},“ping”:{“list”:}}
2019-02-28 10:07:54 [Mi-Connector] info: Save Config >> {“st”:{“app_url”:“https://graph-eu01-euwest1.api.smartthings.com:443/api/smartapps/installations/",“app_id”:“97d962b6-06f8-43cd-889f-2a2ceae4cd44”,“access_token”:“6d2c69fb-3ebb-4de1-8aa0-eddb35496e38”},“connector”:{“port”:30000,“websocketPort”:30001,“address”:""},“xiaomi”:{“find_limit_time”:“30000”,“motion_reset_time”:“4900”,“find_mode”:“auto”,“polling_time”:5000},“devices”:{“list”:[]},“db”:{“host”:“localhost”,“port”:33006,“password”:“password”},“graph”:{“height”:40},“log”:{“enable”:true},“ble”:{“enable”:true,“flora”:{“pollingTime”:“60”},“temperature”:{“pollingTime”:“60”}},“ir”:{},“ping”:{"list”:}}
2019-02-28 10:08:10 [Mi-Connector] info: Save Config >> {“st”:{“app_url”:“https://graph-eu01-euwest1.api.smartthings.com:443/api/smartapps/installations/",“app_id”:“97d962b6-06f8-43cd-889f-2a2ceae4cd44”,“access_token”:“6d2c69fb-3ebb-4de1-8aa0-eddb35496e38”},“connector”:{“port”:30000,“websocketPort”:30001,“address”:""},“xiaomi”:{“find_limit_time”:“30000”,“motion_reset_time”:“4900”,“find_mode”:“auto”,“polling_time”:5000},“devices”:{“list”:[]},“db”:{“host”:“localhost”,“port”:“33006”,“password”:“password”},“graph”:{“height”:40},“log”:{“enable”:true},“ble”:{“enable”:true,“flora”:{“pollingTime”:“60”},“temperature”:{“pollingTime”:“60”}},“ir”:{},“ping”:{"list”:}}
2019-02-28 10:08:10 [Mi-Connector] info: DB Config >> {“host”:“localhost”,“port”:“33006”,“user”:“root”,“password”:“password”,“database”:“mi_connector”}
2019-02-28 10:08:10 [Mi-Connector] error: DB is disconnected
2019-02-28 10:08:22 [Mi-Connector] warn: Find Device Manually but nothing token!!! >> 131300877
2019-02-28 10:08:22 [Mi-Connector] warn: Find Device Manually but nothing token!!! >> 94269196
2019-02-28 10:09:32 [Mi-Connector] info: Save Config >> {“st”:{“app_url”:“https://graph-eu01-euwest1.api.smartthings.com:443/api/smartapps/installations/",“app_id”:“97d962b6-06f8-43cd-889f-2a2ceae4cd44”,“access_token”:“6d2c69fb-3ebb-4de1-8aa0-eddb35496e38”},“connector”:{“port”:30000,“websocketPort”:30001,“address”:""},“xiaomi”:{“find_limit_time”:“30000”,“motion_reset_time”:“4900”,“find_mode”:“auto”,“polling_time”:5000},“devices”:{“list”:[{“ip”:“192.168.0.22”,“token”:“567722e908c5c6b86578f64d15808471”}]},“db”:{“host”:“localhost”,“port”:“33006”,“password”:“password”},“graph”:{“height”:40},“log”:{“enable”:true},“ble”:{“enable”:true,“flora”:{“pollingTime”:“60”},“temperature”:{“pollingTime”:“60”}},“ir”:{},“ping”:{"list”:}}
2019-02-28 10:09:32 [Mi-Connector] info: Initialize Wi-Fi Device >> Ip(192.168.0.22), Token(567722e908c5c6b86578f64d15808471), Type(unknown)
2019-02-28 10:09:32 [Mi-Connector] info: Network Multicast JOIN >> 192.168.0.24
2019-02-28 10:09:32 [Mi-Connector] info: Network Multicast JOIN >> 172.17.0.1
2019-02-28 10:09:32 [Mi-Connector] info: Network Multicast JOIN >> 169.254.13.13
2019-02-28 10:09:32 [Mi-Connector] error: Network Multicast JOIN Error >> Error: addMembership EADDRINUSE
2019-02-28 10:09:32 [Mi-Connector] info: Network Multicast JOIN >> 169.254.157.188
2019-02-28 10:09:32 [Mi-Connector] info: Initialize Wi-Fi Device >> Ip(192.168.0.22), Token(567722e908c5c6b86578f64d15808471), Type(lumi.gateway.v3)
2019-02-28 10:09:37 [Mi-Connector] info: Initialize Zigbee Device >> Parent-Gateway(192.168.0.22), Id(158d0002580ed0), Type(lumi.magnet.aq2)
2019-02-28 10:09:37 [Mi-Connector] info: Initialize Zigbee Device >> Parent-Gateway(192.168.0.22), Id(158d00027ccf9e), Type(lumi.motion)
2019-02-28 10:09:37 [Mi-Connector] info: Child count of gateway >> 3 [192.168.0.22]
2019-02-28 10:09:47 [Mi-Connector] info: Child count of gateway >> 3 [192.168.0.22]
2019-02-28 10:10:09 [Mi-Connector] info: Notify >> ID(158d00027ccf9e):type(lumi.motion) state={“key”:“motion”,“value”:true} >> [true]

2019-02-28 10:10:14 [Mi-Connector] info: Notify >> ID(158d00027ccf9e):type(lumi.motion) state={“key”:“motion”,“value”:false} >> [false]

2019-02-28 10:11:24 [Mi-Connector] info: WebSocket init
2019-02-28 10:11:27 [Mi-Connector] info: Initiallize Ping Processor
2019-02-28 10:11:27 [Mi-Connector] info: Mi Connector Version >> 0.0.3.12
2019-02-28 10:11:27 [Mi-Connector] info: {“st”:{“app_url”:“https://graph-eu01-euwest1.api.smartthings.com:443/api/smartapps/installations/",“app_id”:“97d962b6-06f8-43cd-889f-2a2ceae4cd44”,“access_token”:“6d2c69fb-3ebb-4de1-8aa0-eddb35496e38”},“connector”:{“port”:30000,“websocketPort”:30001,“address”:""},“xiaomi”:{“find_limit_time”:“30000”,“motion_reset_time”:“4900”,“find_mode”:“auto”,“polling_time”:5000},“devices”:{“list”:[{“ip”:“192.168.0.22”,“token”:“567722e908c5c6b86578f64d15808471”}]},“db”:{“host”:“localhost”,“port”:“33006”,“password”:“password”},“graph”:{“height”:40},“log”:{“enable”:true},“ble”:{“enable”:true,“flora”:{“pollingTime”:“60”},“temperature”:{“pollingTime”:“60”}},“ir”:{},“ping”:{"list”:}}
2019-02-28 10:11:27 [Mi-Connector] info: Save Config >> {“st”:{“app_url”:“https://graph-eu01-euwest1.api.smartthings.com:443/api/smartapps/installations/",“app_id”:“97d962b6-06f8-43cd-889f-2a2ceae4cd44”,“access_token”:“6d2c69fb-3ebb-4de1-8aa0-eddb35496e38”},“connector”:{“port”:30000,“websocketPort”:30001,“address”:""},“xiaomi”:{“find_limit_time”:“30000”,“motion_reset_time”:“4900”,“find_mode”:“auto”,“polling_time”:5000},“devices”:{“list”:[{“ip”:“192.168.0.22”,“token”:“567722e908c5c6b86578f64d15808471”}]},“db”:{“host”:“localhost”,“port”:“33006”,“password”:“password”},“graph”:{“height”:40},“log”:{“enable”:true},“ble”:{“enable”:true,“flora”:{“pollingTime”:“60”},“temperature”:{“pollingTime”:“60”}},“ir”:{},“ping”:{"list”:}}
2019-02-28 10:11:27 [Mi-Connector] info: DB Config >> {“host”:“localhost”,“port”:“33006”,“user”:“root”,“password”:“password”,“database”:“mi_connector”}
2019-02-28 10:11:27 [Mi-Connector] info: ----------------------------------
2019-02-28 10:11:27 [Mi-Connector] info: Initialize >> Auto Detect Device!
2019-02-28 10:11:27 [Mi-Connector] info: ----------------------------------
2019-02-28 10:11:27 [Mi-Connector] info: Bluetooth :: initialize…
2019-02-28 10:11:27 [Mi-Connector] info: Bluetooth - Mi Flora scan
2019-02-28 10:11:27 [Mi-Connector] warn: Finded >> But Mi-Connector can’t get token from this device!!! id(94269196)
2019-02-28 10:11:27 [Mi-Connector] error: DB is disconnected >> Error: Access denied for user ‘root’@‘172.17.0.1’ (using password: YES)
2019-02-28 10:11:27 [Mi-Connector] warn: Finded >> But Mi-Connector can’t get token from this device!!! id(131300877)
2019-02-28 10:11:29 [Mi-Connector] info: Finded >> Bluetooth:ble.flora id=c4:7c:8d:66:51:e6
2019-02-28 10:11:29 [Mi-Connector] info: Bluetooth - Mi Flora scan
2019-02-28 10:11:32 [Mi-Connector] info: Initialize Wi-Fi Device >> Ip(192.168.0.22), Token(567722e908c5c6b86578f64d15808471), Type(unknown)
2019-02-28 10:11:34 [Mi-Connector] info: Network Multicast JOIN >> 192.168.0.24
2019-02-28 10:11:34 [Mi-Connector] info: Network Multicast JOIN >> 172.17.0.1
2019-02-28 10:11:34 [Mi-Connector] info: Network Multicast JOIN >> 169.254.137.122
2019-02-28 10:11:34 [Mi-Connector] error: Network Multicast JOIN Error >> Error: addMembership EADDRINUSE
2019-02-28 10:11:34 [Mi-Connector] info: Network Multicast JOIN >> 169.254.93.146
2019-02-28 10:11:34 [Mi-Connector] info: Initialize Wi-Fi Device >> Ip(192.168.0.22), Token(567722e908c5c6b86578f64d15808471), Type(lumi.gateway.v3)
2019-02-28 10:11:39 [Mi-Connector] info: Bluetooth - Mi Temperature scan
2019-02-28 10:11:39 [Mi-Connector] info: Initialize Zigbee Device >> Parent-Gateway(192.168.0.22), Id(158d0002580ed0), Type(lumi.magnet.aq2)
2019-02-28 10:11:39 [Mi-Connector] info: Initialize Zigbee Device >> Parent-Gateway(192.168.0.22), Id(158d00027ccf9e), Type(lumi.motion)
2019-02-28 10:11:39 [Mi-Connector] info: Child count of gateway >> 3 [192.168.0.22]
2019-02-28 10:11:49 [Mi-Connector] info: Finded >> Bluetooth:ble.mitemperature id=4c:65:a8:dd:0d:53
2019-02-28 10:11:49 [Mi-Connector] info: Bluetooth - Mi Temperature scan
2019-02-28 10:11:49 [Mi-Connector] info: Child count of gateway >> 3 [192.168.0.22]
2019-02-28 10:11:59 [Mi-Connector] info: Bluetooth - Flora Polling time >> 60 mins

How to find out the APP URL and the APP ID within MI Connector’s setting page for Smartthings Settings?

means that device is registered to smartthings.
[ x ] means that it’s not registered to smartthings.

Do you install a ’ xiaomi-bluetooth-weather’?

And you can set polling time on setup page of web.

Press the save button on mi connector smartapp.
The value is then automatically entered into the mi connector.

Or you can see that config menu on smartapp.

Hello, This is my first post here and first i would like to thank fison67 for a great job that you have done. I have followed all the steps and managed to get everything working. the mi connector with lumi.gateway.v3 and smarthings. I have noticed an issue after i got a lumi.ctrl.neutral1 wall switch.
occasionally let say once a day when i try to control the light switch via smartthings nothing happens, I checked the mi connector log and i can see the request from ST and yet nothing happens. The strange part is that all the other sensors that send the info to ST are still working for example i have door sensors from xiaomi and when i open or close the sensor i can see it correctly showing in ST. Same thing happens with i try to switch a light on xiaomi gateway via ST. So basically it seems like all request going from ST to Xiaomi dont work. This is very strange sometimes it works sometimes it doesn’t. Just was wondering if anyone else had any similar issues?

Just would like to reply to my own post, after doing a bit of troubleshooting i found out that I had issues with xiaomi hub and not mi connector, Mi connector was and is working flawlessly.