From a79c9c1aded7871a310f180b791b20afed168178 Mon Sep 17 00:00:00 2001 From: Lars Finander Date: Wed, 17 Aug 2016 14:53:01 -0600 Subject: [PATCH 1/4] SVD-2465 Philips Hue No description for slider -Changed Kelvin tile to Whites (same as Philips Hue app) --- devicetypes/smartthings/hue-bulb.src/hue-bulb.groovy | 12 ++++++------ .../hue-white-ambiance-bulb.groovy | 3 +-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/devicetypes/smartthings/hue-bulb.src/hue-bulb.groovy b/devicetypes/smartthings/hue-bulb.src/hue-bulb.groovy index d533006..1cec1f6 100644 --- a/devicetypes/smartthings/hue-bulb.src/hue-bulb.groovy +++ b/devicetypes/smartthings/hue-bulb.src/hue-bulb.groovy @@ -43,13 +43,13 @@ metadata { } } - controlTile("colorTempSliderControl", "device.colorTemperature", "slider", width: 4, height: 2, inactiveLabel: false, range:"(2000..6500)") { - state "colorTemperature", action:"color temperature.setColorTemperature" - } + controlTile("colorTempSliderControl", "device.colorTemperature", "slider", width: 4, height: 2, inactiveLabel: false, range:"(2000..6500)") { + state "colorTemperature", action:"color temperature.setColorTemperature" + } - valueTile("colorTemp", "device.colorTemperature", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { - state "colorTemperature", label: '${currentValue} K' - } + valueTile("colorTemp", "device.colorTemperature", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { + state "colorTemperature", label: 'WHITES' + } standardTile("reset", "device.reset", height: 2, width: 2, inactiveLabel: false, decoration: "flat") { state "default", label:"Reset Color", action:"reset", icon:"st.lights.philips.hue-single" diff --git a/devicetypes/smartthings/hue-white-ambiance-bulb.src/hue-white-ambiance-bulb.groovy b/devicetypes/smartthings/hue-white-ambiance-bulb.src/hue-white-ambiance-bulb.groovy index c9bedb7..03aa095 100644 --- a/devicetypes/smartthings/hue-white-ambiance-bulb.src/hue-white-ambiance-bulb.groovy +++ b/devicetypes/smartthings/hue-white-ambiance-bulb.src/hue-white-ambiance-bulb.groovy @@ -41,7 +41,7 @@ metadata { } valueTile("colorTemp", "device.colorTemperature", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { - state "colorTemperature", label: '${currentValue} K' + state "colorTemperature", label: 'WHITES' } standardTile("refresh", "device.refresh", height: 2, width: 2, inactiveLabel: false, decoration: "flat") { @@ -107,4 +107,3 @@ void refresh() { log.debug "Executing 'refresh'" parent.manualRefresh() } - From ef47ec93938aa13ce98cc46e20bf6b6c562f0e69 Mon Sep 17 00:00:00 2001 From: Vinay Rao Date: Wed, 17 Aug 2016 18:21:54 -0700 Subject: [PATCH 2/4] hotfix for level jumping issues --- .../smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy | 5 ++++- .../smartthings/zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy | 5 ++++- .../zigbee-white-color-temperature-bulb.groovy | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy b/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy index 72809f5..666a1ec 100644 --- a/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy +++ b/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy @@ -53,7 +53,10 @@ def parse(String description) { def event = zigbee.getEvent(description) if (event) { - sendEvent(event) + if (event.name=="level" && event.value==0) {} + else { + sendEvent(event) + } } else { log.warn "DID NOT PARSE MESSAGE for description : $description" diff --git a/devicetypes/smartthings/zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy b/devicetypes/smartthings/zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy index ade4987..a1d3b49 100644 --- a/devicetypes/smartthings/zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy +++ b/devicetypes/smartthings/zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy @@ -81,7 +81,10 @@ def parse(String description) { def finalResult = zigbee.getEvent(description) if (finalResult) { log.debug finalResult - sendEvent(finalResult) + if (finalResult.name=="level" && finalResult.value==0) {} + else { + sendEvent(finalResult) + } } else { def zigbeeMap = zigbee.parseDescriptionAsMap(description) diff --git a/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy b/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy index 50f270d..eda7009 100644 --- a/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy +++ b/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy @@ -75,7 +75,10 @@ def parse(String description) { log.debug "description is $description" def event = zigbee.getEvent(description) if (event) { - sendEvent(event) + if (event.name=="level" && event.value==0) {} + else { + sendEvent(event) + } } else { log.warn "DID NOT PARSE MESSAGE for description : $description" From 53fc948b00d2cdb18cc28fbe01159b1c62d56d43 Mon Sep 17 00:00:00 2001 From: Vinay Rao Date: Thu, 18 Aug 2016 15:04:48 -0700 Subject: [PATCH 3/4] SSVD-2465 changing the kelvin tile to name tiles --- .../zigbee-rgbw-bulb.groovy | 27 ++++++++++++++++--- ...zigbee-white-color-temperature-bulb.groovy | 9 +++---- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/devicetypes/smartthings/zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy b/devicetypes/smartthings/zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy index a1d3b49..de4f4d8 100644 --- a/devicetypes/smartthings/zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy +++ b/devicetypes/smartthings/zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy @@ -28,6 +28,9 @@ metadata { capability "Switch" capability "Switch Level" + attribute "colorName", "string" + command "setGenericName" + fingerprint profileId: "0104", inClusters: "0000,0003,0004,0005,0006,0008,0300,0B04,FC0F", outClusters: "0019", manufacturer: "OSRAM", model: "LIGHTIFY Flex RGBW", deviceJoinName: "OSRAM LIGHTIFY LED FLEXIBLE STRIP RGBW" fingerprint profileId: "0104", inClusters: "0000,0003,0004,0005,0006,0008,0300,0B04,FC0F", outClusters: "0019", manufacturer: "OSRAM", model: "Flex RGBW", deviceJoinName: "OSRAM LIGHTIFY LED FLEXIBLE STRIP RGBW" fingerprint profileId: "0104", inClusters: "0000,0003,0004,0005,0006,0008,0300,0B04,FC0F", outClusters: "0019", manufacturer: "OSRAM", model: "LIGHTIFY A19 RGBW", deviceJoinName: "OSRAM LIGHTIFY LED A19 RGBW" @@ -54,15 +57,15 @@ metadata { controlTile("colorTempSliderControl", "device.colorTemperature", "slider", width: 4, height: 2, inactiveLabel: false, range:"(2700..6500)") { state "colorTemperature", action:"color temperature.setColorTemperature" } - valueTile("colorTemp", "device.colorTemperature", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { - state "colorTemperature", label: '${currentValue} K' + valueTile("colorName", "device.colorName", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { + state "colorName", label: '${currentValue}' } standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh" } main(["switch"]) - details(["switch", "colorTempSliderControl", "colorTemp", "refresh"]) + details(["switch", "colorTempSliderControl", "colorName", "refresh"]) } } @@ -124,9 +127,27 @@ def configure() { } def setColorTemperature(value) { + setGenericName(value) zigbee.setColorTemperature(value) } +//Naming based on the wiki article here: http://en.wikipedia.org/wiki/Color_temperature +def setGenericName(value){ + if (value != null) { + def genericName = "White" + if (value < 3300) { + genericName = "Soft White" + } else if (value < 4150) { + genericName = "Moonlight" + } else if (value <= 5000) { + genericName = "Cool White" + } else if (value >= 5000) { + genericName = "Daylight" + } + sendEvent(name: "colorName", value: genericName) + } +} + def setLevel(value) { zigbee.setLevel(value) } diff --git a/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy b/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy index eda7009..539d8fd 100644 --- a/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy +++ b/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy @@ -49,9 +49,6 @@ metadata { tileAttribute ("device.level", key: "SLIDER_CONTROL") { attributeState "level", action:"switch level.setLevel" } - tileAttribute ("colorName", key: "SECONDARY_CONTROL") { - attributeState "colorName", label:'${currentValue}' - } } standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { @@ -61,12 +58,12 @@ metadata { controlTile("colorTempSliderControl", "device.colorTemperature", "slider", width: 4, height: 2, inactiveLabel: false, range:"(2700..6500)") { state "colorTemperature", action:"color temperature.setColorTemperature" } - valueTile("colorTemp", "device.colorTemperature", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { - state "colorTemperature", label: '${currentValue} K' + valueTile("colorName", "device.colorName", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { + state "colorName", label: '${currentValue}' } main(["switch"]) - details(["switch", "colorTempSliderControl", "colorTemp", "refresh"]) + details(["switch", "colorTempSliderControl", "colorName", "refresh"]) } } From 6009bc52ab168195c45ed789600339cf50088cb5 Mon Sep 17 00:00:00 2001 From: Vinay Rao Date: Tue, 23 Aug 2016 02:59:06 -0700 Subject: [PATCH 4/4] SSVD-2532 setting up the generic name at install --- .../zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy | 13 ++++++++----- .../zigbee-white-color-temperature-bulb.groovy | 3 +++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/devicetypes/smartthings/zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy b/devicetypes/smartthings/zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy index de4f4d8..0f4c419 100644 --- a/devicetypes/smartthings/zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy +++ b/devicetypes/smartthings/zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy @@ -81,12 +81,15 @@ private getATTRIBUTE_COLOR_TEMPERATURE() { 0x0007 } def parse(String description) { log.debug "description is $description" - def finalResult = zigbee.getEvent(description) - if (finalResult) { - log.debug finalResult - if (finalResult.name=="level" && finalResult.value==0) {} + def event = zigbee.getEvent(description) + if (event) { + log.debug event + if (event.name=="level" && event.value==0) {} else { - sendEvent(finalResult) + if (event.name=="colorTemperature") { + setGenericName(event.value) + } + sendEvent(event) } } else { diff --git a/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy b/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy index 539d8fd..e2cac3a 100644 --- a/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy +++ b/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy @@ -74,6 +74,9 @@ def parse(String description) { if (event) { if (event.name=="level" && event.value==0) {} else { + if (event.name=="colorTemperature") { + setGenericName(event.value) + } sendEvent(event) } }