Mi Connector (Xiaomi and Yeelight)

Thanks a lot! That worked. For some reason, even though I had OAuth available, clicking Config was giving me a token error. I guess I then assumed the app for HE was broken.

I updated the OAuth and removed the App and re-added and that worked! From there on, I manually entered the Hubitat server info, token and app id and access token and voila, my vacuum became visible in HE. Much appreciated sir!

1 Like

Brilliant news :wink::+1:


Have a couple of issues here and wonder if you can help, I’ve posted here as you dont seem that active on the HE forums :slight_smile:

Is the docker supposed to find my new devices automatically? As mine isnt, I’m having t reboot the docker (004) first.

Also the when adding the no neutral switches, they are added, but they stay “un-greyed” in the UI.

Anything I can check? Your help would be much appreciated :+1:

Trying to add my gateway so I an add my xiaomi devices.

Any ideas what’s happening here.


I was able to add a mi IR remote successfully. I’m running docker in Ubuntu VM. I can see the device in the smarthings app, both old and new, alexa picked it up also. My token and settings are correct but i cannot turn on/off the Air Condition i have it programmed to work. I can turn on/off the AC through the Mi app fine.

I saw that there is a program function on the web MI Connector (Manage IR), do i have to program that somehow before this works? I found some instructions but i am still unclear on what i need to do. Thanks.

I managed to get it working for roborock S5 but then I restarted the linux server where I run miconnector and I can no longer acces miconnector

this is what the miconnector page displays (I access it at X.X.X.X:30000)

TypeError: Cannot read property ‘token’ of undefined
at uniqueTokenEnabled (/usr/src/app/util/csrf.js:159:32)
at csrf (/usr/src/app/util/csrf.js:112:9)
at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/usr/src/app/node_modules/express/lib/router/index.js:317:13)
at /usr/src/app/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:335:12)
at next (/usr/src/app/node_modules/express/lib/router/index.js:275:10)
at cookieParser (/usr/src/app/node_modules/cookie-parser/index.js:71:5)
at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/usr/src/app/node_modules/express/lib/router/index.js:317:13)
at /usr/src/app/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:335:12)
at next (/usr/src/app/node_modules/express/lib/router/index.js:275:10)
at SessionStrategy.strategy.pass (/usr/src/app/node_modules/passport/lib/middleware/authenticate.js:343:9)
at SessionStrategy.authenticate (/usr/src/app/node_modules/passport/lib/strategies/session.js:75:10)
at attempt (/usr/src/app/node_modules/passport/lib/middleware/authenticate.js:366:16)

help is appreciated
thank you

PS I eventually solved this: database password in miconnector was not setup as per github instructions :slightly_smiling_face:

So now it seems to work.

Thank you fison67 for this great resource!

For anyone with similar situation, Mi Connector (Xiaomi and Yeelight) I resolved this myself, by this link https://github.com/jghaanstra/com.xiaomi-miio/blob/master/docs/obtain_token.md and using the non rooted android version, and getting the token of my gateway and manually inputting it on the mi connector.
Up and running now thank you great so far.

Btw you may have to restart the container to allow added device register within the st and mi connector

Hi, trying to add my gateway. Howerver it’s the European veraion. I guess it’s pretty much the same as the “standard one” just with a different name. How can I change the devicehandelers name so it will point to the European gateway instead. The EU one is called: lumi.gateway.mieu01

Or is there any other way to get the Eu gateway to work with mi-connector?

Google Home doesn’t see the controls for the air purifiers correctly.

Fan speed isn’t showing up as dimmer control, and I have no way to change the mode?

Any ideas?

Also, the new SmartThings app doesn’t show all the sensors and control for the device either?

Any way you would be able to Point me to the files hat need to bu updated for the EU dock to work. tried reversed engineering the files but could not get the dock to be added to ST app. no issue adding to Mi connector. But it never shows up in the ST list in mi connector.

Very nice work! Will this also work with the e35?

Fison67, I cant seem to save the hubitat DTH, i get the error
Importing [java.text.DateFormat] is not allowed

The ST dth saves but doesnt show any data

