Giter Club home page Giter Club logo

mi_connector's Introduction

Mi Connector

Connector for Xiaomi devices with SmartThings

Simplifies the setup of Xiaomi devices with SmartThings.
If Mi Connector is installed, virtual devices are registered automatically by the Mi Connector SmartApp.
You don't have to do anything to add Xiaomi devices in SmartThings IDE.

Please see the prerequisites needed for this connector to work properly.

Hubitat? Use the following branch: https://github.com/fison67/mi_connector/tree/hubitat

No more used a arm image.
Just use a fison67/mi-connector image.

Example Video

Example

Donation

If this project helps you, you can give me a cup of coffee
Donate

Table of contents

Release Notes

Version: 0.0.6

Added support devices.

Version: 0.0.5

Added support devices.

Version: 0.0.4

Added a function to add a device by db file.
Added support devices.

Version: 0.0.3

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 occurred

More screenshots: https://github.com/fison67/mi_connector/blob/master/imgs/v.0.0.3/README.md

Version: 0.0.2

Added Log page. You can check for an invalid token or see if Mi Connector cannot get a token.
Fixed bugs.
Added refresh feature.
Added support devices.

Documentation

Management Web Desktop Version

web-dashboard-total

Management Web Mobile Version

total

DTH Example

total2

Supported Devices

Wi-Fi Devices

Type Model Tested Beta
Xiaomi Air Purifier zhimi.airpurifier.m1 O
zhimi.airpurifier.m2 X
zhimi.airpurifier.v1 X
zhimi.airpurifier.v2 X
zhimi.airpurifier.v3 X
zhimi.airpurifier.v6 X
zhimi.airpurifier.v7 X
zhimi.airpurifier.mc1 X
zhimi.airpurifier.ma2 X
zhimi.airpurifier.ma4 O
zhimi.airpurifier.sa2
zhimi.airpurifier.mb3
Xiaomi Air Fresh zhimi.airfresh.va2 X
Xiaomi Humidifier zhimi.humidifier.v1 X
zhimi.humidifier.ca1 O
zhimi.humidifier.ca4 X
zhimi.humidifier.cb1 X
zhimi.humidifier.cb2 X
shuii.humidifier.jsq001 O
deerma.humidifier.mjjsq O
deerma.humidifier.jsq X
deerma.humidifier.jsq1 X
Xiaomi Dehumidifier nwt.derh.wdh318efw1 X
Xiaomi Vacuum rockrobo.vacuum.v1 O
roborock.vacuum.c1 X
roborock.vacuum.s5 X
roborock.vacuum.s6 X
roborock.vacuum.s5e X
roborock.vacuum.m1s X
roborock.vacuum.e2 X
roborock.vacuum.a10 X
viomi.vacuum.v6 X
viomi.vacuum.v7 X
kxf321.mop.mo001 X
Xiaomi Power Socket chuangmi.plug.v1 X
chuangmi.plug.v2 X
chuangmi.plug.v3 O O
chuangmi.plug.m1 O
Xiaomi Power Strip qmi.powerstrip.v1 X
zimi.powerstrip.v2 O
Xiaomi Air Monitor zhimi.airmonitor.v1 O
cgllc.airmonitor.b1 O O
cgllc.airmonitor.s1 O O
Xiaomi Gateway lumi.gateway.v2 X
lumi.gateway.v3 O
Xiaomi AC Partner lumi.acpartner.v3 X
Xiaomi Fan zhimi.fan.v2 O
zhimi.fan.v2 X
zhimi.fan.v3 O
zhimi.fan.sa1 X
zhimi.fan.za1 O
zhimi.fan.za3 X
zhimi.fan.za4 X
zhimi.fan.za5 X
air.fan.ca23ad9 O
dmaker.fan.p5 X
dmaker.fan.p8 X
dmaker.fan.p9 X
dmaker.fan.p10 X
dmaker.fan.p11 X
Yeelight Mono yeelink.light.lamp1 X
yeelink.light.lamp2 O
yeelink.light.lamp3 O
yeelink.light.mono1 O
yeelink.light.ct2 O
Yeelight Color yeelink.light.color1 O
yeelink.light.color2 O
yeelink.light.color3 O
yeelink.light.color4 O
yeelink.light.color5 O
yeelink.light.strip1 O
yeelink.light.strip2 O
yeelink.light.strip3 O
yeelink.light.strip4 O
yeelink.light.strip5 O
yeelink.light.strip6 O
Bedside Lamp yeelink.light.bslamp1 O
yeelink.light.bslamp2 X O
Yeelight Ceiling yeelink.light.ceiling1 O
yeelink.light.ceiling2 O
yeelink.light.ceiling3 O
yeelink.light.ceiling4 O
yeelink.light.ceiling5 O
yeelink.light.ceiling6 O
yeelink.light.ceiling7
yeelink.light.ceiling8
yeelink.light.ceiling9
yeelink.light.ceiling13
yeelink.light.ceiling14
yeelink.light.ceiling15
yeelink.light.ceiling16
yeelink.light.ceiling17
yeelink.light.ceiling18
yeelink.light.ceiling19
yeelink.light.ceiling20
yeelink.light.ceil26
Philips Ceiling philips.light.ceiling O
philips.light.zyceiling O
Philips Downlight philips.light.downlight O
Philips Bedside Lamp philips.light.moonlight O
Philips Light philips.light.sread1
philips.light.bulb
Xiaomi IR Remote chuangmi.ir.v2
chuangmi.remote.h102a03 O
chuangmi.remote.v2 O
Xiaomi Heater zhimi.heater.za1 O
zhimi.heater.za2 X
zhimi.heater.mc2 X
zhimi.elecheater.ma1 X

Zigbee Devices

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 Relay lumi.relay 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

Bluetooth Devices

Type Model Tested Beta
Xiaomi Flora ble.flora
Xiaomi Flora Pot ble.floraPot
Xiaomi Temp-Humid Sensor ble.mitemperature
Xiaomi E-Ink Temp-Humid Sensor ble.einktemperature

Installation

Prerequisites

  • SmartThings account
  • Local server (Synology NAS, Raspberry Pi, Linux Server) with Docker installed
  • Xiaomi Gateway (Only needed for Zigbee devices)
  • Built-in bluetooth or dongle available on local server (Only needed for Bluetooth devices)

Docker Versions

Stable Versions

Docker tag
fison67/mi-connector:latest
fison67/mi-connector-arm:latest

Install Mi Connector API Server

Raspberry Pi

Docker must be installed and running before continuing the installation.

sudo mkdir /docker
sudo mkdir /docker/mi-connector
sudo chown -R pi:pi /docker
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

Synology NAS

Docker must be installed and running before continuing the installation.

See the manual for details

1. Open Docker app in Synology Web GUI
2. Select the Registry tab in the left menu
3. Search for "fison67"
4. Select and download the "fison67/mi-connector" image (choose the "latest" tag for the stable version or see the Docker Versions section above for other versions/tags)
5. Select the Image tab in the left menu and wait for the image to fully download
6. Select the downloaded image and click on the Launch button
7. Give the Container a sensible name (e.g. "mi-connector")
8. Click on Advanced Settings
9. Check the "auto-restart" checkbox in the Advanced Settings tab
10. Click on Add Folder in the Volume tab and create a new folder (e.g. /docker/mi-connector) for the configuration files. Fill in "/config" in the Mount path field.
11.  Check the "Use the same network as Docker Host" checkbox in the Network tab
12. Click on Apply => Next => Apply

Linux x86 x64

Docker must be installed and running before continuing the installation.

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

Install MySQL database

Raspberry Pi

Docker must be installed and running before continuing the installation.

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

Synology NAS

Docker must be installed and running before continuing the installation.

1. Open Docker app in Synology Web GUI
2. Select the Registry tab in the left menu
3. Search for "mariadb"
4. Select and download the "mariadb" image (choose the "latest" tag)
5. Select the Image tab in the left menu and wait for the image to fully download
6. Select the downloaded image and click on the Launch button
7. Give the Container a sensible name (e.g. "mariadb")
8. Click on Advanced Settings
9. Check the "auto-restart" checkbox in the Advanced Settings tab
10. Check the "Use the same network as Docker Host" checkbox in the Network tab
11. Add the following variables in the Environment tab:
    variable: MYSQL_ROOT_PASSWORD, Value: password1234
    variable: TZ, Value: Asia/Seoul
12. Click on Apply => Next => Apply

With the settings above the default DB port is 3306 and must be used during the Mi Connector configuration.

Linux x86 x64

Docker must be installed and running before continuing the installation.

docker pull mariadb
docker run -d --name mariadb -e MYSQL_ROOT_PASSWORD=password1234 -e TZ=Asia/Seoul -p 33006:3306 -d mariadb

Mi Connector configuration

