SmartThings Community

Mi Connector (Xiaomi and Yeelight)


(Chals) #248

Rasperry pi or Synology Nas ip address with port.


or in your router

(Keem Keemo) #249

Hi fison67 I am not using rasperry.
I am directly using smart things app.
so it should be my local ipv4 address right? ipconfig

another question please. I have installed mi connector on my smart things app as per your instructions. But under “My Home” > “Things”, the devices installed in Mi Home is not showing up.

(Chals) #250

Where do you install a docker image?

It’ can’t be played stand alone without docker.

(Keem Keemo) #251

I just copy pasted your mi connector code into Smart Things IDE.

so I need a docker? hmm. any guide/links/instructions for me to learn?

Thanks for your patience.

(Keem Keemo) #252

cool. I guess I’ll just google it. got some info on Home Assistant and Rasperry Pi. Thank you.


Hi. Thanks again. I restarted docker. Removed and added again Smartapp and dth. Still no luck. I’m running out of ideas…

(Chals) #254

You need a raspberry pi

(Chals) #255

You install all of DTH?

Let me know your ST IDE Live log after you restart a docker.
Only Mi Connector smartapp log.

(Keem Keemo) #256

@fison67 sorry maybe another noob question.

So you need rasperry pi to control xiaomi mi home using home assistant?
so you also use home assistant to control smart things?
sorry i dont understand the setup. I tried googling but could not find an answer.

so how does it all work?

(Chals) #257

Mi connector is not using home assistant.
This is just help to control Xiaomi devices on Smartthings.
And Mi connector is working on docker.


Hi. My log had " Failed >> ADD Device Error : Device type ‘Xiaomi Smoke Dectector’ in namespace ‘fison67’ not found."

So I changed line 33 of mi connector Smartapp to “definition (name: “Xiaomi Smoke Dectector”, namespace: “fison67”, author: “fison67”) {” and now everything is working. Maybe you want to correct on your side and push changes to GitHub. Thanks for the tip

(Ha Nguyen) #259

Any idea why I can’t click on the add device button?

I just have one device Roborock, so I added 2: xiaomi-vacuums.src and xiaomi-vacuums2.src

are they enough?


Hi. One more question: can you use multiple v3 gateways with mi-connector? Thanks

(Lunk Snee) #261

Thanks so much for your work on this - I’m excited to hopefully get this working!

(Arkady Aidlin) #262


Hi , please help . I’m a newbie , firs time installing docker . I cannot connect ST smart app to mi-connector . cannot get it working . what am i doing wrong ?
Thanks !!


My database is up, but it seems that the docker image can’t connect to it. Any ideas?

root@linuxkit-00155d010225:/usr/src/app# npm start

> mi-connector@0.0.3 start /usr/src/app
> node ./bin/www

2018-12-12 08:47:05 [info]: WebSocket init
2018-12-12 08:47:06 [info]: Initiallize Ping Processor
2018-12-12 08:47:06 [info]: Mi Connector Version >>
2018-12-12 08:47:06 [info]: {"st":{"app_url":"","app_id":"","access_token":""},"connector":{"port":30000,"websocketPort":30001,"address":""}
2018-12-12 08:47:06 [info]: Save Config >> {"st":{"app_url":"","app_id":"","access_token":""},"connector":{"port":30000,"websocketPort":3000
WebSocketServer {
  _events: {},
  _eventsCount: 0,
  _maxListeners: undefined,
   { upgrade: [Function: bound ],
     requestAccepted: [Function: bound ],
     requestResolved: [Function: bound ] },
  connections: [],
  pendingRequests: [],
   { httpServer: [ [Server] ],
     maxReceivedFrameSize: 65536,
     maxReceivedMessageSize: 1048576,
     fragmentOutgoingMessages: true,
     fragmentationThreshold: 16384,
     keepalive: true,
     keepaliveInterval: 20000,
     dropConnectionOnKeepaliveTimeout: true,
     keepaliveGracePeriod: 10000,
     useNativeKeepalive: false,
     assembleFragments: true,
     autoAcceptConnections: false,
     ignoreXForwardedFor: false,
     disableNagleAlgorithm: true,
     closeTimeout: 5000 } }
2018-12-12 08:47:06 [info]: DB Config >> {"host":"localhost","port":3306,"user":"root","password":"password","database":"mi_connector"}
2018-12-12 08:47:06 [info]: ----------------------------------
2018-12-12 08:47:06 [info]: Initialize >> Auto Detect Device!
2018-12-12 08:47:06 [info]: ----------------------------------
2018-12-12 08:47:06 [error]: DB is disconnected >> Error: connect ECONNREFUSED
^Croot@linuxkit-00155d010225:/usr/src/app# exit
PS C:\Users\Administrator\Docker\mi-connector> docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                     NAMES
e4d9239c1aea        mariadb             "docker-entrypoint.s…"   19 minutes ago      Up 4 minutes>3306/tcp   mariadb
PS C:\Users\Administrator\Docker\mi-connector>

(Chals) #264

Yes you can use multiple gateway.

(Chals) #265

You must get token and add device manually on web.

(Chals) #266

Just press a save button.
If error is occured enable oauth on smartapp

(Chals) #267

Your mariadb docker port mapping is 33006:3306.
So port number of db config is 33006