[OBSOLETE] Mi Connector (Xiaomi and Yeelight)

I have no idea well
Set a enable on ‘Sensor Status Logging’ on web settings.
And then see if the logs come up in a docker container.
(or log file.)

like this.
2019-08-25 10:59:51 info: Notify >> ID(158d000200000):type(lumi.motion.aq2) state={“key”:“motion”,“value”:true} >> [true]

if you don’t see, it’s a gateway issue.

Ok, so now that’s all fine. But now it says that there is no supported DTH. Even though I’m connected to your branch and updated it now to the latest version in Smartthings IDE. Have you made a new DTH for the roborock.s6?

Update a smartapp again.
I updated it a mins ago.

Hi there! Can a have some help connecting Ir remote (chuangmi.remote.v2). I’m doing it using DB analyser. My device is there but I can’t select it. And what does this marks means in supported device list on GitHub page? X - not tested? O - works? triangle -??
Running on Synology with latest image. Auto search doesn’t work :frowning:

a. DB Analyzer
When the device is already registered on mi connector, it can’t be selected.

b. Dashboard
X means that device is not registered to smartthings on dashbard.

Thank you for your help with this.

I’ve deleted all devices from the mi gateway, removed docker and containers and then rebooted PI. Re-installed carefully as per your Github instructions and then re-added devices.

mi-connector logs can see the gateway and ST app can control the sounds and lighting, devices are added and appear in ST app. Only data is added the first time and then doesn’t update.

I have dropped docker mi-connector-arm logs below if they help. Is there any clue that the database mi_connector only contains data for the mi gateway ?

I would really appreciate your help in getting this running as it is a fantastic DTH for ST. :slight_smile:

Is there anywhere else that I could look for logs or clues to help you with this issue or do I have an incompatible mi gateway ?

mi-connector docker logs
mi-connector@0.0.4 start /usr/src/app