1. Open Mi Connector web settings page (http://X.X.X.X:30000/settings)
2. Fill in the DB settings:
    DB URL (e.g. "localhost")
    DB Port (e.g. "3306", "33006")
    DB Password (e.g. "password1234", "password")
3. Restart Mi Connector Docker container

If you don't add/update the DB values, they must be [ localhost, 33006, password1234 ].

Install Device Type Handler (DTH)

Manual install

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

Install DTH using the GitHub Repo integration

Enable the GitHub integration before continuing the installation. Perform step 1 and 2 in the SmartThings guide to enable the GitHub integration for your SmartThings account.

1. Go to the SmartThings IDE
2. Select the My Device Handlers tab
3. Click on the "Settings" button
4. Click on the "Add new repository" option and fill in the following information:
    Owner: fison67
    Name: mi_connector
    Branch: master
5. Click on the "Save" button
6. Click on the "Update from Repo" button and select the "mi_connector (master)" option
7. Check the checkbox for the device types you need (or all of them) in the "New (only in GitHub)" column
8. Check the "Publish" checkbox and click on the "Execute Update" button

Install SmartApp

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

Install SmartApp using the GitHub Repo integration

Enable the GitHub integration before continuing the installation. Perform step 1 and 2 in the SmartThings guide to enable the GitHub integration for your SmartThings account.

1. Go to the SmartThings IDE
2. Select the My SmartApps tab
3. Click on the Settings button
4. Click on the "Add new repository" option and fill in the following information:
    Owner: fison67
    Name: mi_connector
    Branch: master
5. Click on the "Save" button
6. Click on the "Update from Repo" button and select the "mi_connector (master)" option
7. Check the checkbox for the device types you need (or all of them) in the "New (only in GitHub)" column
8. Check the "Publish" checkbox and click on the "Execute Update" button
9. Select the My SmartApps tab
10. Click on the "Edit Properties" button for the Mi Connector SmartApp (fison67 : Mi Connector)
11. Click on the "OAuth" option and click on the "Enable OAuth" button
12. Click on the "Update" button

Step 3 and 4 are only needed if the repo has not been added earlier (e.g. in the DTH installation).

Install Bluetooth Bridge

See the Manual for details

Burn a binary to ESP32

Troubleshooting

Suddenly Mi Connector can't connect to Xiaomi devices

If IP address and token are correct but not connected, then:

  1. Remove the device on MiHome
  2. Add the device again on MiHome (Token is regenerated)
  3. Add device in Mi Connector again

Device is not added automatically in auto mode

If the device is not added automatically by Mi Connector, it must be added manually:

  1. Open Mi Connector device list web page (http://X.X.X.X:30000/devices)
  2. Click on the "Add" button and fill in the IP address and token
  3. Click on the "OK" button

Known devices:

  • 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

How to retrieve device token

https://www.home-assistant.io/components/vacuum.xiaomi_miio/#retrieving-the-access-token

When Zigbee devices is not working (No response)

  1. Open up the MiHome App
  1. From the Profile > Settings screen set to the Location field to “Mainland China”
  2. Open up the device detail screen for the Gateway device
  3. Click the triple dots button in the top-right corner of the screen to open the More screen
  4. Open the About screen
  5. At the bottom of the screen keep tapping the version number until a notice appears
  6. From the same screen open the Local Area Network Communication Protocol screen
  7. Slide the toggle element for “Local Area Network Communication Protocol” to enabled

9. Restart Mi Connector and then register gateway.
10. If you do step by step, but zigbee device is not working
install a nmap first.
sudo nmap -sU gatewayip -p 9898, 4321
..................................
PORT STATE SERVICE
4321/udp open|filtered rwhois
9898/udp open monkeycom

..................................
If Port is closed xiaomi gateway doesn't report zigbee status to mi connector anymore.
You have to buy new one and enable a lan protocol first, don't firmware update first!!!
Or have a look this link
https://community.openhab.org/t/solved-openhab2-xiaomi-mi-gateway-does-not-respond/52963/114


When you can't control device on ST

Maybe you put the server address on SmartApp (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 container.
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..

Library

License

This project is licensed under the MIT License - see the LICENSE file for details

Thanks

  • Many thanks to ShinJjang for testing and updating DTH.

mi_connector's People

Contributors

fison67 avatar sangkooki avatar shin4299 avatar vivianlink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mi_connector's Issues

Mi Connector username and password

Hi!
I have running Mi Connector on Raspberry pi server. For some reason configured Xiaomi setting to use Gateway address 172.17.0.1. (Docker Gateway??)

Today could not access Mi Connector on server address as I need to input a username and password in a Login Form. Password recovery option does not work. Create new account option does not work.

I can access however logs page:
20200325_065314

Any ideas, what username and password to try?

Thanks!

Best regards,
Stanislav

Support of Air Purifier 3 (C/H)

Hey.
I have issues with zhimi.airpurifier.mb3.
Some functions on DHT not supported by air purifier 3H, like dimmer.
Also I can’t control the device except of turning in On an Off.
Other Functions like fan speed, PM10 dust level doesn't seems to work:/

Any plans for supporting this device?

Where can I find the graph?

I have managed to set this up and it's working correctly with Air Purifier Pro (v7) and Roborock S50. I'm very appreciative of this project. Thank you!

I have seen in the documentation that you have some screenshots of a graph. Can you please tell me where I can find them?

멀티탭 3개 중 두개가 작동을 안하고 이런 로그를 뿌립니다

Xiaomi Settings
Type Content
error Get Device State TypeError: deviceMap[id].target.state is not a function Error at Object.module.exports.getDeviceState (/usr/src/app/miio/miio.js:1026:60) at processDeviceStatus (/usr/src/app/routes/websocket.js:169:10) at WebSocket. (/usr/src/app/routes/websocket.js:43:9) at emitOne (events.js:116:13) at WebSocket.emit (events.js:211:7) at Receiver.receiverOnMessage (/usr/src/app/node_modules/ws/lib/websocket.js:715:20) at emitOne (events.js:116:13) at Receiver.emit (events.js:211:7) at Receiver.dataMessage (/usr/src/app/node_modules/ws/lib/receiver.js:414:14) at Receiver.getData (/usr/src/app/node_modules/ws/lib/receiver.js:346:17)
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"on"}] Erorr: TypeError: device.matches is not a function
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"on"}] Erorr: TypeError: Cannot read property 'indexOf' of undefined
info Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"on"}]
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48704499","cmd":"power","data":"on"}] Erorr: TypeError: device.matches is not a function
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48704499","cmd":"power","data":"on"}] Erorr: TypeError: Cannot read property 'indexOf' of undefined
info Requested to control by ST >> zimi.powerstrip.v2[{"id":"48704499","cmd":"power","data":"on"}]
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48704499","cmd":"power","data":"off"}] Erorr: TypeError: device.matches is not a function
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48704499","cmd":"power","data":"off"}] Erorr: TypeError: Cannot read property 'indexOf' of undefined
info Requested to control by ST >> zimi.powerstrip.v2[{"id":"48704499","cmd":"power","data":"off"}]
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"off"}] Erorr: TypeError: device.matches is not a function
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"off"}] Erorr: TypeError: Cannot read property 'indexOf' of undefined
info Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"off"}]
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"off"}] Erorr: TypeError: device.matches is not a function
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"off"}] Erorr: TypeError: Cannot read property 'indexOf' of undefined
info Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"off"}]
info Requested to control by ST >> zimi.powerstrip.v2[{"id":"48716311","cmd":"power","data":"on"}]
info Requested to control by ST >> zimi.powerstrip.v2[{"id":"48716311","cmd":"power","data":"off"}]
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"on"}] Erorr: TypeError: device.matches is not a function
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"on"}] Erorr: TypeError: Cannot read property 'indexOf' of undefined
info Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"on"}]
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"off"}] Erorr: TypeError: device.matches is not a function
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"off"}] Erorr: TypeError: Cannot read property 'indexOf' of undefined
info Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"off"}]
info Requested to control by ST >> rockrobo.vacuum.v1[{"id":"55508490","cmd":"charge"}]
info Requested to control by ST >> zimi.powerstrip.v2[{"id":"48716311","cmd":"power","data":"on"}]
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"off"}] Erorr: TypeError: device.matches is not a function
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"off"}] Erorr: TypeError: Cannot read property 'indexOf' of undefined
info Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"off"}]
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48704499","cmd":"power","data":"off"}] Erorr: TypeError: device.matches is not a function
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48704499","cmd":"power","data":"off"}] Erorr: TypeError: Cannot read property 'indexOf' of undefined
info Requested to control by ST >> zimi.powerstrip.v2[{"id":"48704499","cmd":"power","data":"off"}]
info Requested to control by ST >> rockrobo.vacuum.v1[{"id":"55508490","cmd":"clean"}]
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48704499","cmd":"power","data":"off"}] Erorr: TypeError: device.matches is not a function
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48704499","cmd":"power","data":"off"}] Erorr: TypeError: Cannot read property 'indexOf' of undefined
info Requested to control by ST >> zimi.powerstrip.v2[{"id":"48704499","cmd":"power","data":"off"}]
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"off"}] Erorr: TypeError: device.matches is not a function
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"off"}] Erorr: TypeError: Cannot read property 'indexOf' of undefined
info Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"off"}]
info Requested to control by ST >> zimi.powerstrip.v2[{"id":"48716311","cmd":"power","data":"off"}]
info Requested to control by ST >> zimi.powerstrip.v2[{"id":"48716311","cmd":"power","data":"on"}]
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48704499","cmd":"power","data":"off"}] Erorr: TypeError: device.matches is not a function
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48704499","cmd":"power","data":"off"}] Erorr: TypeError: Cannot read property 'indexOf' of undefined
info Requested to control by ST >> zimi.powerstrip.v2[{"id":"48704499","cmd":"power","data":"off"}]
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"off"}] Erorr: TypeError: device.matches is not a function
error Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"off"}] Erorr: TypeError: Cannot read property 'indexOf' of undefined
info Requested to control by ST >> zimi.powerstrip.v2[{"id":"48734306","cmd":"power","data":"off"}]
info Requested to control by ST >> zimi.powerstrip.v2[{"id":"48716311","cmd":"power","data":"off"}]
info Initialize WiFi Device >> zimi.powerstrip.v2(48734306)
info Initialize WiFi Device >> zimi.powerstrip.v2(48704499)
info

Cannot add Xiaomi Wall Switch to Smartthings

When I select that device and click “Register”, it pops up a dialog box with “undefined”
It only happen with Xiaomi Wall Swith single and double with no neutral line.

Configuration:
Rpi docker mi-connector-arm: v.0.0.4
mi-connector-apps: v.0.0.46
Xiaomi Wall Switcth DTH: v.0.0.1
Mi-Hub: version 2

Log:
info | Try to register device to ST >> id=158d00031df4b6, type=lumi.ctrl_neutral2 [18/32]

warn | ST Smartapps couldn't add this id=158d00031df4b6, type=lumi.ctrl_neutral2!!!

error | Get Device State TypeError: deviceMap[id].target.state is not a function Error at Object.module.exports.getDeviceState (/usr/src/app/miio/miio.js:1487:55) at /usr/src/app/routes/registerST.js:20:10 at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5) at next (/usr/src/app/node_modules/express/lib/router/route.js:137:13) at isAuthenticated (/usr/src/app/routes/dashboard.js:21:12) at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5) at next (/usr/src/app/node_modules/express/lib/router/route.js:137:13) at Route.dispatch (/usr/src/app/node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5) at /usr/src/app/node_modules/express/lib/router/index.js:281:22 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 Function.handle (/usr/src/app/node_modules/express/lib/router/index.js:174:3) at router (/usr/src/app/node_modules/express/lib/router/index.js:47:12) 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)

error | Get Device Total State TypeError: deviceMap[id].target.state is not a function Error at Object.module.exports.getDeviceTotalState (/usr/src/app/miio/miio.js:1470:61) at /usr/src/app/routes/devices.js:48:10 at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5) at next (/usr/src/app/node_modules/express/lib/router/route.js:137:13) at Route.dispatch (/usr/src/app/node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5) at /usr/src/app/node_modules/express/lib/router/index.js:281:22 at param (/usr/src/app/node_modules/express/lib/router/index.js:354:14) at param (/usr/src/app/node_modules/express/lib/router/index.js:365:14) at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:410:3) at next (/usr/src/app/node_modules/express/lib/router/index.js:275:10) at Function.handle (/usr/src/app/node_modules/express/lib/router/index.js:174:3) at router (/usr/src/app/node_modules/express/lib/router/index.js:47:12) 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

gateway만 발견이 안됩니다

홈브릿지나 ha에서 잘 작동중인 게이트웨이가 mi coneector에서 자동발견이 안됩니다. wifi plug는 잘나오고 있습니다. lumi-gateway-v3 입니다.

migration from Smartthings to Hubitat

I was using this device integration with my ST hub and I was able to control my Air Purifier.

Now I installed the hubitat version of app and air purifier device.
Everything is configured same.
When I run the smart app, I guess , I just have to enter the server IP with port (192.168.254.199:30000)
then I just need to map the device, right ?

But unfortunately , the device pulldown does not show any devices.

