Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[miio] add gosund plug & Vacuum 1C STYTJ01ZHM #7452

Merged
merged 2 commits into from
Apr 23, 2020

Conversation

marcelrv
Copy link
Contributor

[miio] add gosund plug & Vacuum 1C STYTJ01ZHM

Add 2 miot devices
Vacuum 1C STYTJ01ZHM dreame.vacuum.mc1808
cuco goplug cuco.plug.cp1

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

Add 2 miot devices
Vacuum 1C STYTJ01ZHM dreame.vacuum.mc1808
cuco goplug cuco.plug.cp1

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
@marcelrv marcelrv requested a review from cpmeister April 22, 2020 23:42
@TravisBuddy
Copy link

Travis tests were successful

Hey @marcelrv,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

Comment on lines 1170 to 1171
| TotalCleanArea | String | clean- |
| CleanLogStartTime | String | clean- |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description is missing for these.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep. fixed

Comment on lines +1174 to +1176
| LifeSieve | String | consumable-life-sieve |
| LifeBrushSide | String | consumable-life-brush-side |
| LifeBrushMain | String | consumable-life-brush-main |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these supposed to be percentage values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see the long comment below

Comment on lines +1168 to +1169
| TotalCleanTime | String | clean-total time |
| TotalCleanTimes | String | clean-total times |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the difference between these fields? Can they be Number:Time instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I don't know. see the long comment below

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But, given the names, I expect that the one is the (clock) time of the cleaning and the other the amount of times the machine has cleaned. Similar counts are for the other Xiaomi vacuum cleaners available.

btw, it is still on my wish list #7276 to have the binding deal with Number:Time sort of notation. I expect it is not a huge effort, but I have not looked deeper into it what would be the detailed impact to the updating process and the possible impact in handling of the commands

@marcelrv
Copy link
Contributor Author

marcelrv commented Apr 23, 2020

Hallo @cpmeister

This is a so called miot device, which is following the new protocol Xiaomi is trying to implement for their devices. (I think they are slowly moving all their devices to it)

For these devices they publish the definitions e.g. for the vacuum here.
http://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:vacuum:0000A006:dreame-mc1808:1

The OH database json file is a translation of that file, incl the data types.
So, I don't really intend to change the data types e.g. string/number/etc and stick to the published definition unless we have confirmation from a user that owns such a device what it outputs.
Having said that, I did see a new element in the definition "unit":"percentage", so I may be able to make the conversion more smart in that respect. (the alpha version of the conversion tool is here https://github.com/marcelrv/openhab2/tree/miio-miot-databaseCreator )

In the end my intention is that these can be added directly by the user in the miio:unsupported handler ( #7276 )

But before that, I want to give it a try for a few devices to see if it gives meaningful results.
e.g. I found indeed several properties miss the description. I fixed most of them, but seems I missed one.

note, the list of devices that support this (miot) protocol is already rather big (total list of Xiaomi devices >1500 by now)
Mi Air Purifier 3 (zhimi.airpurifier.ma4)
Mi Air Purifier 3/3H (zhimi.airpurifier.mb3)
were done with the initial PR, now 2 more.

One meter intelligent curtain (090615.curtain.1mcu01)
PTX Rolling curtain (090615.curtain.jldj03)
Intelligent 86 socket(WIFI) (090615.plug.plus01)
Intelligent Mobile Plug (WIFI) (090615.plug.plus02)
Piak intelligent one switch (090615.switch.piak01)
Piak intelligent two switch (090615.switch.piak02)
Piak intelligent three switch (090615.switch.piak03)
Ai-Thinker Smart Socket (180.plug.plug0001)
Smart Curtain Motor (666.curtain.gt01)
Airmate mobile floor heating (air.heater.wda14)
Nnuodu Intelligent Living Room Lamp (app.light.wynd1)
Feipujia Intelligent lamps and lanterns (asdds.light.wyfpj1)
AUTORAIL Curtain Motor (babai.curtain.at5810)
MTX Smart Curtain (babai.curtain.mtx850)
Babuy Smart Curtain (babai.curtain.bb82mj)
NanHoo Smart Curtain (babai.curtain.nh5810)
WiFi Wall Switch A1 (babai.switch.bb101s)
WiFi Wall Switch A3 (babai.switch.bb103s)
Smart Curtain Motor (babai.curtain.190812)
WiFi Wall Switch A1 (babai.switch.bb101s)
WiFi Wall Switch A2 (babai.switch.bb102s)
WiFi Wall Switch A3 (babai.switch.bb103s)
LOMEDIQI Intelligent automatic air purifier (bjdm.airfresh.test01)
Qingfly smart portable clothes dryer (coc.dryer.fdpsm)
Heatcold Heat Pump Thermostat (cubee.airrtc.th125t)
Heatcold UFH Thermostat (cubee.airrtc.th123w)
Heatcold FCU thermostat (cubee.airrtc.th125a)
Heatcold Heating Thermostat (cubee.airrtc.th123e)
Gosund Smart Plug (cuco.plug.cp1)
Gosund Socket (cuco.plug.cp2)
Cuco Smart Plug (wifi) Basic (cuco.plug.wp5)
Muzi Intelligent Light (cxds.light.wymz01)
NIOYE Intelligent lamp (ddk.light.wy0a01)
Deye dehumidifier (deye.derh.u20a3)
Dimi RO water purifier 650G (dmaker.waterpuri.600g)
DooyaSmartCurtain (dooya.curtain.m1)
Xiaomi Mijia Vacuum-Mop 1C (dreame.vacuum.mc1808)
A300 Splendid Laser Projector (fengmi.projector.l166)
Mi Laser Projector (fengmi.projector.l185)
Peak meter projector Vogue (fengmi.projector.m135f)
Fantong Intelligent Lamp (ftds.light.wyft1)
Gomanni Scene two color ceiling lamp (gmn.light.wy0w01)
MiWhole Air Purifier Mix (hanyi.airpurifier.kj550)
Langli intelligent LED ceiling lamp (hcznjj.light.wyll01)
Smart electric blanket (hddz.blanket.zndrt)
Hadaman intelligent LED ceiling lamp (hdm.light.wy08a)
HUAYI HUIZUO ARIES For Bedroom (huayi.light.ari013)
HUAYI HUIZUO ARIES For Living Room (huayi.light.aries)
HUAYI HUIZUO Fan Light (huayi.light.fanwy)
HUAYI HUIZUO PEGASUS For Living Room (huayi.light.peg091)
HUAYI HUIZUO PEGASUS For Bedroom (huayi.light.peg093)
HUAYI HUIZUO PISCES For Bedroom (huayi.light.pis123)
HUAYI HUIZUO PISCES For Living Room (huayi.light.pisces)
HUAYI HUIZUO TAURUS For Bedroom (huayi.light.tau023)
HUAYI HUIZUO TAURUS For Living Room (huayi.light.taurus)
HUAYI HUIZUO VIRGO For Bedroom (huayi.light.vir063)
HUAYI HUIZUO VIRGO For Living Room (huayi.light.virgo)
HUAYI HUIZUO Ceiling Light (huayi.light.wy)
Lifan Nordic Intelligent Lamp (hyzm.light.wymy1)
Danfino Intelligent Roof Suction Lamp (jsc.light.wydfn1)
Scene Ble mesh light (jsc.light.wyls02)
Yantai Intelligent Lamp (jsc.light.wyyt01)
Xiangyu intelligent LED ceiling lamp (jxgc.light.wyxy1)
Jya Convection Heater (jya.heater.sha1)
NVC LED Smart Ceiling Lamp (leishi.light.eps112)
Scene Ble mesh light A (lejia.light.33301)
Scene mesh color temperature lamp C (lejia.light.wy02)
Scene Color Light WIFI X (lemesh.light.wy)
Scene mesh color temperature lamp (lemesh.light.wy0c02)
Scene mesh color temperature lamp D (lemesh.light.wy0c03)
Scene mesh breaker (lemesh.switch.sw0a01)
Scene Curtain WIFI X (leshi.curtain.v0001)
Smart Switch WIFI X (leshi.switch.v0001)
Switch Breaker WIFI X (leshi.switch.v002)
Linptech Smart Wall Switch(1 Key) (linp.switch.q31)
Linptech Smart Wall Switch(2 Keys) (linp.switch.q32)
Linptech Smart Wall Switch(3 Keys) (linp.switch.q33)
Shengxin Intelligent lamp (lsds.light.wy0a01)
Lige lighting (ltdzsw.light.wylg1)
Xiaomiyoupin Curtain Controller (Wi-Fi) (lumi.curtain.hagl05)
Mi Smart Home Hub (lumi.gateway.mgl03)
Mi Light Detection Sensor (lumi.sen_ill.mgl01)
Aqara Smart Smoke Detector(NB-IoT) (lumi.sensor_smoke.acn01)
Smart Low Voltage Blanket Double (miaomiaoce.blanket.d02)
Smart Low Voltage Blanket Single (miaomiaoce.blanket.s02)
Cat and dog water fountain (mmgg.pet_waterer.s1)
MR.BOND (mrbond.airer.m2)
MR.BOND (mrbond.airer.m2pro)
MR.BOND Smart Curtain (mrbond.curtain.rac03)
NEW WIDETECH Internet Dehumidifier 12L (nwt.derh.312en)
NWT Internet Dehumidifier 30L (nwt.derh.330ef)
Ougenuo Intelligent lamp (ougn.light.wy0a01)
Zhirui Ceiling Lamp Nordic 40W (philips.light.mceilm)
Zhirui Ceiling Lamp Nordic 28W (philips.light.mceils)
Zhirui Ceiling Lamp Nordic 80W (philips.light.mceil)
Puzhuoer Smart Light (pze.light.wy0a01)
8H Milan smart electric bed (qushui.bed.001)
RBE wisdow living room lamp (rbe.light.wy0a01)
M-YF6002A Smart Bathroom Heater (roome.bhf_light.yf6004)
Petoneer AirMaster (skyrc.airpurifier.pur)
Chanitex Water-heated mattress CXM-A1 (smith.blanket.cxma1)
Shengteng Lighting Ceiling Light (stds.light.wyst01)
Shengteng Ceiling Light (stds.light.wyst02)
Bijia Fresh Air Ventilator (szdy.airfresh.n80)
DanceLight I wisdom kanLamp (tsd.light.tsl001)
Viomi Smart Bath Heater PRO (viomi.bhf_light.v3)
Viomi Smart IH Rice Cooker 3L (viomi.cooker.v4)
Viomi Kick-Line heater Pro (viomi.heater.vxtj01)
WinTom Curtain (wintom.curtain.230xm)
Ocooker hood (xckj.hood.z9001)
Ocooker french refrigerator with four doors (xckj.fridge.448ws4)
Ocooker dishwasher (xckj.dishwasher.idw01)
Ocooker smart refrigerator for kitchen (xckj.fridge.151wg1)
Romne Intelligent lamp (xgds.light.wy0a01)
Mi Smart Air Conditioner A (1HP / Inverter / China Energy Label Level 1) (xiaomi.aircondition.mc1)
Mi Smart Air Conditioner A (1.5HP / Inverter / China Energy Label Level 1) (xiaomi.aircondition.mc2)
Mi Smart Air Conditioner A (1HP / Inverter / China Energy Label Level <1) (xiaomi.aircondition.mc4)
Mi Smart Air Conditioner A (1.5HP / Inverter / China Energy Label Level <1) (xiaomi.aircondition.mc5)
Mi Smart Vertical Air Conditioner A (2HP / Inverter / China Energy Label Level <1) (xiaomi.aircondition.mc6)
Mi Smart Vertical Air Conditioner A (3HP / Inverter / China Energy Label Level <1) (xiaomi.aircondition.mc7)
Letsleep one click smart aqua-heat mattress (xinyue.blanket.n1918)
Xi Zhi Xi Intelligent Lamp (xzx.light.wyxzx1)
Yeelight Smart Curtain Controller (yeelink.curtain.ctmt1)
Yeelight Mesh LED Downlight (yeelink.light.dnlight2)
Yeelight Smart Ceiling Fan (yeelink.light.fancl1)
Yeelight Mesh LED Bulb (yeelink.light.meshbulb1)
Yeelight Mesh LED Bulb (yeelink.light.meshbulb2)
Yeelight Mesh LED Spotlight (yeelink.light.spot1)
Mi Smart Bluetooth Mesh LED Downlight (yeelink.light.light3)
Mi Smart Bluetooth Mesh LED Bulb (yeelink.light.mbulb3)
Feihong lighting (yhzm.light.wyfh01)
Leiyuan Intelligent Living Room Lamp (ylzm.light.wyly01)
EMG Top halo ceiling lamp (ymj.light.wyymj1)
Mi Air Purifier 3 (zhimi.airpurifier.ma4)
Mi Air Purifier 3/3H (zhimi.airpurifier.mb3)
Mi Air Purifier Pro H (zhimi.airpurifier.va1)
Mi Smart Space Heater S (zhimi.heater.ma2)
Smartmi Smart Fan (zhimi.heater.na1)
Smartmi Smart Convector Heater 1S (zhimi.heater.za2)
Smartmi Smart Convector Heater 1S (zhimi.heater.zb1)
Smartmi Evaporative Humidifier 2 (zhimi.humidifier.ca4)
ZSZM Intelligent ceiling lamp (zszm.light.wy0a03

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

@cpmeister cpmeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cpmeister cpmeister added the enhancement An enhancement or new feature for an existing add-on label Apr 23, 2020
@TravisBuddy
Copy link

Travis tests were successful

Hey @marcelrv,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@cpmeister cpmeister merged commit 518e507 into openhab:2.5.x Apr 23, 2020
@cpmeister cpmeister added this to the 2.5.5 milestone Apr 23, 2020
yfre pushed a commit to yfre/openhab-addons that referenced this pull request Apr 27, 2020
* [miio] add gosund plug & Vacuum 1C STYTJ01ZHM

Add 2 miot devices
Vacuum 1C STYTJ01ZHM dreame.vacuum.mc1808
cuco goplug cuco.plug.cp1

* [miio] add missing channel descriptions

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
Signed-off-by: Eugen Freiter <freiter@gmx.de>
@marcelrv marcelrv deleted the miio-cucoplug branch May 7, 2020 20:39
LoungeFlyZ pushed a commit to LoungeFlyZ/openhab2-addons that referenced this pull request Jun 8, 2020
* [miio] add gosund plug & Vacuum 1C STYTJ01ZHM

Add 2 miot devices
Vacuum 1C STYTJ01ZHM dreame.vacuum.mc1808
cuco goplug cuco.plug.cp1

* [miio] add missing channel descriptions

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
J-N-K pushed a commit to J-N-K/openhab-addons that referenced this pull request Jul 14, 2020
* [miio] add gosund plug & Vacuum 1C STYTJ01ZHM

Add 2 miot devices
Vacuum 1C STYTJ01ZHM dreame.vacuum.mc1808
cuco goplug cuco.plug.cp1

* [miio] add missing channel descriptions

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
CSchlipp pushed a commit to CSchlipp/openhab-addons that referenced this pull request Jul 26, 2020
* [miio] add gosund plug & Vacuum 1C STYTJ01ZHM

Add 2 miot devices
Vacuum 1C STYTJ01ZHM dreame.vacuum.mc1808
cuco goplug cuco.plug.cp1

* [miio] add missing channel descriptions

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
Signed-off-by: CSchlipp <christian@schlipp.de>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* [miio] add gosund plug & Vacuum 1C STYTJ01ZHM

Add 2 miot devices
Vacuum 1C STYTJ01ZHM dreame.vacuum.mc1808
cuco goplug cuco.plug.cp1

* [miio] add missing channel descriptions

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* [miio] add gosund plug & Vacuum 1C STYTJ01ZHM

Add 2 miot devices
Vacuum 1C STYTJ01ZHM dreame.vacuum.mc1808
cuco goplug cuco.plug.cp1

* [miio] add missing channel descriptions

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* [miio] add gosund plug & Vacuum 1C STYTJ01ZHM

Add 2 miot devices
Vacuum 1C STYTJ01ZHM dreame.vacuum.mc1808
cuco goplug cuco.plug.cp1

* [miio] add missing channel descriptions

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* [miio] add gosund plug & Vacuum 1C STYTJ01ZHM

Add 2 miot devices
Vacuum 1C STYTJ01ZHM dreame.vacuum.mc1808
cuco goplug cuco.plug.cp1

* [miio] add missing channel descriptions

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
DaanMeijer pushed a commit to DaanMeijer/openhab-addons that referenced this pull request Sep 1, 2020
* [miio] add gosund plug & Vacuum 1C STYTJ01ZHM

Add 2 miot devices
Vacuum 1C STYTJ01ZHM dreame.vacuum.mc1808
cuco goplug cuco.plug.cp1

* [miio] add missing channel descriptions

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
Signed-off-by: Daan Meijer <daan@studioseptember.nl>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this pull request Sep 19, 2020
* [miio] add gosund plug & Vacuum 1C STYTJ01ZHM

Add 2 miot devices
Vacuum 1C STYTJ01ZHM dreame.vacuum.mc1808
cuco goplug cuco.plug.cp1

* [miio] add missing channel descriptions

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants