]> git.basschouten.com Git - openhab-addons.git/commitdiff
[miio] add several Philips lights (#8736)
authorMarcel <marcelrv@users.noreply.github.com>
Mon, 12 Oct 2020 01:18:43 +0000 (03:18 +0200)
committerGitHub <noreply@github.com>
Mon, 12 Oct 2020 01:18:43 +0000 (18:18 -0700)
Add following models:
philips.light.sread2
philips.light.cbulb
philips.light.cbulbs
philips.light.dcolor
philips.light.rwread

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
bundles/org.openhab.binding.miio/README.md
bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoDevices.java
bundles/org.openhab.binding.miio/src/main/resources/database/philips.light.cbulb.json [new file with mode: 0644]
bundles/org.openhab.binding.miio/src/main/resources/database/philips.light.rwread.json [new file with mode: 0644]
bundles/org.openhab.binding.miio/src/main/resources/database/philips.light.sread1.json

index 328b5c5653928ada184b7dae6b382354ba0817ea..d784961faea3c94d16966136792ec8b56caa1c5d 100644 (file)
@@ -148,6 +148,7 @@ or in case of unknown models include the model information e.g.:
 | Light Control (Wall Switch)  | miio:unsupported | lumi.ctrl_neutral1.v1  | No        |            |
 | Light Control (Wall Switch)  | miio:unsupported | lumi.ctrl_neutral2.v1  | No        |            |
 | Xiaomi Philips Eyecare Smart Lamp 2 | miio:basic       | [philips.light.sread1](#philips-light-sread1) | Yes       |            |
+| Xiaomi Philips Eyecare Smart Lamp 2 | miio:basic       | [philips.light.sread2](#philips-light-sread2) | Yes       |            |
 | Xiaomi Philips LED Ceiling Lamp | miio:basic       | [philips.light.ceiling](#philips-light-ceiling) | Yes       |            |
 | Xiaomi Philips LED Ceiling Lamp | miio:basic       | [philips.light.zyceiling](#philips-light-zyceiling) | Yes       |            |
 | Xiaomi Philips Bulb          | miio:basic       | [philips.light.bulb](#philips-light-bulb) | Yes       |            |
@@ -157,6 +158,10 @@ or in case of unknown models include the model information e.g.:
 | Xiaomi Philips ZhiRui bedside lamp | miio:basic       | [philips.light.moonlight](#philips-light-moonlight) | Yes       |            |
 | Philips Ceiling Light        | miio:basic       | [philips.light.bceiling1](#philips-light-bceiling1) | Yes       | Experimental support. Please report back if all channels are functional. Preferably share the debug log of property refresh and command responses |
 | Philips Ceiling Light        | miio:basic       | [philips.light.bceiling2](#philips-light-bceiling2) | Yes       | Experimental support. Please report back if all channels are functional. Preferably share the debug log of property refresh and command responses |
+| Philips Light                | miio:basic       | [philips.light.cbulb](#philips-light-cbulb) | Yes       |            |
+| Philips Light                | miio:basic       | [philips.light.cbulbs](#philips-light-cbulbs) | Yes       |            |
+| Philips Light                | miio:basic       | [philips.light.dcolor](#philips-light-dcolor) | Yes       |            |
+| Light                        | miio:basic       | [philips.light.rwread](#philips-light-rwread) | Yes       |            |
 | Philips Light                | miio:basic       | [philips.light.lnblight1](#philips-light-lnblight1) | Yes       | Experimental support. Please report back if all channels are functional. Preferably share the debug log of property refresh and command responses |
 | Philips Light                | miio:basic       | [philips.light.lnblight2](#philips-light-lnblight2) | Yes       | Experimental support. Please report back if all channels are functional. Preferably share the debug log of property refresh and command responses |
 | Philips Light                | miio:basic       | [philips.light.lnlrlight](#philips-light-lnlrlight) | Yes       | Experimental support. Please report back if all channels are functional. Preferably share the debug log of property refresh and command responses |
@@ -1211,6 +1216,19 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena
 | ambientBrightness | Number  | Ambient Brightness                  |            |
 | illumination     | Number  | Ambient Illumination                |            |
 | eyecare          | Switch  | Eyecare                             |            |
+| bl               | Switch  | Night Light                         |            |
+
+### Xiaomi Philips Eyecare Smart Lamp 2 (<a name="philips-light-sread2">philips.light.sread2</a>) Channels
+
+| Channel          | Type    | Description                         | Comment    |
+|------------------|---------|-------------------------------------|------------|
+| power            | Switch  | Power                               |            |
+| brightness       | Dimmer  | Brightness                          |            |
+| ambientPower     | Switch  | Ambient Power                       |            |
+| ambientBrightness | Number  | Ambient Brightness                  |            |
+| illumination     | Number  | Ambient Illumination                |            |
+| eyecare          | Switch  | Eyecare                             |            |
+| bl               | Switch  | Night Light                         |            |
 
 ### Xiaomi Philips LED Ceiling Lamp (<a name="philips-light-ceiling">philips.light.ceiling</a>) Channels
 
@@ -1326,6 +1344,55 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena
 | delayoff         | Switch  | Delay Off                           |            |
 | mb               | Switch  | MiBand                              |            |
 
+### Philips Light (<a name="philips-light-cbulb">philips.light.cbulb</a>) Channels
+
+| Channel          | Type    | Description                         | Comment    |
+|------------------|---------|-------------------------------------|------------|
+| power            | Switch  | Power                               |            |
+| brightness       | Dimmer  | Brightness                          |            |
+| cct              | Dimmer  | Correlated Color Temperature        |            |
+| scene            | Number  | Scene                               |            |
+| cid              | Color   | Color                               |            |
+| switchscene      | Switch  | Switch Scene                        |            |
+| switch_en        | Switch  | Switch Enabled                      |            |
+| delayoff         | Switch  | Delay Off                           |            |
+
+### Philips Light (<a name="philips-light-cbulbs">philips.light.cbulbs</a>) Channels
+
+| Channel          | Type    | Description                         | Comment    |
+|------------------|---------|-------------------------------------|------------|
+| power            | Switch  | Power                               |            |
+| brightness       | Dimmer  | Brightness                          |            |
+| cct              | Dimmer  | Correlated Color Temperature        |            |
+| scene            | Number  | Scene                               |            |
+| cid              | Color   | Color                               |            |
+| switchscene      | Switch  | Switch Scene                        |            |
+| switch_en        | Switch  | Switch Enabled                      |            |
+| delayoff         | Switch  | Delay Off                           |            |
+
+### Philips Light (<a name="philips-light-dcolor">philips.light.dcolor</a>) Channels
+
+| Channel          | Type    | Description                         | Comment    |
+|------------------|---------|-------------------------------------|------------|
+| power            | Switch  | Power                               |            |
+| brightness       | Dimmer  | Brightness                          |            |
+| cct              | Dimmer  | Correlated Color Temperature        |            |
+| scene            | Number  | Scene                               |            |
+| cid              | Color   | Color                               |            |
+| switchscene      | Switch  | Switch Scene                        |            |
+| switch_en        | Switch  | Switch Enabled                      |            |
+| delayoff         | Switch  | Delay Off                           |            |
+
+### Light (<a name="philips-light-rwread">philips.light.rwread</a>) Channels
+
+| Channel          | Type    | Description                         | Comment    |
+|------------------|---------|-------------------------------------|------------|
+| power            | Switch  | Power                               |            |
+| brightness       | Dimmer  | Brightness                          |            |
+| scene            | Number  | Scene                               |            |
+| flm              | Number  | Follow Me                           |            |
+| dv               | Number  | DV                                  |            |
+
 ### Philips Light (<a name="philips-light-lnblight1">philips.light.lnblight1</a>) Channels
 
 | Channel          | Type    | Description                         | Comment    |
@@ -4000,6 +4067,22 @@ Switch ambientPower "Ambient Power" (G_light) {channel="miio:basic:light:ambient
 Number ambientBrightness "Ambient Brightness" (G_light) {channel="miio:basic:light:ambientBrightness"}
 Number illumination "Ambient Illumination" (G_light) {channel="miio:basic:light:illumination"}
 Switch eyecare "Eyecare" (G_light) {channel="miio:basic:light:eyecare"}
+Switch bl "Night Light" (G_light) {channel="miio:basic:light:bl"}
+```
+
+### Xiaomi Philips Eyecare Smart Lamp 2 (philips.light.sread2) 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 "Xiaomi Philips Eyecare Smart Lamp 2" <status>
+Switch power "Power" (G_light) {channel="miio:basic:light:power"}
+Dimmer brightness "Brightness" (G_light) {channel="miio:basic:light:brightness"}
+Switch ambientPower "Ambient Power" (G_light) {channel="miio:basic:light:ambientPower"}
+Number ambientBrightness "Ambient Brightness" (G_light) {channel="miio:basic:light:ambientBrightness"}
+Number illumination "Ambient Illumination" (G_light) {channel="miio:basic:light:illumination"}
+Switch eyecare "Eyecare" (G_light) {channel="miio:basic:light:eyecare"}
+Switch bl "Night Light" (G_light) {channel="miio:basic:light:bl"}
 ```
 
 ### Xiaomi Philips LED Ceiling Lamp (philips.light.ceiling) item file lines
@@ -4143,6 +4226,67 @@ Switch delayoff "Delay Off" (G_light) {channel="miio:basic:light:delayoff"}
 Switch mb "MiBand" (G_light) {channel="miio:basic:light:mb"}
 ```
 
+### Philips Light (philips.light.cbulb) 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 "Philips Light" <status>
+Switch power "Power" (G_light) {channel="miio:basic:light:power"}
+Dimmer brightness "Brightness" (G_light) {channel="miio:basic:light:brightness"}
+Dimmer cct "Correlated Color Temperature" (G_light) {channel="miio:basic:light:cct"}
+Number scene "Scene" (G_light) {channel="miio:basic:light:scene"}
+Color cid "Color" (G_light) {channel="miio:basic:light:cid"}
+Switch switchscene "Switch Scene" (G_light) {channel="miio:basic:light:switchscene"}
+Switch switch_en "Switch Enabled" (G_light) {channel="miio:basic:light:switch_en"}
+Switch delayoff "Delay Off" (G_light) {channel="miio:basic:light:delayoff"}
+```
+
+### Philips Light (philips.light.cbulbs) 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 "Philips Light" <status>
+Switch power "Power" (G_light) {channel="miio:basic:light:power"}
+Dimmer brightness "Brightness" (G_light) {channel="miio:basic:light:brightness"}
+Dimmer cct "Correlated Color Temperature" (G_light) {channel="miio:basic:light:cct"}
+Number scene "Scene" (G_light) {channel="miio:basic:light:scene"}
+Color cid "Color" (G_light) {channel="miio:basic:light:cid"}
+Switch switchscene "Switch Scene" (G_light) {channel="miio:basic:light:switchscene"}
+Switch switch_en "Switch Enabled" (G_light) {channel="miio:basic:light:switch_en"}
+Switch delayoff "Delay Off" (G_light) {channel="miio:basic:light:delayoff"}
+```
+
+### Philips Light (philips.light.dcolor) 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 "Philips Light" <status>
+Switch power "Power" (G_light) {channel="miio:basic:light:power"}
+Dimmer brightness "Brightness" (G_light) {channel="miio:basic:light:brightness"}
+Dimmer cct "Correlated Color Temperature" (G_light) {channel="miio:basic:light:cct"}
+Number scene "Scene" (G_light) {channel="miio:basic:light:scene"}
+Color cid "Color" (G_light) {channel="miio:basic:light:cid"}
+Switch switchscene "Switch Scene" (G_light) {channel="miio:basic:light:switchscene"}
+Switch switch_en "Switch Enabled" (G_light) {channel="miio:basic:light:switch_en"}
+Switch delayoff "Delay Off" (G_light) {channel="miio:basic:light:delayoff"}
+```
+
+### Light (philips.light.rwread) 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 "Light" <status>
+Switch power "Power" (G_light) {channel="miio:basic:light:power"}
+Dimmer brightness "Brightness" (G_light) {channel="miio:basic:light:brightness"}
+Number scene "Scene" (G_light) {channel="miio:basic:light:scene"}
+Number flm "Follow Me" (G_light) {channel="miio:basic:light:flm"}
+Number dv "DV" (G_light) {channel="miio:basic:light:dv"}
+```
+
 ### Philips Light (philips.light.lnblight1) 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.
index 7619224fc82e1844978a8bf91505fe1c56471cba..2238ef3b7eeaf0c0c8580f1636ba6113e4a548ae 100644 (file)
@@ -88,7 +88,8 @@ public enum MiIoDevices {
     HUMIDIFIER("zhimi.humidifier.v1", "Mi Humdifier", THING_TYPE_BASIC),
     LUMI_C11("lumi.ctrl_neutral1.v1", "Light Control (Wall Switch)", THING_TYPE_UNSUPPORTED),
     LUMI_C12("lumi.ctrl_neutral2.v1", "Light Control (Wall Switch)", THING_TYPE_UNSUPPORTED),
-    PHILIPS_R1("philips.light.sread1", "Xiaomi Philips Eyecare Smart Lamp 2", THING_TYPE_BASIC),
+    PHILIPS_SR1("philips.light.sread1", "Xiaomi Philips Eyecare Smart Lamp 2", THING_TYPE_BASIC),
+    PHILIPS_SR2("philips.light.sread2", "Xiaomi Philips Eyecare Smart Lamp 2", THING_TYPE_BASIC),
     PHILIPS_C("philips.light.ceiling", "Xiaomi Philips LED Ceiling Lamp", THING_TYPE_BASIC),
     PHILIPS_C2("philips.light.zyceiling", "Xiaomi Philips LED Ceiling Lamp", THING_TYPE_BASIC),
     PHILIPS_BULB("philips.light.bulb", "Xiaomi Philips Bulb", THING_TYPE_BASIC),
@@ -98,6 +99,10 @@ public enum MiIoDevices {
     PHILIPS_MOON("philips.light.moonlight", "Xiaomi Philips ZhiRui bedside lamp", THING_TYPE_BASIC),
     PHILIPS_LIGHT_BCEILING1("philips.light.bceiling1", "Philips Ceiling Light", THING_TYPE_BASIC),
     PHILIPS_LIGHT_BCEILING2("philips.light.bceiling2", "Philips Ceiling Light", THING_TYPE_BASIC),
+    PHILIPS_LIGHT_CBULB("philips.light.cbulb", "Philips Light", THING_TYPE_BASIC),
+    PHILIPS_LIGHT_CBULBS("philips.light.cbulbs", "Philips Light", THING_TYPE_BASIC),
+    PHILIPS_LIGHT_DCOLOR("philips.light.dcolor", "Philips Light", THING_TYPE_BASIC),
+    PHILIPS_LIGHT_RWREAD("philips.light.rwread", "Philips Light", THING_TYPE_BASIC),
     PHILIPS_LIGHT_LNBLIGHT1("philips.light.lnblight1", "Philips Light", THING_TYPE_BASIC),
     PHILIPS_LIGHT_LNBLIGHT2("philips.light.lnblight2", "Philips Light", THING_TYPE_BASIC),
     PHILIPS_LIGHT_LNLRLIGHT("philips.light.lnlrlight", "Philips Light", THING_TYPE_BASIC),
diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/philips.light.cbulb.json b/bundles/org.openhab.binding.miio/src/main/resources/database/philips.light.cbulb.json
new file mode 100644 (file)
index 0000000..94f52c3
--- /dev/null
@@ -0,0 +1,133 @@
+{
+       "deviceMapping": {
+               "id": [
+                       "philips.light.cbulb",
+                       "philips.light.cbulbs",
+                       "philips.light.dcolor"
+               ],
+               "channels": [
+                       {
+                               "property": "power",
+                               "friendlyName": "Power",
+                               "channel": "power",
+                               "type": "Switch",
+                               "refresh": true,
+                               "ChannelGroup": "",
+                               "actions": [
+                                       {
+                                               "command": "set_power",
+                                               "parameterType": "ONOFF"
+                                       }
+                               ]
+                       },
+                       {
+                               "property": "bright",
+                               "friendlyName": "Brightness",
+                               "channel": "brightness",
+                               "type": "Dimmer",
+                               "refresh": true,
+                               "ChannelGroup": "actions",
+                               "actions": [
+                                       {
+                                               "command": "set_bright",
+                                               "parameterType": "NUMBER",
+                                               "condition": {
+                                                       "name": "BrightnessExisting"
+                                               }
+                                       },
+                                       {
+                                               "command": "set_power",
+                                               "parameterType": "ONOFF",
+                                               "condition": {
+                                                       "name": "BrightnessOnOff"
+                                               }
+                                       }
+                               ]
+                       },
+                       {
+                               "property": "cct",
+                               "friendlyName": "Correlated Color Temperature",
+                               "channel": "cct",
+                               "type": "Dimmer",
+                               "refresh": true,
+                               "ChannelGroup": "actions",
+                               "actions": [
+                                       {
+                                               "command": "set_cct",
+                                               "parameterType": "NUMBER"
+                                       }
+                               ]
+                       },
+                       {
+                               "property": "snm",
+                               "friendlyName": "Scene",
+                               "channel": "scene",
+                               "type": "Number",
+                               "refresh": true,
+                               "ChannelGroup": "actions",
+                               "actions": [
+                                       {
+                                               "command": "apply_scene",
+                                               "parameterType": "NUMBER"
+                                       }
+                               ]
+                       },
+                       {
+                               "property": "cid",
+                               "friendlyName": "Color",
+                               "channel": "cid",
+                               "type": "Color",
+                               "refresh": true,
+                               "ChannelGroup": "actions",
+                               "actions": [
+                                       {
+                                               "command": "set_cid",
+                                               "parameterType": "COLOR"
+                                       }
+                               ]
+                       },
+                       {
+                               "property": "",
+                               "friendlyName": "Switch Scene",
+                               "channel": "switchscene",
+                               "type": "Switch",
+                               "refresh": false,
+                               "ChannelGroup": "actions",
+                               "actions": [
+                                       {
+                                               "command": "switch_the_scene",
+                                               "parameterType": "EMPTY"
+                                       }
+                               ]
+                       },
+                       {
+                               "property": "get_switch_en",
+                               "friendlyName": "Switch Enabled",
+                               "channel": "switch_en",
+                               "type": "Switch",
+                               "refresh": false,
+                               "ChannelGroup": "actions",
+                               "actions": [
+                                       {
+                                               "command": "set_switch_en",
+                                               "parameterType": "NUMBER"
+                                       }
+                               ]
+                       },
+                       {
+                               "property": "",
+                               "friendlyName": "Delay Off",
+                               "channel": "delayoff",
+                               "type": "Switch",
+                               "refresh": false,
+                               "ChannelGroup": "actions",
+                               "actions": [
+                                       {
+                                               "command": "delay_off",
+                                               "parameterType": "NUMBER"
+                                       }
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/philips.light.rwread.json b/bundles/org.openhab.binding.miio/src/main/resources/database/philips.light.rwread.json
new file mode 100644 (file)
index 0000000..51280d0
--- /dev/null
@@ -0,0 +1,87 @@
+{
+       "deviceMapping": {
+               "id": [
+                       "philips.light.rwread"
+               ],
+               "channels": [
+                       {
+                               "property": "power",
+                               "friendlyName": "Power",
+                               "channel": "power",
+                               "type": "Switch",
+                               "refresh": true,
+                               "ChannelGroup": "",
+                               "actions": [
+                                       {
+                                               "command": "set_power",
+                                               "parameterType": "ONOFF"
+                                       }
+                               ]
+                       },
+                       {
+                               "property": "bright",
+                               "friendlyName": "Brightness",
+                               "channel": "brightness",
+                               "type": "Dimmer",
+                               "refresh": true,
+                               "ChannelGroup": "actions",
+                               "actions": [
+                                       {
+                                               "command": "set_bright",
+                                               "parameterType": "NUMBER",
+                                               "condition": {
+                                                       "name": "BrightnessExisting"
+                                               }
+                                       },
+                                       {
+                                               "command": "set_power",
+                                               "parameterType": "ONOFF",
+                                               "condition": {
+                                                       "name": "BrightnessOnOff"
+                                               }
+                                       }
+                               ]
+                       },
+                       {
+                               "property": "snm",
+                               "friendlyName": "Scene",
+                               "channel": "scene",
+                               "type": "Number",
+                               "refresh": true,
+                               "ChannelGroup": "actions",
+                               "actions": [
+                                       {
+                                               "command": "apply_scene",
+                                               "parameterType": "NUMBER"
+                                       }
+                               ]
+                       },
+                       {
+                               "property": "flm",
+                               "friendlyName": "Follow Me",
+                               "channel": "flm",
+                               "type": "Number",
+                               "refresh": true,
+                               "actions": [
+                                       {
+                                               "command": "set_flmvalue",
+                                               "parameterType": "NUMBER"
+                                       }
+                               ]
+                       },
+                       {
+                               "property": "dv",
+                               "friendlyName": "DV",
+                               "channel": "dv",
+                               "type": "Number",
+                               "refresh": true,
+                               "ChannelGroup": "actions",
+                               "actions": [
+                                       {
+                                               "parameterType": "EMPTY"
+                                       }
+                               ]
+                       }
+               ]
+       }
+}
index a6ede3fa06612480529d65765d0b214ec1ee0972..5a2b13c4c8599c2e86b81f555ae5ad0f6ef0711c 100644 (file)
@@ -1,7 +1,8 @@
 {
        "deviceMapping": {
                "id": [
-                       "philips.light.sread1"
+                       "philips.light.sread1",
+                       "philips.light.sread2"
                ],
                "channels": [
                        {
                                                "parameterType": "ONOFF"
                                        }
                                ]
+                       },
+                       {
+                               "property": "bl",
+                               "friendlyName": "Night Light",
+                               "channel": "bl",
+                               "type": "Switch",
+                               "refresh": true,
+                               "actions": [
+                                       {
+                                               "command": "enable_bl",
+                                               "parameterType": "NUMBER"
+                                       }
+                               ]
                        }
                ]
        }