Mi Connector (Xiaomi and Yeelight)

smartapp_misc
dth_sensors
requires_server
smartapp_appliances

(Chals) #1

Hi.

Simplify setup process for xiaomi devices to SmartThings.
If Mi-Connector is installed, virtual devices is registered automatically by Mi Connector Smartapp.
You don’t have to do anything to add xiaomi device in Smartthings IDE.

You can control Xiaomi devices at SmartThings.

Lastest version. v.0.0.3
Beta version. test2

Support WiFi Devices.

  • Xiaomi Air Purifier ( zhimi.airpurifier.m1, zhimi.airpurifier.v1, zhimi.airpurifier.v2, zhimi.airpurifier.v3, zhimi.airpurifier.v6, zhimi.airpurifier.ma2 )
  • Xiaomi Humidifier ( zhimi.humidifier.v1 , zhimi.humidifier.ca1 )
  • Xiaomi Vacuum ( rockrobo.vacuum.v1 )
  • Xiaomi Power Socket ( chuangmi.plug.v1, chuangmi.plug.v2, chuangmi.plug.v3, chuangmi.plug.m1 )
  • Xiaomi Power Strip ( qmi.powerstrip.v1, zimi.powerstrip.v2 )
  • Xiaomi Air Monitor ( zhimi.airmonitor.v1 )
  • Xiaomi gateway ( lumi.gateway.v3 )
  • Xiaomi Fan ( zhimi.fan.v2, zhimi.fan.v3 )
  • Yeelight Mono ( yeelink.light.lamp1, yeelink.light.mono1, yeelink.light.ct2 )
  • Yeelight Color ( yeelink.light.color1, yeelink.light.color2, yeelink.light.strip1 )
  • Yeelight Ceiling ( yeelink.light.ceiling1 )
  • Xiaomi Philips Ceiling ( philips.light.ceiling ) [Only Beta Version]
  • Xiaomi Philips Downlight ( philips.light.downlight ) [Only Beta Version]
  • Xiaomi IR Remote ( chuangmi.ir.v2 ) [Only Beta Version]

Support Zigbee Devices

  • Xiaomi Motion Sensor ( lumi.motion, lumi.motion.aq2 )
  • Xiaomi Door/Window Sensor ( lumi.magnet , lumi.magnet.aq2 )
  • Xiaomi Weather Sensor ( lumi.weather, lumi.sensor_ht )
  • Xiaomi Power Socket ( lumi.plug )
  • Xiaomi Button ( lumi.switch, lumi.switch.v2, lumi.86sw1, lumi.86sw2 )
  • Xiaomi Cube ( lumi.cube )
  • Xiaomi Wall Switch ( lumi.ctrl_neutral1, lumi.ctrl_neutral2 )
  • Xiaomi Smoke Sensor ( lumi.smoke )
  • Xiaomi Gas Sensor ( lumi.gas )
  • Xiaomi Water Sensor ( lumi.water )
  • Xiaomi Curtain Motor ( lumi.curtain )
  • Xiaomi Vibration Sensor ( lumi.vibration ) [Only Beta Version]

Support Bluetooth Devices

  • Xiaomi Flora ( ble.flora ) [Only Beta Version]
  • Xiaomi Flora Pot ( ble.floraPot ) [Only Beta Version]
  • Xiaomi Temperature & Humidity Sensor ( ble.mitemperature ) [Only Beta Version]

Sample Video

Screenshots






Yeelight Ceiling Lamp



Yeelight Light



Yeelight Light Strip


Vacuum


Air Purifier


IR Remote




Power Strip


Zigbee Plug


Zigbee Motion


Zigbee Door


Zigbee Button




Bluetooth Flora



Bluetooth Weather



How to install

  1. Install an API Sever & DB on docker of raspbery pi or synology nas
  2. Install a Smartapp & DTH on Smartthings IDE
  3. Install a Mi Connector Smartapp on the smartthings app.
  4. Set local ip address in the blank.

Original & Aqara Xiaomi Zigbee Sensors (contact, temp, motion, button, outlet, leak, etc)
Xiaomi Zigbee Outlet (Steps to Pair any Xiaomi Zigbee device!)
Help with Xiaomi Aqara door sensor disconnects
Original & Aqara Xiaomi Zigbee Sensors (contact, temp, motion, button, outlet, leak, etc)
MiHome Connect to ST. not working
(Keith G) #2

Great work here, thanks for sharing!

Does access to the Xiaomi Gateway require local network function enabled in Developer Mode?


(TOO FLY FOR A FLY GUY) #3

Whoa, nice!!!

edit: Hmmm, I assume it’s non-trivial to get the API server running on DOcker x64?


(Chals) #4

According to miio library document,


Note To fully support the gateway this library will automatically enable the Local Developer API of the gateway. If it is already enabled the existing key is used but if not a new key is generated and set for the API.

I enabled Developer mode in Mi Home app myself


(Chals) #5

Sorry I don’t know what you are saying exactly…
Cuz I have terrible english…

OS Image is x86_64 in docker (fison67/mi-connector:0.0.1)


(TOO FLY FOR A FLY GUY) #6

Oh, so I should be able to install the Docker image on anything then? No requirement for an ARM processor?


(TOO FLY FOR A FLY GUY) #7

So I tried running your Docker container on Windows, but it just reboots over and over. I assume an ARM processor is required.


(Chals) #8

Is it possible to install Ubuntu docker image on Docker of Window OS?

Docker image is ubuntu. Maybe it’s not working.

fison67/mi-connector:0.0.1 -> ubuntu
fison67/mi-connector-arm:0.0.1 -> raspberian


(TOO FLY FOR A FLY GUY) #9

Ahhh, got it running with fison67/mi-connector:0.0.1!

Would it be possible to setup your repo so that it can be directly integrated with the SmartThings IDE? That way we don’t have to copy/paste each DTH.

As an example, once I’ve added this repo, I can just click on the DTHs I want installed.

Thanks for this work!


(Ds4213) #10

good work!
how to you check which gateway version i have?
like lumi.gateway.v3, lumi.gateway.v2?
Thanks,.


(Chals) #11

I made a new folder devicetypes.
Thanks.


(Chals) #12

I have no idea well…
Basically aq2 means aqara version.

But you don’t have to know that.

Just Mi Connector let you know what you have.
Even if you add device manually, you type only address and token in the form.


(Oh Jung Tae) #13

GamSa Hap NiDa. Onaldo Ip Ni Da ^^
정말 좋습니다!


(TOO FLY FOR A FLY GUY) #14

Excellent. Can you add a smartapps folder as well please?

edit: What is the default port for the Docker container? In your screenshot it shows port 30000, but that doesn’t seem to work for me.


(Ds4213) #15

Thanks, fison67.

unfortunately, I think i have v2 version as the gateway is not showing. (only xiaomi light in showing in my ST app)
is it possible to have v2 supported? also possible to support Xiaomi door/window sensor lumi.magnet???

another issue is i can see the Xiaomi power socket in the Management Web add device windows, however it is not showing in the device list?

Thanks in advance!


(Chals) #16

Defualt port is 30000.

your docker or host is using port 30000 already?

You can change port in config.json which is located shared folder.


(Chals) #17

Try to enable developer mode.

If you add gateway, sensors belong to gateway will be showed

I haven’t tested gateway v2 but miio library tells it’s possible.

If gateway is not showing… it means xiaomi connector can’t get token automatically.

Enable developer mode.


(Chals) #18

Menu Device list means manual device list.

For example mi connector can’t get token automatically, you add device manually that menu.


(TOO FLY FOR A FLY GUY) #19

I get nothing on port 30000. It’s not in use at all.


(Chals) #20

What did you install?
x86 version docker image?

You set this?
–net=host
This makes docker image use same host network.