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 support for yeelink.light.lamp15 Yeelight Screen Light Bar #10603

Merged
merged 2 commits into from
Apr 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion bundles/org.openhab.binding.miio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ This will change the communication method and the Mi IO binding can communicate

# Mi IO Devices

Currently the miio binding supports more than 280 different models.
Currently the miio binding supports more than 290 different models.

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

### Yeelight Screen Light Bar (<a name="yeelink-light-lamp15">yeelink.light.lamp15</a>) Channels

| Channel | Type | Description | Comment |
|----------------------|----------------------|------------------------------------------|------------|
| power | Switch | Power | |
| brightness | Dimmer | Brightness | |
| delayoff | Number:Time | Shutdown Timer | |
| colorTemperature | Number:Temperature | Color Temperature | |
| 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"] |
| rgbColor | Color | RGB Color | |
| ambientBrightness | Number | Ambient Brightness | |
| ambientPower | Switch | Ambient Power | |
| ambientColor | Color | Ambient Color | |
| ambientColorTemperature | Number | Ambient Color Temperature | |
| ambientColorMode | Number | Ambient Color Mode | |

### Yeelight Bulb (<a name="yeelink-light-mono1">yeelink.light.mono1</a>) Channels

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

### Yeelight Screen Light Bar (yeelink.light.lamp15) 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.

```
Group G_light "Yeelight Screen Light Bar" <status>
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:Temperature colorTemperature "Color Temperature" (G_light) {channel="miio:basic:light:colorTemperature"}
Number colorMode "Color Mode" (G_light) {channel="miio:basic:light:colorMode"}
Color rgbColor "RGB Color" (G_light) {channel="miio:basic:light:rgbColor"}
Number ambientBrightness "Ambient Brightness" (G_light) {channel="miio:basic:light:ambientBrightness"}
Switch ambientPower "Ambient Power" (G_light) {channel="miio:basic:light:ambientPower"}
Color ambientColor "Ambient Color" (G_light) {channel="miio:basic:light:ambientColor"}
Number ambientColorTemperature "Ambient Color Temperature" (G_light) {channel="miio:basic:light:ambientColorTemperature"}
Number ambientColorMode "Ambient Color Mode" (G_light) {channel="miio:basic:light:ambientColorMode"}
```

### Yeelight Bulb (yeelink.light.mono1) 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ public enum MiIoDevices {
YEELINK_LIGHT_LAMP6("yeelink.light.lamp6", "Yeelight", THING_TYPE_BASIC),
YEELINK_LIGHT_LAMP7("yeelink.light.lamp7", "Yeelight LED Light Sensor Desk Lamp V1", THING_TYPE_BASIC),
YEELINK_LIGHT_LAMP8("yeelink.light.lamp8", "Yeelight", THING_TYPE_BASIC),
YEELINK_LIGHT_LAMP15("yeelink.light.lamp15", "Yeelight Screen Light Bar", THING_TYPE_BASIC),
YEELINK_LIGHT_MONO1("yeelink.light.mono1", "Yeelight Bulb", THING_TYPE_BASIC),
YEELINK_LIGHT_MONO2("yeelink.light.mono2", "Yeelight White Bulb v2", THING_TYPE_BASIC),
YEELINK_LIGHT_MONO5("yeelink.light.mono5", "Yeelight LED Filament Bulb", THING_TYPE_BASIC),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,280 @@
{
"deviceMapping": {
"id": [
"yeelink.light.lamp15"
],
"propertyMethod": "get_prop",
"maxProperties": 2,
"channels": [
{
"property": "power",
"friendlyName": "Power",
"channel": "power",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_power",
"parameterType": "ONOFF"
}
],
"category": "switch",
"tags": [
"Switch"
]
},
{
"property": "bright",
"friendlyName": "Brightness",
"channel": "brightness",
"type": "Dimmer",
"refresh": true,
"actions": [
{
"command": "set_bright",
"parameterType": "NUMBER",
"condition": {
"name": "BrightnessExisting"
}
},
{
"command": "set_power",
"parameterType": "ONOFF",
"condition": {
"name": "BrightnessOnOff"
}
}
],
"category": "light",
"tags": [
"Setpoint",
"Light"
]
},
{
"property": "delayoff",
"friendlyName": "Shutdown Timer",
"channel": "delayoff",
"type": "Number:Time",
"unit": "seconds",
"refresh": true,
"actions": [
{
"command": "cron_add",
"parameterType": "NUMBER",
"parameters": [
0,
"$value$"
]
}
],
"category": "time",
"tags": [
"Setpoint",
"Duration"
]
},
{
"property": "ct",
"friendlyName": "Color Temperature",
"channel": "colorTemperature",
"type": "Number:Temperature",
"unit": "kelvin",
"stateDescription": {
"minimum": 1700,
"maximum": 6500,
"step": 1,
"pattern": "%.0f %unit%"
},
"refresh": true,
"actions": [
{
"command": "set_ct_abx",
"parameterType": "NUMBER",
"parameters": [
"$value$",
"smooth",
500
]
}
],
"category": "colorlight",
"tags": [
"Setpoint",
"Temperature"
]
},
{
"property": "color_mode",
"friendlyName": "Color Mode",
"channel": "colorMode",
"type": "Number",
"stateDescription": {
"minimum": 0,
"maximum": 5,
"step": 1,
"options": [
{
"value": "0",
"label": "Default"
},
{
"value": "1",
"label": "CT mode"
},
{
"value": "2",
"label": "RGB mode"
},
{
"value": "3",
"label": "HSV mode"
},
{
"value": "4",
"label": "Color Flow mode"
},
{
"value": "5",
"label": "Night Light mode"
}
]
},
"refresh": true,
"actions": [
{
"command": "set_power",
"parameterType": "NUMBER",
"parameters": [
"on",
"smooth",
500,
"$value$"
]
}
],
"category": "settings",
"tags": [
"Control",
"Light"
],
"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\"]"
},
{
"property": "rgb",
"friendlyName": "RGB Color",
"channel": "rgbColor",
"type": "Color",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
{
"command": "set_rgb",
"parameterType": "COLOR",
"parameters": [
"$value$",
"smooth",
500
],
"condition": {
"name": "HSBOnly"
}
},
{
"command": "set_bright",
"parameterType": "NUMBER",
"condition": {
"name": "BrightnessExisting"
}
},
{
"command": "set_power",
"parameterType": "ONOFF",
"condition": {
"name": "BrightnessOnOff"
}
}
],
"category": "colorpicker",
"tags": [
"Control",
"Light"
]
},
{
"property": "bg_bright",
"friendlyName": "Ambient Brightness",
"channel": "ambientBrightness",
"channelType": "ambientBrightness",
"type": "Number",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
{
"command": "bg_set_bright",
"parameterType": "NUMBER"
}
]
},
{
"property": "bg_power",
"friendlyName": "Ambient Power",
"channel": "ambientPower",
"channelType": "ambientPower",
"type": "Switch",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
{
"command": "bg_set_power",
"parameterType": "ONOFF"
}
]
},
{
"property": "bg_rgb",
"friendlyName": "Ambient Color",
"channel": "ambientColor",
"channelType": "ambientColor",
"type": "Color",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
{
"command": "bg_set_rgb",
"parameterType": "COLOR"
}
]
},
{
"property": "bg_ct",
"friendlyName": "Ambient Color Temperature",
"channel": "ambientColorTemperature",
"channelType": "ambientColorTemperature",
"type": "Number",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
{
"command": "bg_set_ct_abx",
"parameterType": "NUMBER",
"parameters": [
"$value$",
"smooth",
500
]
}
]
},
{
"property": "bg_lmode",
"friendlyName": "Ambient Color Mode",
"channel": "ambientColorMode",
"channelType": "ambientColorMode",
"type": "Number",
"refresh": true,
"actions": []
}
]
}
}