I checked the Mi Connector server configuration and it seems the " Smartthings Settings" section is showing correct settings (IP http://192.168.254.240/apps/api/ , and other settings like access token, app id are correct)

Why can't it find my device ?

I just installed the air purifier device.
Should I also install other device types from the repo ? (I guess no, because on ST I did not)

logs only say :

app:1662021-03-19 15:28:02.828 debuginitialize
app:1662021-03-19 15:28:02.827 debugUpdated with settings: [selectedLang:English,address:192.168.254.199:30000, externalAddress:192.168.254.199:30000]

dth 몇개와 smartapp이 설치가 안됩니다.

먼저 감사말씀드립니다. ^^

github로 st에 설치시

dth의 반은 설치가 되고 반은 에러로 설치가 안됩니다.

2018-03-24 11 33 52

smartapp도 역시 github 설치가 안되고 있습니다.

2018-03-24 11 38 48

Cannot control every device

I can see only status of device but cannot control it. I try uninstall everything and install again and problem still unsolved. I can control device through openhab normal.

Thank you for your help

Token not found, miio discover shows "Token: ???"

I have one light strip and one colour light. The light strip is fine, discovers in the Mi Connector web app. I've deleted and re-connected the light but it's still the same.

I also tried to get the token from a backup of the Mi Home app, by extracting the database. Both devices were in there, but the token field was empty for both of them.

Is it possible that the Xiaomi is being more secure with the token, and that the latest version of firmware and Mi Home app both keep it secret?

Here's handshake reply output of miio discover with debug on:

  thing:miio:87425134 <- Handshake reply: <Buffer 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00> +526ms
  thing:miio:83894783 <- Handshake reply: <Buffer c5 6a 4c 97 08 e8 cc 86 11 8c 0e 2f 79 7f 69 5a> +516ms

I tried deleting and re-adding in Mi Home app. I tried resetting the light by powering off/on 5 times. I checked that it's in developer mode.

Can't get connector to run on a raspberry pi zero

I can't get this running on a pi zero.

Docker installs ok (I tried suggestions on the internet to downgrade docker but connector still won't run) so not sure if this is a docker issue or mi connector container issue as I'm not too familiar with docker. I can get it running on a pi 3 but I only need this to be in my IOT Vlan so can't justify the cost of a pi3/4 just for this app.

Any ideas?

No token found installing the latest version

Hi, I've an issue with my zhimi.airpurifier.m1: now the type is undefined, so I receive ad error: Control >> Error!!! TypeError: Cannot read property 'target' of undefined at /usr/src/app/routes/control.js:12:54

I'm using Raspberry Pi, so the error is on mi-connector-arm
Before the update everything worked fine, is it possibile to fix?

Thank you

Actual version log (I've tried also with the :latest)
Mi Connector Version >> 0.0.3.14
Finded >> But Mi-Connector can't get token from this device!!! id(47119176)
Find Device Manually but nothing token!!! >> 47119176

Old version log:
Finded >> WiFi :zhimi.airpurifier.m1 Addrress=192.168.1.4 ID=47119176, Token=6d1e63eec$
Initialize WiFi Device >> zhimi.airpurifier.m1(47119176) ip=192.168.1.4

Actions for automations on SmartThings

Hello.
Can you please add actions under automations on ST app?

On air purifier, for example:
Currently the device appears only under [if] statement. There are no actions on [then] part.
For example [if] air quality is above {threshold} [then] turn on air purifier at manual mode

no devices will add

have a gateway v3 yeelightbulb and motion sensor and door sensor and all show red and will not add manually.

on latest version - ideas?

Can we add devices across VLANS

Hi, I've just moved all of my Xiaomi devices into a different VLAN. They've all been reconnected and are functioning correctly in Mi Home.

After removing all of the old devices I've manually added them back in (including the new tokens) but all are coming back as

error | Initialize Wi-Fi Device >> Error ip(##.##.##.##), token=(###########################) : Error: Could not connect to device, handshake timeout

My MiConnector instance is sitting in a docker in the 10.1.1.0/24 subnet, the Xiaomi devices are all in 10.1.44.0/24 (VLAN 44). All routing appears to be correct and I can ping the Xiaomi devices from the docker Host.

Any idea what I can do to get cross VLAN connectivity working?

Mi Smart Plug EU Version WiFi

Hi, I wonder if this smart plug is supported? I can add it in the Mi Connector dashboard, but it ends up under Not Initialized Xiaomi Devices.

Problem about Air Purifier and Light

  1. After open Mi air purifier 2 for a while. It always show status to off while still open

  2. Please add update for Yeelight ceiling 5

  3. Cannot access some xiaomi light page in new smartthings app

ClearGrass air monitor (cgllc.airmonitor.s1) not discovered

I configure everything step by step the worst part was with getting a token from the device.
But finally, I don't see any new device in the smartthings app
The device is recognized and connected to Mi Connector:
obraz

Device handlers were added and published:
obraz

Mi connect app was installed:
obraz
obraz
How can I check what is wrong?

Mi Connector not showing in Smartthings app

Hi!
I configured everything by your guide in Samsung IDE, but Mi Connector is not showing under MyApps in Smartthings app.

Is there anything else I should configure additionally what is not written in your manual?

Any suggestions?

BR,
Stanislav

Support for zhimi.airpurifier.mb3

Hi,

thank you for a great software. It is exactly what I need. Unfortunately I have some issue with support of zhimi.airpurifier.mb3. I didn't find what circle/triangle etc in the support table means, but I assume it's not fully supported.
After I add the purifier to the connector, it can read the state of the device, but control ends with error on terminal (mi connector output). After some time, I don't get even that (it timeouts on state read).

2020-12-13 04:41:05 [info]: [ ERR ] Polling issue >> Error: Call to device timed out << zhimi.airpurifier.mb3 - miio:308348604 2020-12-13 04:41:10 [info]: [ ERR ] Polling issue >> Error: Call to device timed out << zhimi.airpurifier.mb3 - miio:308348604 2020-12-13 04:41:15 [info]: [ ERR ] Polling issue >> Error: Call to device timed out << zhimi.airpurifier.mb3 - miio:308348604

at Socket._socket.on (/usr/src/app/node_modules/miio/lib/network.js:158:14) at Socket.emit (events.js:180:13) at UDP.onMessage [as onmessage] (dgram.js:659:8) 2020-12-13 04:41:41 [error]: (node:28) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3) 2020-12-13 04:41:45 [info]: [ ERR ] Polling issue >> Error: Call to device timed out << zhimi.airpurifier.mb3 - miio:308348604 2020-12-13 04:41:47 [error]: (node:28) UnhandledPromiseRejectionWarning: Error: Call to device timed out at Timeout.retry [as _onTimeout] (/usr/src/app/node_modules/miio/lib/network.js:490:23) at ontimeout (timers.js:466:11) at tryOnTimeout (timers.js:304:5) at Timer.listOnTimeout (timers.js:267:5) 2020-12-13 04:41:47 [error]: (node:28) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)

Is the code of the node service available anywhere? I can grab it from the container, but would be nice to work with git repo instead and maybe dockerfile.

Btw, at some point I saw that I was able to control the device, but changes in dth had a different result than anticipated (like full fan speed, instead of low speed etc.)

Xiaomi Air Purifier can't get token

I'm trying to add Xiaomi Air Purifier 3H. The Mi connector finds the device through search functionality. However, the token value is empty and the logs shows: Mi-Conector find new device(192.168.3.24, No Token) at Auto Mode. But can't get token from this!!!

It looks like there's just no token. Mi connector recognizes the auto mode and it should be able to connect.

Also, the device type is not recognized. It's just empty. I wonder if this is because I'm using the Europe server (my devices can only connect to that one)

Xiaomi light strip 2

Hi

Thanks for the great software!

I’m having issues with xiaomi mi light strip 2 (recognized as 192.168.1.221 | yeelink.light.strip2)
I managed that it got shown on smartthings as device, however any action is not reflected on the device.

Any thoughts? thanks a lot

Best

Log:

Date Type Content
2019-10-26 15:06:53 info Succes to add to Smartthings >> yeelink.light.strip2(131687781)
2019-10-26 15:06:53 info Try to register device to ST >> id=131687781, type=yeelink.light.strip2 [1/1]
2019-10-26 13:55:02 info Succes to add to Smartthings >> yeelink.light.strip2(131687781)
012B0B25-AF29-4710-A71C-52EBF78B1AF4
9B59CED6-EB29-4CB1-B93F-554BFF4875BA
779E4A4C-F551-4C7C-BE6A-BB55D2136B5E
E98FB343-55D6-4A8D-A493-C993AEB1705C

Use influxdb instead of MySQL

Hello.
I want to install Mi Connector to my current raspberry pi setup.
I have already installed influxdb database for other projects that I’m running.

Is there a workaround or something that I can to use influxdb with Mi connector instead of MySQL?

Thanks.

zhimi.airpurifier.m1 No control over device.

I believe this device is not officially supported as per your readme however It adds to ST fine and I can instantly monitor changes using ST DTH. However I can't seem to control the device :( None of the buttons perform any action.

Any idea when this support would be added? Many of my friends and I would very grateful.

MiFlora not updating

Hi
I've had the MiFlora working for some weeks, but about 1-2 months ago, the sensors are not updating in the app. From the management port (i.e. raspberry:30000), I can see that the link to smartthings is working properly (using "test").

The new values are updated in the app, when I restart the docker container.

When I download the app, I get the following log:

2019-07-11 11:25:47 [Mi-Connector] info: Bluetooth - Mi Flora scan
2019-07-11 11:26:08 [Mi-Connector] error: (node:23) UnhandledPromiseRejectionWarning: Error: timeout
    at Timeout.setTimeout [as _onTimeout] (/usr/src/app/node_modules/miflora/lib/miflora-device.js:23:20)
    at ontimeout (timers.js:466:11)
    at tryOnTimeout (timers.js:304:5)
    at Timer.listOnTimeout (timers.js:267:5)
2019-07-11 11:26:08 [Mi-Connector] error: (node:23) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3126)
2019-07-11 11:26:08 [Mi-Connector] error: (node:23) UnhandledPromiseRejectionWarning: Error: timeout
    at Timeout.setTimeout [as _onTimeout] (/usr/src/app/node_modules/miflora/lib/miflora-device.js:23:20)
    at ontimeout (timers.js:466:11)
    at tryOnTimeout (timers.js:304:5)
    at Timer.listOnTimeout (timers.js:267:5)
2019-07-11 11:26:08 [Mi-Connector] error: (node:23) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3127)
2019-07-11 11:26:08 [Mi-Connector] error: (node:23) UnhandledPromiseRejectionWarning: Error: timeout
    at Timeout.setTimeout [as _onTimeout] (/usr/src/app/node_modules/miflora/lib/miflora-device.js:23:20)
    at ontimeout (timers.js:466:11)
    at tryOnTimeout (timers.js:304:5)
    at Timer.listOnTimeout (timers.js:267:5)
2019-07-11 11:26:08 [Mi-Connector] error: (node:23) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3128)
2019-07-11 11:26:16 [Mi-Connector] info: Bluetooth - Mi Temperature scan

Is it possible that Roborock mode is changing Air Purifier mode?

I am experiencing a very strange problem where Sir Purifier automatically changes mode from favorite to auto.

I think I have narrowed it down that when the Roborock goes back to charge, for some reason it switches the mode of the air purifier.

Do you think the SmartThings appnis doing something to change this? Or am I looking in the wrong place?

Do I need SmartThings hub to make it works?

Maybe it's stupid question, but I haven't bought SmartThings hub yet, so I don't know it it's required to use SmartThings ide etc. In the documentation there is only ide mentioned. So I wonder if I need SmartThings hub?

Robot Vacuum manually added but not added on my devices on ST app.

Robot Vacuum manually added but not added on my devices on ST app.

Followed all instructions using raspberry pi. Manually added device on mi-connector using ip and token. Mi-connector added in smartapps and all device handlers integrated from github.

Restarted docker container and removed and added vacuum a couple of times, still no luck. Please help. Thanks.

ESP32 Bluetooth

Hello,

First, thanks for the great project.
I'm trying to add some Bluetooth devices to my smart home.
I have the following sensor:
image
The mi connector is showing me that I have connect a ble.temperature, I got an ID.
On the ESP32 board, I see that the sensor is sending temperature and humidity, but I cannot make it work on smartthings hub. Which dth do you use? How do you add it?