node ./bin/www
2019-08-28 07:07:28 info: WebSocket init
2019-08-28 07:07:30 info: Initiallize Ping Processor
2019-08-28 07:07:31 info: ********************************
2019-08-28 07:07:31 info: Mi Connector Version: 0.0.4.16
2019-08-28 07:07:31 info: ********************************
2019-08-28 07:07:31 info: {“st”:{“app_url”:“https://graph-eu01-euwest1.api.smartthings.com:443/api/smartapps/installations/“,“app_id”:”****APP-ID****“,“access_token”:”****ACCESS_TOKEN****“},“connector”:{“port”:30000,“websocketPort”:30001,“address”:“192.168.1.13”},“xiaomi”:{“find_limit_time”:“30000”,“motion_reset_time”:“4900”,“find_mode”:“auto”,“polling_time”:“5000”,“network”:”“},“devices”:{“list”:[{“ip”:“192.168.1.38”,“token”:”****TOKEN****“}]},“db”:{“host”:“localhost”,“port”:“33006”,“password”:“password1234”},“graph”:{“height”:“40”},“log”:{“enable”:true},“ble”:{“enable”:false,“flora”:{“pollingTime”:60},“temperature”:{“pollingTime”:60}},“ir”:{},“ping”:{“list”:[]},“user”:{“name”:“admin”,“password”:“12345”},“token”:{“value”:”****TOKEN****","enable”:false}}
2019-08-28 07:07:31 info: DB Config >> {“host”:“localhost”,“port”:“33006”,“user”:“root”,“password”:“password1234”,“database”:“mi_connector”}
2019-08-28 07:07:31 info: ----------------------------------
2019-08-28 07:07:31 info: Initialize >> Auto Detect Device!
2019-08-28 07:07:31 info: ----------------------------------
2019-08-28 07:07:31 info: Init ESP32 Bridge.
2019-08-28 07:07:31 info: Try to connect DB…
2019-08-28 07:07:31 info: DB is connected
2019-08-28 07:07:31 info: Error: Could not connect to device, token needs to be specified[192.168.1.38] id=259200909
2019-08-28 07:07:31 warn: Finded >> But Mi-Connector can’t get token from this device!!! id(259200909)
2019-08-28 07:07:36 info: Initialize Wi-Fi Device >> Ip(192.168.1.38), Token(TOKEN), Type(unknown)
2019-08-28 07:07:36 info: Network Multicast JOIN >> 192.168.1.13
2019-08-28 07:07:37 info: Initialize Wi-Fi Device >> Ip(192.168.1.38), Token(TOKEN), Type(lumi.gateway.v3)
2019-08-28 07:07:42 info: Initialize Zigbee Device >> Parent-Gateway(192.168.1.38), Id(158d00020ab123), Type(lumi.sensor_ht)
2019-08-28 07:07:42 info: Initialize Zigbee Device >> Parent-Gateway(192.168.1.38), Id(158d00020ca3563), Type(lumi.sensor_ht)
2019-08-28 07:07:42 info: Initialize Zigbee Device >> Parent-Gateway(192.168.1.38), Id(158d00020ec3752), Type(lumi.sensor_ht)
2019-08-28 07:07:42 info: Initialize Zigbee Device >> Parent-Gateway(192.168.1.38), Id(158d0001af7609), Type(lumi.motion.aq2)
2019-08-28 07:07:42 info: Initialize Zigbee Device >> Parent-Gateway(192.168.1.38), Id(158d0001a3b426), Type(lumi.motion)
2019-08-28 07:07:42 info: Child count of gateway >> 6 [192.168.1.38]
2019-08-28 07:08:01 error: (node:28) UnhandledPromiseRejectionWarning: Error: Call to device timed out
at Timeout.retry [as _onTimeout] (/usr/src/app/node_modules/miio/lib/network.js:493:23)
at ontimeout (timers.js:466:11)
at tryOnTimeout (timers.js:304:5)
at Timer.listOnTimeout (timers.js:267:5)
2019-08-28 07:08:01 error: (node:28) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
2019-08-28 07:08:01 error: (node:28) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
2019-08-28 07:08:02 info: Notify >> ID(259200909):type(lumi.gateway.v3) state={“key”:“illuminance”,“value”:1210} >> [1210]
2019-08-28 07:08:27 info: Notify >> ID(259200909):type(lumi.gateway.v3) state={“key”:“illuminance”,“value”:1187} >> [1187]
2019-08-28 07:08:52 info: Notify >> ID(259200909):type(lumi.gateway.v3) state={“key”:“illuminance”,“value”:1166} >> [1166]
2019-08-28 07:09:17 info: Notify >> ID(259200909):type(lumi.gateway.v3) state={“key”:“illuminance”,“value”:1139} >> [1139]
2019-08-28 07:09:52 info: Notify >> ID(259200909):type(lumi.gateway.v3) state={“key”:“illuminance”,“value”:1115} >> [1115]
2019-08-28 07:10:17 info: Notify >> ID(259200909):type(lumi.gateway.v3) state={“key”:“illuminance”,“value”:1140} >> [1140]
2019-08-28 07:10:22 info: Notify >> ID(259200909):type(lumi.gateway.v3) state={“key”:“illuminance”,“value”:1202} >> [1202]
2019-08-28 07:10:27 info: Notify >> ID(259200909):type(lumi.gateway.v3) state={“key”:“illuminance”,“value”:1239} >> [1239]

………… TRUNCATED …

2019-08-29 05:36:59 info: Notify >> ID(259200909):type(lumi.gateway.v3) state={“key”:“illuminance”,“value”:1256} >> [1256]
2019-08-29 05:37:24 info: Notify >> ID(259200909):type(lumi.gateway.v3) state={“key”:“illuminance”,“value”:1280} >> [1280]
2019-08-29 05:24:49 info: Child count of gateway >> 6 [192.168.1.38]
2019-08-29 05:26:57 info: Requested to control by ST >> [lumi.gateway.v3] >> {“id”:“259200909”,“cmd”:“power”,“data”:“on”}
2019-08-29 05:26:57 info: Requested to control by ST >> [lumi.gateway.v3] >> {“id”:“259200909”,“cmd”:“color”,“data”:“#f44259”}
2019-08-29 05:26:57 info: Notify >> ID(259200909):type(lumi.gateway.v3) state={“key”:“color”,“value”:{“values”:[244,66,89],“model”:“rgb”}} >> [244,66,89]
2019-08-29 05:26:57 info: Requested to control by ST >> [lumi.gateway.v3] >> {“id”:“259200909”,“cmd”:“brightness”,“data”:100}
2019-08-29 05:26:57 info: Notify >> ID(259200909):type(lumi.gateway.v3) state={“key”:“brightness”,“value”:100} >> [100]
2019-08-29 05:26:57 info: Notify >> ID(259200909):type(lumi.gateway.v3) state={“key”:“power”,“value”:true} >> [true]
2019-08-29 05:27:00 info: Requested to control by ST >> [lumi.gateway.v3] >> {“id”:“259200909”,“cmd”:“power”,“data”:“off”}
2019-08-29 05:27:00 info: Requested to control by ST >> [lumi.gateway.v3] >> {“id”:“259200909”,“cmd”:“stopMusic”}
2019-08-29 05:27:00 info: Notify >> ID(259200909):type(lumi.gateway.v3) state={“key”:“brightness”,“value”:0} >> [0]
2019-08-29 05:27:00 info: Notify >> ID(259200909):type(lumi.gateway.v3) state={“key”:“power”,“value”:false} >> [false]

All devices are showing on Xiaomi home app;

I have some more errors too :frowning:
lumi.ctrl_neutral1 and lumi.ctrl_neutral2 can not be added to ST
From history:

TypeError: Cannot convert undefined or null to object
at Function.keys ()
at /usr/src/app/routes/devices.js:61:29
at Object.module.exports.getDeviceTotalState (/usr/src/app/miio/miio.js:1443:5)
at /usr/src/app/routes/devices.js:59:10
at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
at next (/usr/src/app/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/usr/src/app/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
at /usr/src/app/node_modules/express/lib/router/index.js:281:22
at param (/usr/src/app/node_modules/express/lib/router/index.js:354:14)
at param (/usr/src/app/node_modules/express/lib/router/index.js:365:14)
at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:410:3)
at next (/usr/src/app/node_modules/express/lib/router/index.js:275:10)
at Function.handle (/usr/src/app/node_modules/express/lib/router/index.js:174:3)
at router (/usr/src/app/node_modules/express/lib/router/index.js:47:12)
at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)

Also lumi.motion.aq2 does not detect any motion.
mijia.camera.v1 is in " Not Initialized Xiaomi Devices"
Ir remote learned commands looks like this “nMwmkwlk0mkymEsm05mEsmM2mABCzWYgDsAe4C/gL+Au4A/gDsCxIGHgD+AP4A/goeFl4UXg4+Bh4CHgMeCFcwgA” (I don’t know if it looks right) and doesn’t work for my air condition.

And in the end I’m planing to use Google Assistant to control my home. The only error I found so far is that Roborock S50 is shown as light source. Switching it on it starts the cleaning. When it was connected directly through Xiaomi it was working fine, but I’d like to have it with ST.

It looks like a gateway issue.
Cuz there are no sensor update.

Ok, I’ve managed to add switches to ST, using “add to ST” tab. But it looks like ST doesn’t update them right. Even though, I can correctly control them through Google Assistant.

Ive been having an error when tring to pull the mi-connector-arm file.

Im doing it on a Raspberry Pi using butcher.

Any ideas?

Is this a firmware issue where I need to downgrade the gateway or do I have a faulty Xiaomi gateway and purchase another ? I have 17 sensors that I would like to integrate with ST so I am happy to continue to try and work this out.

Thank you for your help.

If you buy a new, you must enable a lan protocol on app first before firmware updaing.

Or open a gateway and then connect pin with uart.
Maybe you can enable lan protocol.

I don’t know how to do this well. See a link.

Apologies but I don’t understand, the gateway is on the lan and itself communicating with ST but not the zig bee connected sensors. Are you talking about the switch that needs activating after tapping help area 10 times On Xiaomi home app ?

Check your port of gateway is open or not…

Would you plz read a link about that issue?

I think this is not a mi connector issue.

sudo nmap -sU gatewayip -p 9898, 4321

This is normal case.
image

This is not working.
image

Hi Chals!, sorry to bother you, could you try add the speaker functionality, Temperature and Humidity Sensor information on the Hub V2 (Xiaomi Gateway2)?, I’ll like to use it as an alert notifications and temp sensor on WebCore.
Regards!

Have a look DTH.

sirenByID <-- command

These are id value.
Police Car#1 = 0
Police Car#2= 1

Thinker= 29

I’ve found it on Xiaomi Gateway but not on Xiaomi Gateway2, could be?
Regards

Any chance for porting this docker to windows based machines?
I would really like to run it on windows based machine…

Chals,

Many thanks for all your help in tracking this down.

It was me to blame with accepting the Xiaomi Home app the option to update the firmware on my gateway before switching on the developer mode.

I can see that you’ve updated the instructions on GitHub to warn other users of this fact with the V3 gateway, thank you;

If Port is closed xiaomi gateway doesn’t report zigbee status to mi connector anymore.
You have to buy new one and enable a lan protocol first, don’t firmware update first!!!
Or have a look this link

I have now done the psm-set network.open_pf 3 command and it is all working perfectly.

Thank you for your support. Cup of coffee on the way !!

Hi @fison67 Chals, I’ve succesfull add then

and “Mi Connector” has added as Xiaomi Light DTH.
I’m wonder if the Xiaomi Philips Bedside Lamp DTH would be the best choice?
Regards
P.