From c03534dc15ec28e9aaf935a218ff4b8a15e75d76 Mon Sep 17 00:00:00 2001 From: Marcel Date: Wed, 17 Apr 2024 18:54:27 +0200 Subject: [PATCH] [miio] Add Yeelight W3 RGB (#16659) * fix: Added Yeelight W3 RGB props cherrypicked from #7717221 Signed-off-by: Marcel Verpaalen * [miio] update readme Signed-off-by: Marcel Verpaalen Co-authored-by: Igor Svehla Signed-off-by: Ciprian Pascu --- bundles/org.openhab.binding.miio/README.md | 30 +++++++++++++++++++ .../binding/miio/internal/MiIoDevices.java | 1 + .../resources/OH-INF/i18n/basic.properties | 1 + .../database/yeelink.light.color1.json | 3 +- 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.miio/README.md b/bundles/org.openhab.binding.miio/README.md index 19f6baa3a26..abe1121cbc7 100644 --- a/bundles/org.openhab.binding.miio/README.md +++ b/bundles/org.openhab.binding.miio/README.md @@ -505,6 +505,7 @@ Currently the miio binding supports more than 360 different models. | Yeelight LED Bulb 1S(Color) | miio:basic | [yeelink.light.color4](#yeelink-light-color4) | Yes | | | Mi Smart LED Bulb Essential (White and Color) | miio:basic | [yeelink.light.color5](#yeelink-light-color5) | Yes | | | Yeelight Smart LED Bulb 1SE (color) | miio:basic | [yeelink.light.colora](#yeelink-light-colora) | Yes | | +| Yeelight Smart LED Bulb W3 (color) | miio:basic | [yeelink.light.colorb](#yeelink-light-colorb) | Yes | | | Yeelight LED Bulb (Tunable) | miio:basic | [yeelink.light.ct2](#yeelink-light-ct2) | Yes | | | Mi LED Desk Lamp | miio:basic | [yeelink.light.lamp1](#yeelink-light-lamp1) | Yes | | | Mi Smart LED Desk Lamp Pro | miio:basic | [yeelink.light.lamp2](#yeelink-light-lamp2) | Yes | | @@ -4403,6 +4404,19 @@ Note, not all the values need to be in the json file, e.g. a subset of the param | colorflow | Switch | Color Flow | | | name | String | Name | | +### Yeelight Smart LED Bulb W3 (color) (yeelink.light.colorb) Channels + +| Channel | Type | Description | Comment | +|----------------------------|----------------------|------------------------------------------|------------| +| power | Switch | Power | | +| brightness | Dimmer | Brightness | | +| delayoff | Number:Time | Shutdown Timer | | +| colorTemperature | Number | Color Temperature | | +| rgbColor | Color | RGB Color | | +| colorMode | Number | Color Mode | Note, currently only supporting switching to RGB or CT mode. Value mapping `["0"="Default","2"="CT mode","1"="RGB mode","3"="HSV mode","4"="Color Flow mode","5"="Night Light mode"]` | +| colorflow | Switch | Color Flow | | +| name | String | Name | | + ### Yeelight LED Bulb (Tunable) (yeelink.light.ct2) Channels | Channel | Type | Description | Comment | @@ -10736,6 +10750,22 @@ Switch colorflow "Color Flow" (G_light) {channel="miio:basic:light:colorflow"} String name "Name" (G_light) {channel="miio:basic:light:name"} ``` +### Yeelight Smart LED Bulb W3 (color) (yeelink.light.colorb) item file lines + +note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. + +```java +Group G_light "Yeelight Smart LED Bulb W3 (color)" +Switch power "Power" (G_light) {channel="miio:basic:light:power"} +Dimmer brightness "Brightness" (G_light) {channel="miio:basic:light:brightness"} +Number:Time delayoff "Shutdown Timer" (G_light) {channel="miio:basic:light:delayoff"} +Number colorTemperature "Color Temperature" (G_light) {channel="miio:basic:light:colorTemperature"} +Color rgbColor "RGB Color" (G_light) {channel="miio:basic:light:rgbColor"} +Number colorMode "Color Mode" (G_light) {channel="miio:basic:light:colorMode"} +Switch colorflow "Color Flow" (G_light) {channel="miio:basic:light:colorflow"} +String name "Name" (G_light) {channel="miio:basic:light:name"} +``` + ### Yeelight LED Bulb (Tunable) (yeelink.light.ct2) item file lines note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoDevices.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoDevices.java index 308a357d3ae..61e652c4008 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoDevices.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoDevices.java @@ -356,6 +356,7 @@ public enum MiIoDevices { YEELINK_LIGHT_COLOR4("yeelink.light.color4", "Yeelight LED Bulb 1S(Color)", THING_TYPE_BASIC), YEELINK_LIGHT_COLOR5("yeelink.light.color5", "Mi Smart LED Bulb Essential (White and Color)", THING_TYPE_BASIC), YEELINK_LIGHT_COLORA("yeelink.light.colora", "Yeelight Smart LED Bulb 1SE (color)", THING_TYPE_BASIC), + YEELINK_LIGHT_COLORB("yeelink.light.colorb", "Yeelight Smart LED Bulb W3 (color)", THING_TYPE_BASIC), YEELINK_LIGHT_CT2("yeelink.light.ct2", "Yeelight LED Bulb (Tunable)", THING_TYPE_BASIC), YEELINK_LIGHT_LAMP1("yeelink.light.lamp1", "Mi LED Desk Lamp", THING_TYPE_BASIC), YEELINK_LIGHT_LAMP2("yeelink.light.lamp2", "Mi Smart LED Desk Lamp Pro", THING_TYPE_BASIC), diff --git a/bundles/org.openhab.binding.miio/src/main/resources/OH-INF/i18n/basic.properties b/bundles/org.openhab.binding.miio/src/main/resources/OH-INF/i18n/basic.properties index a13c88959ea..853b5847559 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/OH-INF/i18n/basic.properties +++ b/bundles/org.openhab.binding.miio/src/main/resources/OH-INF/i18n/basic.properties @@ -297,6 +297,7 @@ thing.yeelink.light.color3 = Mi LED Smart Bulb (White and Color) thing.yeelink.light.color4 = Yeelight LED Bulb 1S(Color) thing.yeelink.light.color5 = Mi Smart LED Bulb Essential (White and Color) thing.yeelink.light.colora = Yeelight Smart LED Bulb 1SE (color) +thing.yeelink.light.colorb = Yeelight Smart LED Bulb W3 (color) thing.yeelink.light.ct2 = Yeelight LED Bulb (Tunable) thing.yeelink.light.lamp1 = Mi LED Desk Lamp thing.yeelink.light.lamp2 = Mi Smart LED Desk Lamp Pro diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/yeelink.light.color1.json b/bundles/org.openhab.binding.miio/src/main/resources/database/yeelink.light.color1.json index 4cf86731c38..e44f8be7ff9 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/yeelink.light.color1.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/yeelink.light.color1.json @@ -11,7 +11,8 @@ "yeelink.light.bslamp1", "yeelink.light.bslamp2", "yeelink.light.bslamp3", - "yeelink.light.colora" + "yeelink.light.colora", + "yeelink.light.colorb" ], "maxProperties": 7, "channels": [