Connector for Xiaomi Devices with SmartThings
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.
If this project help you, you can give me a cup of coffee
Added a graph in DTH & Web. [ Important!!! You must install a DB. ]
Added support devices.
Added function [find childs] in a gateway DTH.
Fixed bug when Zigbee device count is over 25, network error occured
Added Log page. You can check for an invalid token or see if Mi Connector can not get a token.
Fixed bugs.
Added refresh feature.
Added support devices.
You need a Raspbery pi or Synology Nas to install Mi Connector API Server
You must install docker first.
sudo mkdir /docker
sudo mkdir /docker/mi-connector
sudo chown -R pi:pi /docker
docker pull fison67/mi-connector-arm:latest
docker run -d --restart=always -v /docker/mi-connector:/config --name=mi-connector-arm --net=host fison67/mi-connector-arm:latest
You must install docker first.
See the Manual file for details
Current Beta version is 'mi-connector:test'
make folder /docker/mi-connector
Run Docker
-> Registery
-> Search fison67/mi-connector
-> Advanced Settings
-> Volume tab -> folder -> Select mi-connector & Mount path '/config'
-> Network tab -> Check 'use same network as Docker Host'
-> Complete
You must install docker first.
sudo mkdir /docker
sudo mkdir /docker/mi-connector
docker pull fison67/mi-connector:latest
docker run -d --restart=always -v /docker/mi-connector:/config --name=mi-connector --net=host fison67/mi-connector:latest
Go to the Smartthings IDE
Click My Device Handlers
Click Create New Device Handlers
Copy content of file in the devicetypes/fison67 folder to the area
Click Create
Loop until all of file is registered
See the Manual file for details
Connect to the Smartthings IDE
Click My Smartapps
Click New Smartapp
Click From Code
Copy content of mi_connector.groovy & Paste
Click Create
Click My Smartapps & Edit properties (Mi-Connector)
Enable OAuth
Update Click
You must install docker first.
docker pull jsurf/rpi-mariadb
docker run -d --name mariadb -e MYSQL_ROOT_PASSWORD=password1234 -e TZ=Asia/Seoul -p 33006:3306 -d jsurf/rpi-mariadb
You must install docker first.
Run Docker -> Registery -> Search mariadb -> Advanced Settings -> Port setup tab -> local port 33006, container post 3306 -> Enviroment tab -> MYSQL_ROOT_PASSWORD (password1234), TZ (Asia/Seoul) -> Complete
You must install docker first.
docker pull mariadb
docker run -d --name mariadb -e MYSQL_ROOT_PASSWORD=password1234 -e TZ=Asia/Seoul -p 33006:3306 -d mariadb
Fill the blank [db_url, db_port, db_password] on the Mi-connector web menu setup If you don't change value, it must be a [ localhost, 33006, password1234 ]. Restart a Mi-connector container.
If ip address and token are correct but not connected, remove the device on MiHome
And add the device again on MiHome. Then token is regenerated. Add a device on Mi-Connector again.
Some of product is not getting token automatically like Xiaomi Vacuum. You have to get token yourself.
And go to the 'Manage Device' > 'Device List' > Click the add button > Fill out the blank. (IP & Token) > Click OK Button
a. Open up the MiHome App
b. From the Profile > Settings screen set to the Location field to “Mainland China”
c. Open up the device detail screen for the Gateway device
d. Click the triple dots button in the top-right corner of the screen to open the More screen
e. Open the About screen
f. At the bottom of the screen keep tapping the version number until a notice appears
g. From the same screen open the Local Area Network Communication Protocol screen
h. Slide the toggle element for “Local Area Network Communication Protocol” to enabled
i. Restart Mi-Connector and then register gateway.
Maybe you put the server address on Smart app(Mi-Connector)
If it's wrong server address and device is added already, just stop docker and remove all devices which was added by mi-connector.
Even if you change the address, the server address of each device is not updated. So you must remove devices.
And put the right server address.(ex. 192.168.1.22:30000), restart docker.
When you control device on ST, if you can see the following the log it means that communication is working well with ST.
2018-09-17 03:14:14 [info]: Requested to control by ST >> [zhimi.airpurifier.m1] >> {"id":"54532856","cmd":"power","data":"off"}
If you can't see anything, it's not working well..
https://www.home-assistant.io/components/vacuum.xiaomi_miio/#retrieving-the-access-token
- Yeelight Desk Lamp
- Yeelight Color Bulb
- Yeelight White Bulb
- Yeelight LED Strip
- Mi Robot Vacuum
- Mi Air Quality Monitor (PM2.5)
- Mi Smart Power Strip 1
- Mi Smart Power Strip 2
Type | Model | Tested | Beta |
---|---|---|---|
Xiaomi Air Purifier | zhimi.airpurifier.m1 | O | |
zhimi.airpurifier.v1 | X | ||
zhimi.airpurifier.v2 | X | ||
zhimi.airpurifier.v3 | X | ||
zhimi.airpurifier.v6 | X | ||
zhimi.airpurifier.ma2 | X | ||
Xiaomi Humidifier | zhimi.humidifier.v1 | X | |
zhimi.humidifier.ca1 | O | ||
Xiaomi Vacuum | rockrobo.vacuum.v1 | O | |
roborock.vacuum.s5 | X | ||
Xiaomi Power Socket | chuangmi.plug.v1 | X | |
chuangmi.plug.v2 | X | ||
chuangmi.plug.m1 | O | ||
Xiaomi Power Strip | qmi.powerstrip.v1 | X | |
zimi.powerstrip.v2 | O | ||
Xiaomi Air Monitor | zhimi.airmonitor.v1 | O | |
Xiaomi Gateway | lumi.gateway.v2 | X | |
lumi.gateway.v3 | O | ||
Xiaomi Fan | zhimi.fan.v2 | O | |
zhimi.fan.v3 | O | ||
zhimi.fan.sa1 | X | O | |
zhimi.fan.za1 | O | O | |
Yeelight Mono | yeelink.light.lamp1 | X | |
yeelink.light.mono1 | O | ||
yeelink.light.ct2 | O | ||
Yeelight Color | yeelink.light.color1 | O | |
yeelink.light.color2 | O | ||
yeelink.light.strip1 | O | ||
Yeelight Ceiling | yeelink.light.ceiling1 | O | |
Philips Ceiling | philips.light.ceiling | O | |
Xiaomi IR Remote | chuangmi.ir.v2 | △ | O |
Type | Model | Tested | Beta |
---|---|---|---|
Xiaomi Motion Sensor | lumi.motion | X | |
lumi.motion.aq2 | O | ||
Xiaomi Door/Window Sensor | lumi.magnet | X | |
lumi.magnet.aq2 | O | ||
Xiaomi Weather Sensor | lumi.weather | O | |
lumi.sensor_ht | O | ||
Xiaomi Power Socket | lumi.plug | O | |
Xiaomi Button | lumi.switch | O | |
lumi.switch.v2 | O | ||
lumi.86sw1 | O | ||
lumi.86sw2 | O | ||
Xiaomi Cube | lumi.cube | O | |
Xiaomi Wall Switch | lumi.ctrl_neutral1 | O | |
lumi.ctrl_neutral2 | O | ||
Xiaomi Smoke Sensor | lumi.smoke | O | |
Xiaomi Gas Sensor | lumi.gas | O | |
Xiaomi Water Sensor | lumi.water | O | |
Xiaomi Curtain Motor | lumi.curtain | O | |
Xiaomi Vibration Sensor | lumi.vibration | O | O |
Type | Model | Tested | Beta |
---|---|---|---|
Xiaomi Flora | ble.flora | △ | O |
Xiaomi Flora Pot | ble.floraPot | △ | O |
Xiaomi Temp-Humid Sensor | ble.mitemperature | △ | O |
This project is licensed under the MIT License - see the LICENSE file for details
- Many thanks to ShinJjang for testing, updating DTH.