Skip to content

Commit

Permalink
add Philips Eyecare 2 & improve Yeelight 650 (openhab#8)
Browse files Browse the repository at this point in the history
Signed-off-by: Dieter Schmidt <[email protected]>
  • Loading branch information
dimalo authored and marcelrv committed May 29, 2018
1 parent 860e7cd commit 36b2780
Show file tree
Hide file tree
Showing 6 changed files with 189 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@
<item-type>Switch</item-type>
<label>Power On/Off</label>
</channel-type>
<channel-type id="ambientPower">
<item-type>Switch</item-type>
<label>Ambient Power On/Off</label>
</channel-type>
<channel-type id="eyecare">
<item-type>Switch</item-type>
<label>Eyecare Mode On/Off</label>
</channel-type>
<channel-type id="mode">
<item-type>String</item-type>
<label>Mode</label>
Expand All @@ -62,6 +70,18 @@
<item-type>Number</item-type>
<label>Brightness</label>
</channel-type>
<channel-type id="ambientBrightness">
<item-type>Number</item-type>
<label>Ambient Brightness</label>
</channel-type>
<channel-type id="nightlightBrightness">
<item-type>Number</item-type>
<label>Nightlight Brightness</label>
</channel-type>
<channel-type id="illumination">
<item-type>Number</item-type>
<label>Environment Illumination</label>
</channel-type>
<channel-type id="led">
<item-type>Switch</item-type>
<label>Led</label>
Expand All @@ -70,6 +90,10 @@
<item-type>Number</item-type>
<label>Color Mode</label>
</channel-type>
<channel-type id="ambientColorMode">
<item-type>Number</item-type>
<label>Ambient Color Mode</label>
</channel-type>
<channel-type id="colorTemperature">
<item-type>Number</item-type>
<label>Color Temperature</label>
Expand All @@ -86,6 +110,10 @@
<item-type>Number</item-type>
<label>Scene</label>
</channel-type>
<channel-type id="customScene">
<item-type>String</item-type>
<label>Custom Scene</label>
</channel-type>
<channel-type id="dv">
<item-type>Number</item-type>
<label>DV</label>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"deviceMapping": {
"id": [
"philips.light.sread1"
],
"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": "Number",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
{
"command": "set_bright",
"parameterType": "NUMBER"
}
]
},
{
"property": "ambstatus",
"friendlyName": "Ambient Power",
"channel": "ambientPower",
"type": "Switch",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
{
"command": "enable_amb",
"parameterType": "ONOFF"
}
]
},
{
"property": "ambvalue",
"friendlyName": "Ambient Brightness",
"channel": "ambientBrightness",
"type": "Number",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
{
"command": "set_amb_bright",
"parameterType": "NUMBER"
}
]
},
{
"property": "dvalue",
"friendlyName": "Ambient Illumination",
"channel": "illumination",
"type": "Number",
"refresh": true,
"ChannelGroup": "",
"actions": []
},
{
"property": "eyecare",
"friendlyName": "Eyecare",
"channel": "eyecare",
"type": "Switch",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
{
"command": "set_eyecare",
"parameterType": "ONOFF"
}
]
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@
}
]
},
{
"property": "bg_bright",
"friendlyName": "Ambient Brightness",
"channel": "ambientBrightness",
"type": "Number",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
{
"command": "bg_set_bright",
"parameterType": "NUMBER"
}
]
},
{
"property": "delayoff",
"friendlyName": "delayoff",
Expand Down Expand Up @@ -64,17 +78,12 @@
},
{
"property": "color_mode",
"friendlyName": "colorMode",
"friendlyName": "Color Mode",
"channel": "colorMode",
"type": "Number",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
{
"command": "set_scene",
"parameterType": "NUMBER"
}
]
"ChannelGroup": "",
"actions": []
},
{
"property": "name",
Expand All @@ -90,6 +99,20 @@
}
]
},
{
"property": "bg_power",
"friendlyName": "Ambient Power",
"channel": "ambientPower",
"type": "Switch",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
{
"command": "bg_set_power",
"parameterType": "ONOFF"
}
]
},
{
"property": "bg_rgb",
"friendlyName": "Ambient Color",
Expand All @@ -114,9 +137,43 @@
"actions": [
{
"command": "bg_set_ct_abx",
"parameterType": "NUMBER"
"parameterType": "NUMBER",
"parameter1": "\"smooth\"",
"parameter2": "500"
}
]
},
{
"property": "",
"friendlyName": "Set Scene",
"channel": "customScene",
"type": "String",
"refresh": false,
"ChannelGroup": "actions",
"actions": [
{
"command": "set_scene",
"parameterType": "CUSTOMSTRING"
}
]
},
{
"property": "bg_lmode",
"friendlyName": "Ambient Color Mode",
"channel": "ambientColorMode",
"type": "Number",
"refresh": true,
"ChannelGroup": "",
"actions": []
},
{
"property": "nl_br",
"friendlyName": "Nightlight Brightness",
"channel": "nightlightBrightness",
"type": "Number",
"refresh": true,
"ChannelGroup": "",
"actions": []
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,11 @@ public void handleCommand(ChannelUID channelUID, Command command) {
cmd = cmd + "[]";
}
} else if (command instanceof StringType) {
cmd = cmd + "[\"" + command.toString() + "\"" + para + "]";
if (paramType == CommandParameterType.STRING) {
cmd = cmd + "[\"" + command.toString() + "\"" + para + "]";
} else if (paramType == CommandParameterType.CUSTOMSTRING) {
cmd = cmd + "[" + command.toString() + para + "]";
}
} else if (command instanceof DecimalType) {
cmd = cmd + "[" + command.toString().toLowerCase() + para + "]";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public enum MiIoDevices {
LUMI_C11("lumi.ctrl_neutral1.v1", "Light Control (Wall Switch)", MiIoBindingConstants.THING_TYPE_UNSUPPORTED),
LUMI_C12("lumi.ctrl_neutral2.v1", "Light Control (Wall Switch)", MiIoBindingConstants.THING_TYPE_UNSUPPORTED),
PHILIPS_R1("philips.light.sread1", "Xiaomi Philips Eyecare Smart Lamp 2",
MiIoBindingConstants.THING_TYPE_UNSUPPORTED),
MiIoBindingConstants.THING_TYPE_BASIC),
PHILIPS_C("philips.light.ceiling", "Xiaomi Philips LED Ceiling Lamp", MiIoBindingConstants.THING_TYPE_BASIC),
PHILIPS_C2("philips.light.zyceiling", "Xiaomi Philips LED Ceiling Lamp", MiIoBindingConstants.THING_TYPE_BASIC),
PHILIPS_BULB("philips.light.bulb", "Xiaomi Philips Bulb", MiIoBindingConstants.THING_TYPE_BASIC),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public enum CommandParameterType {
EMPTY("empty"),
ONOFF("onoff"),
STRING("string"),
CUSTOMSTRING("customstring"),
NUMBER("number"),
COLOR("color"),
UNKNOWN("unknown");
Expand Down

0 comments on commit 36b2780

Please sign in to comment.