Hello @fison67
I followed all of the instructions (https://github.com/fison67/mi_connector) using a Synology NAS and was successful to install the apps

. The whole purpose of this fantastic solution is to integrate 20 Philips Zhirui Downlight with ST. On loading the Mi Connector Management - I get to see the device but no values for Type & Token. Followed all of the tweaks mentioned in the post but didn’t see anything directly related to Synology NAS 218+.

The DB Settings in the Connector management are:
DB URL - Localhost
DB Port - 33006
DB Password - password1234

I have attached a screenshot of the error that I am seeing. Will really appreciate your assistance and also adding the config.json file.

“st”: {
“app_url”: “https://graph-na04-useast2.api.smartthings.com:443/api/smartapps/installations/”,
“app_id”: “f3c2927a-aced-4c24-9964-8fd1de9fdddf”,
“access_token”: “aeed6e48-193f-45fa-8077-08b5301bdcb5”
“connector”: {
“port”: 30000,
“websocketPort”: 30001,
“address”: “”
“xiaomi”: {
“find_limit_time”: “30000”,
“motion_reset_time”: “4900”,
“find_mode”: “auto”,
“polling_time”: “”
“devices”: {
“db”: {
“host”: “localhost”,
“port”: “33006”,
“password”: “password1234”
“graph”: {
“height”: 40
“log”: {
“enable”: true
“ble”: {
“enable”: false,
“flora”: {
“pollingTime”: 60
“temperature”: {
“pollingTime”: 60
“ir”: {},
“ping”: {
“user”: {
“name”: “admin”,
“password”: “12345”
“token”: {
“value”: “3c489cce1d0c0579220225edcd61db636194c88e439d0efb2c814aa49fa27b2d2cec2fc54cbf30c30c551e9f51fb284e”,
“enable”: true

I use Smartthings for a while. Now I got an old Raspberry Pi P1 Model B and wanted to install mi-connector to have Roborock working from ST hub.
I tried several linux and docker version without success. Probably because of old ARMv6 architecture processor I usually have 139 Error and container stays in restarting loop. I found this problem for docker but after lot of tries there is no solution.
Do anyone have a working mi-connector on an old Rapsberry Pi? If yes, can you please give me OS and docker version? Thanks in advance.

I ordered the Xiamomi Mi Flora. I saw your DH awesome but will this working with the new ST app?

Can anyone help me with the vibration sensor being added as button rather than vibration sensors. It means it will not work with home monitoring.

can anyone help with connecting bluetooth temperature and humidity sensor?

I paired the linux server running mi-connector with the sensor but cannot connect to it.
However, I can see the sensor in mi-connector interface, the one you access via web browser using 192.168.0.X:30000

It appears only in the dashboard, not in the search or add device (ST) menus.

I installed the appropriate DTH in smartthings and manually added a device, I filled in the ID from the mi-connector dashboard etc

but it does not work, there is no information from device.

so my question is: can anybody list the steps needed to add a bluetooth device? (I could not find such a guide online)

thank you

PS the DTH I used is [fison67 : Xiaomi Sensor HT ], I have also tried [fison67 : Xiaomi Bluetooth Weather ] but still it does not work.

Firstly, thanks for a great connector.
It is working a treat.
Unfortunately I have come across an issue and I’m looking for some guidance on how to resolve it.
I’ve added about 30 devices and finally got to add some wall switches with no neutral.
When I try yo add them I get this error.
Any thoughts what could be causing this.
I have the Xiaomi Wall Switch Driver code installed.

EDIT: This is on HE by the way.

Hi @fison67,

Any chance that you add Viomi V2 robot vacuum/mop?
I just set the connector and I see the log message that it is not supported:

"2020-01-18 22:57:07 warn This viomi.vacuum.v6 is not supported now

I can’t get the Air Purifier 3H (zhimi.airpurifier.mb3) to work with Mi-Connector. “This zhimi.airpurifier.mb3 is not supported now”

Running and the lastest smartapps & DTH

How can I add this model to Mi-Connector?

© 2019 SmartThings, Inc. All Rights Reserved. Terms of Use | Privacy Policy

SmartThings; SmartApps®; Physical Graph; Hello, Home; and Hello, Smart Home are all trademarks of the SmartThings, Inc.