Skip to content

Commit c157e39

Browse files
authored
[miio] add support for yeelink.light.lamp15 Yeelight Screen Light Bar (openhab#10603)
closes openhab#10589 Signed-off-by: Marcel Verpaalen <[email protected]>
1 parent 8ac7eeb commit c157e39

File tree

3 files changed

+318
-1
lines changed

3 files changed

+318
-1
lines changed

bundles/org.openhab.binding.miio/README.md

+37-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ This will change the communication method and the Mi IO binding can communicate
173173

174174
# Mi IO Devices
175175

176-
Currently the miio binding supports more than 280 different models.
176+
Currently the miio binding supports more than 290 different models.
177177

178178
| Device | ThingType | Device Model | Supported | Remark |
179179
|------------------------------|------------------|------------------------|-----------|------------|
@@ -419,6 +419,7 @@ Currently the miio binding supports more than 280 different models.
419419
| Yeelight | miio:basic | [yeelink.light.lamp6](#yeelink-light-lamp6) | Yes | |
420420
| Yeelight LED Light Sensor Desk Lamp V1 | miio:basic | [yeelink.light.lamp7](#yeelink-light-lamp7) | Yes | |
421421
| Yeelight | miio:basic | [yeelink.light.lamp8](#yeelink-light-lamp8) | Yes | |
422+
| Yeelight Screen Light Bar | miio:basic | [yeelink.light.lamp15](#yeelink-light-lamp15) | Yes | |
422423
| Yeelight Bulb | miio:basic | [yeelink.light.mono1](#yeelink-light-mono1) | Yes | |
423424
| Yeelight White Bulb v2 | miio:basic | [yeelink.light.mono2](#yeelink-light-mono2) | Yes | |
424425
| Yeelight LED Filament Bulb | miio:basic | [yeelink.light.mono5](#yeelink-light-mono5) | Yes | |
@@ -3394,6 +3395,22 @@ e.g. `openhab:send actionCommand 'upd_timer["1498595904821", "on"]'` would enabl
33943395
| colorMode | Number | Color Mode | |
33953396
| name | String | Name | |
33963397

3398+
### Yeelight Screen Light Bar (<a name="yeelink-light-lamp15">yeelink.light.lamp15</a>) Channels
3399+
3400+
| Channel | Type | Description | Comment |
3401+
|----------------------|----------------------|------------------------------------------|------------|
3402+
| power | Switch | Power | |
3403+
| brightness | Dimmer | Brightness | |
3404+
| delayoff | Number:Time | Shutdown Timer | |
3405+
| colorTemperature | Number:Temperature | Color Temperature | |
3406+
| colorMode | Number | Color Mode | Value mapping ["0"="Default","1"="CT mode","2"="RGB mode","3"="HSV mode","4"="Color Flow mode","5"="Night Light mode"] |
3407+
| rgbColor | Color | RGB Color | |
3408+
| ambientBrightness | Number | Ambient Brightness | |
3409+
| ambientPower | Switch | Ambient Power | |
3410+
| ambientColor | Color | Ambient Color | |
3411+
| ambientColorTemperature | Number | Ambient Color Temperature | |
3412+
| ambientColorMode | Number | Ambient Color Mode | |
3413+
33973414
### Yeelight Bulb (<a name="yeelink-light-mono1">yeelink.light.mono1</a>) Channels
33983415

33993416
| Channel | Type | Description | Comment |
@@ -8467,6 +8484,25 @@ Number colorMode "Color Mode" (G_light) {channel="miio:basic:light:colorMode"}
84678484
String name "Name" (G_light) {channel="miio:basic:light:name"}
84688485
```
84698486

8487+
### Yeelight Screen Light Bar (yeelink.light.lamp15) item file lines
8488+
8489+
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.
8490+
8491+
```
8492+
Group G_light "Yeelight Screen Light Bar" <status>
8493+
Switch power "Power" (G_light) {channel="miio:basic:light:power"}
8494+
Dimmer brightness "Brightness" (G_light) {channel="miio:basic:light:brightness"}
8495+
Number:Time delayoff "Shutdown Timer" (G_light) {channel="miio:basic:light:delayoff"}
8496+
Number:Temperature colorTemperature "Color Temperature" (G_light) {channel="miio:basic:light:colorTemperature"}
8497+
Number colorMode "Color Mode" (G_light) {channel="miio:basic:light:colorMode"}
8498+
Color rgbColor "RGB Color" (G_light) {channel="miio:basic:light:rgbColor"}
8499+
Number ambientBrightness "Ambient Brightness" (G_light) {channel="miio:basic:light:ambientBrightness"}
8500+
Switch ambientPower "Ambient Power" (G_light) {channel="miio:basic:light:ambientPower"}
8501+
Color ambientColor "Ambient Color" (G_light) {channel="miio:basic:light:ambientColor"}
8502+
Number ambientColorTemperature "Ambient Color Temperature" (G_light) {channel="miio:basic:light:ambientColorTemperature"}
8503+
Number ambientColorMode "Ambient Color Mode" (G_light) {channel="miio:basic:light:ambientColorMode"}
8504+
```
8505+
84708506
### Yeelight Bulb (yeelink.light.mono1) item file lines
84718507

84728508
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.

bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoDevices.java

+1
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ public enum MiIoDevices {
303303
YEELINK_LIGHT_LAMP6("yeelink.light.lamp6", "Yeelight", THING_TYPE_BASIC),
304304
YEELINK_LIGHT_LAMP7("yeelink.light.lamp7", "Yeelight LED Light Sensor Desk Lamp V1", THING_TYPE_BASIC),
305305
YEELINK_LIGHT_LAMP8("yeelink.light.lamp8", "Yeelight", THING_TYPE_BASIC),
306+
YEELINK_LIGHT_LAMP15("yeelink.light.lamp15", "Yeelight Screen Light Bar", THING_TYPE_BASIC),
306307
YEELINK_LIGHT_MONO1("yeelink.light.mono1", "Yeelight Bulb", THING_TYPE_BASIC),
307308
YEELINK_LIGHT_MONO2("yeelink.light.mono2", "Yeelight White Bulb v2", THING_TYPE_BASIC),
308309
YEELINK_LIGHT_MONO5("yeelink.light.mono5", "Yeelight LED Filament Bulb", THING_TYPE_BASIC),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,280 @@
1+
{
2+
"deviceMapping": {
3+
"id": [
4+
"yeelink.light.lamp15"
5+
],
6+
"propertyMethod": "get_prop",
7+
"maxProperties": 2,
8+
"channels": [
9+
{
10+
"property": "power",
11+
"friendlyName": "Power",
12+
"channel": "power",
13+
"type": "Switch",
14+
"refresh": true,
15+
"actions": [
16+
{
17+
"command": "set_power",
18+
"parameterType": "ONOFF"
19+
}
20+
],
21+
"category": "switch",
22+
"tags": [
23+
"Switch"
24+
]
25+
},
26+
{
27+
"property": "bright",
28+
"friendlyName": "Brightness",
29+
"channel": "brightness",
30+
"type": "Dimmer",
31+
"refresh": true,
32+
"actions": [
33+
{
34+
"command": "set_bright",
35+
"parameterType": "NUMBER",
36+
"condition": {
37+
"name": "BrightnessExisting"
38+
}
39+
},
40+
{
41+
"command": "set_power",
42+
"parameterType": "ONOFF",
43+
"condition": {
44+
"name": "BrightnessOnOff"
45+
}
46+
}
47+
],
48+
"category": "light",
49+
"tags": [
50+
"Setpoint",
51+
"Light"
52+
]
53+
},
54+
{
55+
"property": "delayoff",
56+
"friendlyName": "Shutdown Timer",
57+
"channel": "delayoff",
58+
"type": "Number:Time",
59+
"unit": "seconds",
60+
"refresh": true,
61+
"actions": [
62+
{
63+
"command": "cron_add",
64+
"parameterType": "NUMBER",
65+
"parameters": [
66+
0,
67+
"$value$"
68+
]
69+
}
70+
],
71+
"category": "time",
72+
"tags": [
73+
"Setpoint",
74+
"Duration"
75+
]
76+
},
77+
{
78+
"property": "ct",
79+
"friendlyName": "Color Temperature",
80+
"channel": "colorTemperature",
81+
"type": "Number:Temperature",
82+
"unit": "kelvin",
83+
"stateDescription": {
84+
"minimum": 1700,
85+
"maximum": 6500,
86+
"step": 1,
87+
"pattern": "%.0f %unit%"
88+
},
89+
"refresh": true,
90+
"actions": [
91+
{
92+
"command": "set_ct_abx",
93+
"parameterType": "NUMBER",
94+
"parameters": [
95+
"$value$",
96+
"smooth",
97+
500
98+
]
99+
}
100+
],
101+
"category": "colorlight",
102+
"tags": [
103+
"Setpoint",
104+
"Temperature"
105+
]
106+
},
107+
{
108+
"property": "color_mode",
109+
"friendlyName": "Color Mode",
110+
"channel": "colorMode",
111+
"type": "Number",
112+
"stateDescription": {
113+
"minimum": 0,
114+
"maximum": 5,
115+
"step": 1,
116+
"options": [
117+
{
118+
"value": "0",
119+
"label": "Default"
120+
},
121+
{
122+
"value": "1",
123+
"label": "CT mode"
124+
},
125+
{
126+
"value": "2",
127+
"label": "RGB mode"
128+
},
129+
{
130+
"value": "3",
131+
"label": "HSV mode"
132+
},
133+
{
134+
"value": "4",
135+
"label": "Color Flow mode"
136+
},
137+
{
138+
"value": "5",
139+
"label": "Night Light mode"
140+
}
141+
]
142+
},
143+
"refresh": true,
144+
"actions": [
145+
{
146+
"command": "set_power",
147+
"parameterType": "NUMBER",
148+
"parameters": [
149+
"on",
150+
"smooth",
151+
500,
152+
"$value$"
153+
]
154+
}
155+
],
156+
"category": "settings",
157+
"tags": [
158+
"Control",
159+
"Light"
160+
],
161+
"readmeComment": "Value mapping [\"0\"\u003d\"Default\",\"1\"\u003d\"CT mode\",\"2\"\u003d\"RGB mode\",\"3\"\u003d\"HSV mode\",\"4\"\u003d\"Color Flow mode\",\"5\"\u003d\"Night Light mode\"]"
162+
},
163+
{
164+
"property": "rgb",
165+
"friendlyName": "RGB Color",
166+
"channel": "rgbColor",
167+
"type": "Color",
168+
"refresh": true,
169+
"ChannelGroup": "actions",
170+
"actions": [
171+
{
172+
"command": "set_rgb",
173+
"parameterType": "COLOR",
174+
"parameters": [
175+
"$value$",
176+
"smooth",
177+
500
178+
],
179+
"condition": {
180+
"name": "HSBOnly"
181+
}
182+
},
183+
{
184+
"command": "set_bright",
185+
"parameterType": "NUMBER",
186+
"condition": {
187+
"name": "BrightnessExisting"
188+
}
189+
},
190+
{
191+
"command": "set_power",
192+
"parameterType": "ONOFF",
193+
"condition": {
194+
"name": "BrightnessOnOff"
195+
}
196+
}
197+
],
198+
"category": "colorpicker",
199+
"tags": [
200+
"Control",
201+
"Light"
202+
]
203+
},
204+
{
205+
"property": "bg_bright",
206+
"friendlyName": "Ambient Brightness",
207+
"channel": "ambientBrightness",
208+
"channelType": "ambientBrightness",
209+
"type": "Number",
210+
"refresh": true,
211+
"ChannelGroup": "actions",
212+
"actions": [
213+
{
214+
"command": "bg_set_bright",
215+
"parameterType": "NUMBER"
216+
}
217+
]
218+
},
219+
{
220+
"property": "bg_power",
221+
"friendlyName": "Ambient Power",
222+
"channel": "ambientPower",
223+
"channelType": "ambientPower",
224+
"type": "Switch",
225+
"refresh": true,
226+
"ChannelGroup": "actions",
227+
"actions": [
228+
{
229+
"command": "bg_set_power",
230+
"parameterType": "ONOFF"
231+
}
232+
]
233+
},
234+
{
235+
"property": "bg_rgb",
236+
"friendlyName": "Ambient Color",
237+
"channel": "ambientColor",
238+
"channelType": "ambientColor",
239+
"type": "Color",
240+
"refresh": true,
241+
"ChannelGroup": "actions",
242+
"actions": [
243+
{
244+
"command": "bg_set_rgb",
245+
"parameterType": "COLOR"
246+
}
247+
]
248+
},
249+
{
250+
"property": "bg_ct",
251+
"friendlyName": "Ambient Color Temperature",
252+
"channel": "ambientColorTemperature",
253+
"channelType": "ambientColorTemperature",
254+
"type": "Number",
255+
"refresh": true,
256+
"ChannelGroup": "actions",
257+
"actions": [
258+
{
259+
"command": "bg_set_ct_abx",
260+
"parameterType": "NUMBER",
261+
"parameters": [
262+
"$value$",
263+
"smooth",
264+
500
265+
]
266+
}
267+
]
268+
},
269+
{
270+
"property": "bg_lmode",
271+
"friendlyName": "Ambient Color Mode",
272+
"channel": "ambientColorMode",
273+
"channelType": "ambientColorMode",
274+
"type": "Number",
275+
"refresh": true,
276+
"actions": []
277+
}
278+
]
279+
}
280+
}

0 commit comments

Comments
 (0)