From 6325101f5297be2ce2a15376af10b308194e118e Mon Sep 17 00:00:00 2001 From: Donald Kirker Date: Tue, 6 Jun 2017 03:13:52 -0700 Subject: [PATCH 1/2] ICP-1097 Fix Sengled Classic default level on pairing Code brought oever from @varzac commit 8bcbe7b924eb10214a5a91709fba2779a44c3e39 Original commit message: > Fix sengled use of FF for max level > This works around the fact that sengled element touches can get back > into a state of reporting an invalid value (of FF) if the physical > button on the bulb is used to cycle back to the 100% state. Here we > interpret FF as FE for sengled and then issue a move to level command to > put it in a state where it will report FE until the level is changed > again. > > This resolves: https://smartthings.atlassian.net/browse/DVCSMP-2597 While the Classic does not have a physical button, since it does represent 100% as FF we want to always catch this. --- .../zigbee-dimmer.src/zigbee-dimmer.groovy | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy b/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy index 1a98c39..820e07a 100644 --- a/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy +++ b/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy @@ -66,22 +66,29 @@ def parse(String description) { else { sendEvent(event) } - } - else { - def cluster = zigbee.parse(description) - - if (cluster && cluster.clusterId == 0x0006 && cluster.command == 0x07) { - if (cluster.data[0] == 0x00) { + } else { + def descMap = zigbee.parseDescriptionAsMap(description) + if (descMap && descMap.clusterInt == 0x0006 && descMap.commandInt == 0x07) { + if (descMap.data[0] == "00") { log.debug "ON/OFF REPORTING CONFIG RESPONSE: " + cluster sendEvent(name: "checkInterval", value: 60 * 12, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) - } - else { + } else { log.warn "ON/OFF REPORTING CONFIG FAILED- error code:${cluster.data[0]}" } - } - else { + } else if (device.getDataValue("manufacturer") == "sengled" && descMap && descMap.clusterInt == 0x0008 && descMap.attrInt == 0x0000) { + // This is being done because the sengled element touch/classic incorrectly uses the value 0xFF for the max level. + // Per the ZCL spec for the UINT8 data type 0xFF is an invalid value, and 0xFE should be the max. Here we + // manually handle the invalid attribute value since it will be ignored by getEvent as an invalid value. + // We also set the level of the bulb to 0xFE so future level reports will be 0xFE until it is changed by + // something else. + if (descMap.value.toUpperCase() == "FF") { + descMap.value = "FE" + } + sendHubCommand(zigbee.command(zigbee.LEVEL_CONTROL_CLUSTER, 0x00, "FE0000").collect { new physicalgraph.device.HubAction(it) }, 0) + sendEvent(zigbee.getEventFromAttrData(descMap.clusterInt, descMap.attrInt, descMap.encoding, descMap.value)) + } else { log.warn "DID NOT PARSE MESSAGE for description : $description" - log.debug "${cluster}" + log.debug "${descMap}" } } } From 117adea58601b40d8dd051cf845eda2953a6e819 Mon Sep 17 00:00:00 2001 From: Vinay Rao Date: Fri, 9 Jun 2017 11:44:06 -0700 Subject: [PATCH 2/2] SLC-82 Marking old connect apps and device types as deprecated --- .../smartthings/bose-soundtouch.src/bose-soundtouch.groovy | 2 ++ devicetypes/smartthings/hue-bloom.src/hue-bloom.groovy | 2 ++ devicetypes/smartthings/hue-bridge.src/hue-bridge.groovy | 2 ++ devicetypes/smartthings/hue-bulb.src/hue-bulb.groovy | 2 ++ devicetypes/smartthings/hue-lux-bulb.src/hue-lux-bulb.groovy | 2 ++ .../hue-white-ambiance-bulb.src/hue-white-ambiance-bulb.groovy | 2 ++ .../smartthings/wemo-light-switch.src/wemo-light-switch.groovy | 2 ++ devicetypes/smartthings/wemo-motion.src/wemo-motion.groovy | 2 ++ devicetypes/smartthings/wemo-switch.src/wemo-switch.groovy | 2 ++ .../bose-soundtouch-connect.src/bose-soundtouch-connect.groovy | 2 ++ smartapps/smartthings/hue-connect.src/hue-connect.groovy | 2 ++ smartapps/smartthings/wemo-connect.src/wemo-connect.groovy | 2 ++ 12 files changed, 24 insertions(+) diff --git a/devicetypes/smartthings/bose-soundtouch.src/bose-soundtouch.groovy b/devicetypes/smartthings/bose-soundtouch.src/bose-soundtouch.groovy index ff6a8ee..126f9fd 100644 --- a/devicetypes/smartthings/bose-soundtouch.src/bose-soundtouch.groovy +++ b/devicetypes/smartthings/bose-soundtouch.src/bose-soundtouch.groovy @@ -1,3 +1,5 @@ +//DEPRECATED. INTEGRATION MOVED TO SUPER LAN CONNECT + /** * Bose SoundTouch * diff --git a/devicetypes/smartthings/hue-bloom.src/hue-bloom.groovy b/devicetypes/smartthings/hue-bloom.src/hue-bloom.groovy index f5b44ca..c5a7d16 100644 --- a/devicetypes/smartthings/hue-bloom.src/hue-bloom.groovy +++ b/devicetypes/smartthings/hue-bloom.src/hue-bloom.groovy @@ -1,3 +1,5 @@ +//DEPRECATED. INTEGRATION MOVED TO SUPER LAN CONNECT + /** * Hue Bloom * diff --git a/devicetypes/smartthings/hue-bridge.src/hue-bridge.groovy b/devicetypes/smartthings/hue-bridge.src/hue-bridge.groovy index ed230c0..c5ed4eb 100644 --- a/devicetypes/smartthings/hue-bridge.src/hue-bridge.groovy +++ b/devicetypes/smartthings/hue-bridge.src/hue-bridge.groovy @@ -1,3 +1,5 @@ +//DEPRECATED. INTEGRATION MOVED TO SUPER LAN CONNECT + /** * Hue Bridge * diff --git a/devicetypes/smartthings/hue-bulb.src/hue-bulb.groovy b/devicetypes/smartthings/hue-bulb.src/hue-bulb.groovy index f2f0b99..8752ce4 100644 --- a/devicetypes/smartthings/hue-bulb.src/hue-bulb.groovy +++ b/devicetypes/smartthings/hue-bulb.src/hue-bulb.groovy @@ -1,3 +1,5 @@ +//DEPRECATED. INTEGRATION MOVED TO SUPER LAN CONNECT + /** * Hue Bulb * diff --git a/devicetypes/smartthings/hue-lux-bulb.src/hue-lux-bulb.groovy b/devicetypes/smartthings/hue-lux-bulb.src/hue-lux-bulb.groovy index bd786a1..60cfd69 100644 --- a/devicetypes/smartthings/hue-lux-bulb.src/hue-lux-bulb.groovy +++ b/devicetypes/smartthings/hue-lux-bulb.src/hue-lux-bulb.groovy @@ -1,3 +1,5 @@ +//DEPRECATED. INTEGRATION MOVED TO SUPER LAN CONNECT + /** * Hue Lux Bulb * 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 bae3501..0163a79 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 @@ -1,3 +1,5 @@ +//DEPRECATED. INTEGRATION MOVED TO SUPER LAN CONNECT + /** * Hue White Ambiance Bulb * diff --git a/devicetypes/smartthings/wemo-light-switch.src/wemo-light-switch.groovy b/devicetypes/smartthings/wemo-light-switch.src/wemo-light-switch.groovy index db21866..fcc2285 100644 --- a/devicetypes/smartthings/wemo-light-switch.src/wemo-light-switch.groovy +++ b/devicetypes/smartthings/wemo-light-switch.src/wemo-light-switch.groovy @@ -1,3 +1,5 @@ +//DEPRECATED. INTEGRATION MOVED TO SUPER LAN CONNECT + /** * Copyright 2015 SmartThings * diff --git a/devicetypes/smartthings/wemo-motion.src/wemo-motion.groovy b/devicetypes/smartthings/wemo-motion.src/wemo-motion.groovy index e094d27..3598ce5 100644 --- a/devicetypes/smartthings/wemo-motion.src/wemo-motion.groovy +++ b/devicetypes/smartthings/wemo-motion.src/wemo-motion.groovy @@ -1,3 +1,5 @@ +//DEPRECATED. INTEGRATION MOVED TO SUPER LAN CONNECT + /** * Copyright 2015 SmartThings * diff --git a/devicetypes/smartthings/wemo-switch.src/wemo-switch.groovy b/devicetypes/smartthings/wemo-switch.src/wemo-switch.groovy index 51894fd..783e505 100644 --- a/devicetypes/smartthings/wemo-switch.src/wemo-switch.groovy +++ b/devicetypes/smartthings/wemo-switch.src/wemo-switch.groovy @@ -1,3 +1,5 @@ +//DEPRECATED. INTEGRATION MOVED TO SUPER LAN CONNECT + /** * Copyright 2015 SmartThings * diff --git a/smartapps/smartthings/bose-soundtouch-connect.src/bose-soundtouch-connect.groovy b/smartapps/smartthings/bose-soundtouch-connect.src/bose-soundtouch-connect.groovy index 883c6e8..6a2d850 100644 --- a/smartapps/smartthings/bose-soundtouch-connect.src/bose-soundtouch-connect.groovy +++ b/smartapps/smartthings/bose-soundtouch-connect.src/bose-soundtouch-connect.groovy @@ -1,3 +1,5 @@ +//DEPRECATED. INTEGRATION MOVED TO SUPER LAN CONNECT + /** * Bose SoundTouch (Connect) * diff --git a/smartapps/smartthings/hue-connect.src/hue-connect.groovy b/smartapps/smartthings/hue-connect.src/hue-connect.groovy index 78f7c87..f72c914 100644 --- a/smartapps/smartthings/hue-connect.src/hue-connect.groovy +++ b/smartapps/smartthings/hue-connect.src/hue-connect.groovy @@ -1,3 +1,5 @@ +//DEPRECATED. INTEGRATION MOVED TO SUPER LAN CONNECT + /** * Hue Service Manager * diff --git a/smartapps/smartthings/wemo-connect.src/wemo-connect.groovy b/smartapps/smartthings/wemo-connect.src/wemo-connect.groovy index 73b4426..c0e72ca 100644 --- a/smartapps/smartthings/wemo-connect.src/wemo-connect.groovy +++ b/smartapps/smartthings/wemo-connect.src/wemo-connect.groovy @@ -1,3 +1,5 @@ +//DEPRECATED. INTEGRATION MOVED TO SUPER LAN CONNECT + /** * Copyright 2015 SmartThings *