[OBSOLETE] Mi Connector (Xiaomi and Yeelight)

can i just reboot Rasberry pi for restarting docker container?
sorry I’m not so good with linux command line
“docker restart /docker/mi-connector-arm” ??

docker ps -a
Then you can see a container id.

docker restart [container id]

ex) docker restart asdf234sdf

What is the easiest way of finding the token for specifically the yeelight light bulb (colour)? The method that I used in the past involved using the mi toolkit and an android device and extracting the token through a backup. I vaguely remember doing another stage before using SQlite when I was successful last time?
I’ve got logs on my android device that seem to be showing the correct token for my gateway and lightstrip but are incorrect for my bulb. I’ve tried all the miio commands for my Pi but the token for the bulb is hidden and shows up as ???
Just trying to use BlueStacks now to try and retrieve the token that way. Spent several hours on this already but kind of determined to get it back sorted!

Managed to get the token for the Yeelight but the Mi Connector is still not letting me add the light. Think it is because I’ve previously tried to add the light with an incorrect token but when I delete these devices, they still remain. Pretty certain I’ve got the correct token now (retrieved it from logs from Mi Home app 5.4.54). Any suggestions?

Hi,

DB is disconnected>>Error: connect ECONNEFUSED 127.0.0.1:33006

Tried to reinstall DB but still got this error message. Please advise.

Added another error message:
DB is disconnected >> Error: Host ‘172.17.0.1’ is not allowed to connect to this MariaDB server

Used below command, working now.

docker run -d --restart=always --name mariadb -e MYSQL_ROOT_PASSWORD=password1234 -e TZ=Asia/Seoul -p 33006:3306 -d jsurf/rpi-mariadb

I don’t know exactly what you’re saying.
Just delete device info on mi connector & delete device on smartthings.
And Restart a docker container. Add a device with token.

Managed to do it already. I set up a new Mi connector on a different Raspberry Pi. Thanks again for getting back to me :blush: Do you have a PayPal or Patreon?

It’s good.
I have a PayPal.

Made some progress. The tested devices listed here indicates a triangle for the Mi Flora but a circle for the beta so I tried the beta image. I can see there’s polling in the docker console, but searching for devices yields nothing. I can connect it with the Plant Care app on my phone without issue so the sensor itself must be working. I’ve removed it as well in case that causes an issue. Yes, BT is enabled in the app and the container was restarted after that, but the Flora is not picked up in the Mi Connector app.

Any tips? Any way I can scan from command line? Seems like there aren’t any of the standard Bluetooth utilities installed.

Hi . I have updated to test3 and now i cannot get token token
and i’m getting this error after mi-connector restart
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:70: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:338: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:361:16)

Thanks

Hi fison67,
Bluetooth devices (weather and Flora) always lose connection after around 8-10 hours. (I know it is still under beta version). Do you have this issue?
Thanks.

Update a smartapp.
Open a mi connector of smartapp. And then press the save button.
Or press config menu. You see app_url, app_id, access_token. Copy it & Paste to mi connector web.

I have no idea…
My devices are keeping connection.
Later I’m going to add a auto reconnect.

Your docker is running on Synology Nas?
Then unplug the Bluetooth dongle and plug it back in.
And then restart a docker.

Thanks. For your reference:

Both devices are still showing in Mi Connector page. But I can’t view the updating conditions (So, I mean lose connection) in Smartthings.

Let’s do it from the beginning…

  1. Remove Docker Container & Smartapp & Devices on Smartthings.
  2. Run a docker container.
  3. Go to the setup menu. Select a server address. Press a button.
  4. Add a smartapp & Put a server address & Press a save button.
  5. Open a Smartthings IDE & Go to the logs.
  6. Restart a docker container.
  7. Let me see a docker container log & IDE log.

I don’t have graph showing in my smartthings app. I have attached the image below. Is this normal how do I get the graph to show if I am doing something wrong?

Yes. I did as you suggested and nothing has changed. Is the Flora supposed to be auto-detected? Should I remove it from my phone, first?

Hello,

Will the Xiaomi MIJIA WXKG01LM work with this program ?

I’m still having this same issue after removing config.json. Any other ideas?

edit: I just repulled test3 and it seems to be working.