Mi Connector (Xiaomi and Yeelight)

smartapp_misc
dth_sensors
requires_server
smartapp_appliances

(Mathias Caldas) #167

Hi,

Tried with thest version and still get the following error in logs:
This yeelink.light.ceiling2 is not support now

The version of the image is:
fison67/mi-connector:test@sha256:fa1c5864b502cbf189bd548f0ccc8c138543ff81e48339fcf4ecf303f21940ad


(Smart) #168

Hi fison67,

Is it possible for you to port this over to Hubitat? There are quite a few people in that community who will appreciate your work and I am willing to do the testing for you.


(Chals) #169

Sorry, I missed one file to update.
Try again.


(Chals) #170

I added a alarm capability to Xiaomi Gateway.

Need some setup.
Alarm Settings [ Both, Strobe, Siren ]
Strobe Color [ Hex Value. ex) #ffffff ]
Strobe Brightness [ 1~100 ]
Siren Volume [ 1~100 ]
Siren Type

DTH

Web Core


(Chals) #171

Sorry,
I have no idea what it is.


(Nuno Martins) #172

IT’s only a DH update? no need for update the docker image?


(Chals) #173

Yes only update DTH


(Peke) #174

Man this is some great stuff. really like your work, keep it up!


(Mathias Caldas) #175

Hey,
So i tried again and now i get an error on ST side, this is it:

2018-09-29 09:51:27 [warn]: ST Smartpapps does not support yeelink.light.ceiling2 DTH!!!

Any suggestion?


(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.


(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.
[X] 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: