[miio] Implement lumi devices support for gateways (#11688)

* [miio] Implement lumi devices support for gateways v3 WIP

Adding support for the following models:
* Aqara LED Light Bulb (Tunable White) (modelId: lumi.light.aqcn02)
* IKEA E27 white spectrum opal (modelId: ikea.light.led1545g12)
* IKEA E27 white spectrum clear (modelId: ikea.light.led1546g12)
* IKEA E14 white spectrum (modelId: ikea.light.led1536g5)
* IKEA GU10 white spectrum (modelId: ikea.light.led1537r6)
* IKEA E27 warm white (modelId: ikea.light.led1623g12)
* IKEA GU10 warm white (modelId: ikea.light.led1650r5)
* IKEA E14 warm white (modelId: ikea.light.led1649c5)
* Door lock (modelId: lumi.lock.v1)
* Aqara Door Lock (modelId: lumi.lock.aq1)
* Aqara Door Lock S2 (modelId: lumi.lock.acn02)
* Aqara Door lock S2 Pro (modelId: lumi.lock.acn03)
* Mi Smart Plug (Zigbee) (modelId: lumi.plug.mmeu01)
* Mi Temperature and Humidity Sensor (modelId: lumi.sensor_ht.v1)
* Mi Window and Door Sensor (modelId: lumi.sensor_magnet.v2)
* Mi Motion Sensor (modelId: lumi.sensor_motion.v2)
* Water Leak Sensor (modelId: lumi.sensor_wleak.aq1)
* Aqara Temperature and Humidity Sensor (modelId: lumi.weather.v1)

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>

* Work in progress support plug

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>

* [miio] cleanup, improve messages and initialization

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>

* [miio] Cleanup to prepare for PR

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>

* [miio] add missing placeholder

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>

* [miio] resolve merge issue

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>

* [miio] update readme after rebase

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>

* [miio] Update from review comments and warnings/checkstyle cleanup

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>

* [miio] update readme after merge and update json to updated format

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>

* [miio] Improve online indication

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>

* reset

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>

* Update readme

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>

* [miio] update from review comments

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>

* [miio] feedback codereview

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
This commit is contained in:
Marcel
2022-01-22 18:57:01 +01:00
committed by GitHub
parent 03b53475ba
commit d196dc2c92
37 changed files with 1922 additions and 521 deletions

View File

@@ -15,6 +15,8 @@ The following things types are available:
| miio:generic | Generic type for discovered devices. Once the token is available and the device model is determined, this ThingType will automatically change to the appropriate ThingType |
| miio:vacuum | For Xiaomi/RoboRock Robot Vacuum products |
| miio:basic | For most other devices like yeelights, airpurifiers. Channels and commands are determined by database configuration |
| miio:gateway | Similar to basic, but with the Bridge feature, it can support to forward commands for connected devices |
| miio:lumi | Thing type for subdevices connected to the gateway. Note, these devices require a defined gateway to function |
| miio:unsupported | For experimenting with other devices which use the Mi IO protocol or to build experimental support |
# Discovery
@@ -86,6 +88,7 @@ However, for devices that are unsupported, you may override the value and try to
Note: Suggest to use the cloud communication only for devices that require it.
It is unknown at this time if Xiaomi has a rate limit or other limitations on the cloud usage. e.g. if having many devices would trigger some throttling from the cloud side.
Note2: communications parameter is not available for lumi devices. Lumi devices communicate using the bridge/gateway.
### Example Thing file
@@ -95,6 +98,11 @@ or in case of unknown models include the model information of a similar device t
`Thing miio:vacuum:s50 "vacuum" @ "livingroom" [ host="192.168.15.20", token="xxxxxxx", deviceId="326xxxx", model="roborock.vacuum.s4", communication="direct", cloudServer="de" ]`
in case of gateway, instead of defining it as a Thing, use Bridge
`Bridge miio:gateway:lumigateway "Mi Smarter Gateway" [ host="10.10.x.x", token="put here your token", deviceId="326xxxx", model="lumi.gateway.mieu01", communication="direct", cloudServer="de" ]`
# Advanced: Unsupported devices
Newer devices may not yet be supported.
@@ -177,6 +185,9 @@ This will change the communication method and the Mi IO binding can communicate
# Mi IO Devices
!!!devices
note: Supported means we received feedback from users this device is working with the binding.
For devices with experimental support, we did not yet confirmation that channels are correctly working.
Please feedback your findings for these devices (e.g. Are all channels working, do they contain the right information, is controlling the devices working etc.)
# Channels