SmartThings Community

Mi Connector (Xiaomi and Yeelight)

smartapp_misc
dth_sensors
requires_server
smartapp_appliances
(Mathias Caldas) #176

Ok, i just edited the smartapp and it seems to work, simple change:

else if(params.type == "yeelink.light.ceiling1" || params.type == "yeelink.light.ceiling2")
(Chals) #177

I missed to tell you that updating a smartapp.
Smartapp code of github was already modified.

(Mathias Caldas) #178

On a different branch? Because on master it wasn’t

(Chals) #179

It’s a master.

(Albulg) #180

Hi, I’m struggling to get this working. I have the gateway, a yeelight and button linked to my MI Home app. I’ve followed the steps by installing Docker and the sections onto a Raspberry Pi. I’ve looked into enabling the developer mode. I’m not sure what IP address that I am meant to add, is it my local IP address, the address for gateway or the address of my HASSBIAN? Really apologise as I am a complete novice and new to using raspberry pi stuff. Docker and everything appeared to install fine? Is there a way to check everything is correct? I’ve also tried removing and reinstalling the gateway in Mi Home.

(Simon Tether) #181

For a yeelight look here, I’ve posted a Beta DTH I am working on, no need for a RasPi bridge, although there is no discovery, no 2-way feedback (yet) and a few seconds delay on commands.

1 Like
(Chals) #182

In a Smartapp?
Server address is your raspbery pi address with port. ex) 192.168.0.100:30000

If everything is working fine, you can see it on web page like this

[V] means that sensor is registered to ST.
means that sensor is not registered to ST.

(Albulg) #183

I’ve followed the same steps that Roelof quoted in an earlier post but nothing seems to be working. I don’t understand what is meant by [ fison67/mi-connector-arm:test ] version? I think the problem is my docker install, is there a way of removing it and is there a specific docker tutorial I should follow to install on Hassbian. I’ve only just got my raspberry pi and bought it mainly for homeassistant and to do more with SmartThings as I love Xiaomi products. Was so happy to come across this integration but annoyed with myself that I can’t get it to work! Is Hassbian ok to use for this purpose? Also, many thanks in advance! It does look awesome if I can get it to work :slight_smile:

(Chals) #184

fison67/mi-connector-arm:test is just docker image like latest.
It’s just a current image.

Hassbian is also a raspbery pi OS. It’s possible to install a docker.

  1. Install a docker
    curl -sSL https://get.docker.com | sh
    sudo usermod -aG docker $USER

  2. docker image download

2-1. mariadb download
docker pull jsurf/rpi-mariadb

2-2. mi-connect download
sudo mkdir /docker
sudo mkdir /docker/mi-connector
sudo chown -R pi:pi /docker
docker pull fison67/mi-connector-arm:test

  1. Run a docker

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

3-2 mi-connect docker
docker run -d --restart=always -v /docker/mi-connector:/config --name=mi-connector-arm --net=host fison67/mi-connector-arm:test

  1. mi-connect run
    web browser
    http://raspberypi-ip:30000
    ex) http://192.168.1.100:30000
(Albulg) #185

It’s been a problem with the tokens… I’ve tried several methods in retrieving the tokens. The Windows/ Android method didn’t work but the only Android device I have is a Kindle and I had to install MiHome from an APK file as the Play Store said it was incompatible…

I tried the other methods with the raspberry pi but, I’ve now installed a Hypriot OS to install Docker onto the raspberry pi and I’m not sure if I need to do something prior to typing these commands for it to recognise. Intending on installing Home Assistant at some point as I’ve seen videos where you can install it as a Docker container.

The furthest I’ve gotten is with the iOS method, this token seems to be massive though? Going to try and figure out how to restart docker to see if that does anything!

(Albulg) #186

Managed to get it all working :slight_smile: … so happy! I couldn’t figure out what was meant by open terminal on: https://www.home-assistant.io/components/vacuum.xiaomi_miio/#retrieving-the-access-token instructions for iOS but noticed that I had installed an old version of Mi Home on my kindle. Managed to get the tokens through the Windows/Android method but had to install Mi Home 5.0 for that method to work. Just hope that I can get Home Assistant back on through Docker at a later date :slight_smile:

#187

I have docker set up and working and I can detect my xiaomi yeelight bedside lamp as not initialised:

When I try and add it its shown in red and no token is being pulled back. I have managed to get the token using PacketSender, but I dont see how I can add the lamp to the database even with this:

Anyone any ideas?

(Chals) #188

Maybe you got the wrong token.
Here is how to get token.

Take that 96 digit key and paste into the following:
http://aes.online-domain-tools.com/

Paste in the key as Text / HEX
Function: AES
Mode: ECB
Key: Enter in 32 0’s
Key: 00000000000000000000000000000000
Change output to HEX
Click Decrpyt.

Maybe result is like this.

3 3 6 f 6 1 7 3 5 0 4 2 4 2 4 2
5 5 5 1 4 a 6 f 3 9 6 a 7 1 4 1
(Bogdan Alexe) #189

Is Xiaomi air purifier 2S (zhimi.airpurifier.mc1) supported?

#190

Thanks, I’ll try this once I get home. Once I have the token, how do I use that to get add the lamp to mi connector?

(Chals) #191

Manage Device -> Device List -> Add Button

(Chals) #192

Not yet.
‘zhimi.airpurifier.mc1’ is exact name?
When I add that model in mi connector, I will let you know.

1 Like
#193

Quick question, does it need to have xiaomi gateway for the mi connector to work? Or gateway is optional?
Thanks for the good work

(Chals) #194

WiFi devices no needs xiaomi gateway.
Zigbee devices needs gateway.

(Bogdan Alexe) #195

Can you offer more info about the API application? I’m trying to rewrite a bit the Vacuum DTH in order to make it more compatible with V2 (differences around fanSpeed) and other smartthings smart apps (like webcore)