Let me know if you need other information. Thanks

No token and type

@fison67 First of all, congrats for this big project called Mi-connector.
So, I've installed on linux, but the mi-connector is not able to detect the type and token. Do you have any tip to solve this problem?
no_token

Xiaomi devices not supported (dreame.vacuum.mc1808 and chuangmi.camera.ipc019)

Hi,

I was trying to add my Xiaomi devices (camera and vacuum) to SmartThings using this tool. These are the only devices I have on Mi Home. The rest of Xiaomi devices were added to ST via custom DTHs.

However, bad luck for me. Both devices say not supported in the logs page:
2021-01-22 14:40:56 | warn | This dreame.vacuum.mc1808 is not supported now
2021-01-22 14:40:46 | warn | This chuangmi.camera.ipc019 is not supported now

Any plans to add support for it? If I knew how, I would do it myself :)

Thanks.

Xiaomi Air Purifier 3

Hi,
I have problem to add Xiaomi Air Purifier 3 (zhimi.airpurifier.mb3) to Mi Connector. Info from log:

Initialize Wi-Fi Device >> Error ip(192.168.0.240), token=(*************************) : Error: Could not connect to device, handshake timeout

Has something changed in new Xiaomi API? There is no problem with Roborock S6 (roborock.vacuum.s6) which is also not on the supported devices list.

lumi.ctrl_neutral2

Hi , I use mi connector whit smarthing hub and xiaomi gateway v3. All my device work well, bluetooth and zigbee, but can't use whit lumi.ctrl_neutral2. I got this error in my log, What im doing wrong whit it ?

Get Device State TypeError: deviceMap[id].target.state is not a function Error at Object.module.exports.getDeviceState (/usr/src/app/miio/miio.js:1452:55) at /usr/src/app/routes/registerST.js:20:10 at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5) at next (/usr/src/app/node_modules/express/lib/router/route.js:137:13) at isAuthenticated (/usr/src/app/routes/dashboard.js:21:12) at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5) at next (/usr/src/app/node_modules/express/lib/router/route.js:137:13) at Route.dispatch (/usr/src/app/node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5) at /usr/src/app/node_modules/express/lib/router/index.js:281:22 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 Function.handle (/usr/src/app/node_modules/express/lib/router/index.js:174:3) at router (/usr/src/app/node_modules/express/lib/router/index.js:47:12) 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)

lumi.ctrl_ln2.aq1 not recognised by mi connect

Hi,
I'm having issues connecting a lumi.ctrl_ln2.aq1 to mi connect. Here is what appears to happen:

In the Mi Home app (Hub info page) the device is identified as :{"model":"lumi.ctrl_ln2.aq1","did":"lumi.158d00023b265c","name":"Hall Light"}

When this is pulled into the mi connector application, on the page Add device [ST] it comes up as follows:

  • | 192.168.1.24 | lumi.generic.64 | 158d00023b265c

Then I attempt to register the device, mi connect throws an error. This doesn't happen for any other devices (I also have a lumi.ctrl_neutral2 which works fine).

Any thoughts?
Thank you

PS: Fantastic tool.
NB: The gateway tokens now appear in the "Hub info" page of the Mi Home app once the wireless communication protocol, so no need to try to strip them out of the DB any more.

Get Data from ST is failed....

After registration device handler and smart app in samsung cloud(steps from manual), i can't connect to Samsund cloud via mi-connector

always receive following message in log:
Get Data from ST is failed....

Lumi gateway has been successfully found and child devices are found too.
But still cant connect to samsung cloud((

Works on synology docker.

Not issue but info

Flag zhimi.airpurifier.m1 as tested, I've got it and it works perfectly.

screen shot 2018-07-28 at 08 11 38

lumi.ctrl_ln1.aq1 not supported

Hi,

Found another device ID that is not supported in your docker image: lumi.ctrl_ln1.aq1

In /usr/src/app/node_modules/miio/lib/devices/gateway/subdevices.js the following entry needs to be added to the module.exports:

63: require('./ctrl_ln1'),

Kind Regards

  • Oliver

미커넥터 설치 후 동작 문제

DTH 및 스마트앱도 설치를 마쳤습니다.
큐냅 나스에 미커넥터 설치를 했는데..
로그상으로는 이슈가 없는 거 같은데 샤오미 기기를 가져오질 못합니다.
설정 페이지에서 테스트 버튼을 클릭할 경우 Error 가 발생하구요
해결할 방법이 있을까요?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.