From e7eb461b4e03646420fc8e61953ca34800434e3e Mon Sep 17 00:00:00 2001 From: tslagle13 Date: Tue, 13 Dec 2016 14:37:49 -0800 Subject: [PATCH 1/5] [DVCSMP-2273] Fix for NPE for slave/master settings --- .../color-coordinator.groovy | 77 ++++++++++--------- 1 file changed, 42 insertions(+), 35 deletions(-) diff --git a/smartapps/michaelstruck/color-coordinator.src/color-coordinator.groovy b/smartapps/michaelstruck/color-coordinator.src/color-coordinator.groovy index f3d6ce2..d36805c 100644 --- a/smartapps/michaelstruck/color-coordinator.src/color-coordinator.groovy +++ b/smartapps/michaelstruck/color-coordinator.src/color-coordinator.groovy @@ -1,10 +1,11 @@ /** * Color Coordinator - * Version 1.1.0 - 11/9/16 + * Version 1.1.1 - 11/9/16 * By Michael Struck * * 1.0.0 - Initial release * 1.1.0 - Fixed issue where master can be part of slaves. This causes a loop that impacts SmartThings. + * 1.1.1 - Fix NPE being thrown for slave/master inputs being empty. * * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except @@ -40,10 +41,10 @@ def mainPage() { } } section("Master Light") { - input "master", "capability.colorControl", title: "Colored Light" + input "master", "capability.colorControl", title: "Colored Light", required: true } section("Lights that follow the master settings") { - input "slaves", "capability.colorControl", title: "Colored Lights", multiple: true, required: false, submitOnChange: true + input "slaves", "capability.colorControl", title: "Colored Lights", multiple: true, required: true, submitOnChange: true } section([mobileOnly:true], "Options") { input "randomYes", "bool",title: "When Master Turned On, Randomize Color", defaultValue: false @@ -81,40 +82,44 @@ def init() { } //----------------------------------- def onOffHandler(evt){ - if (!slaves.id.find{it==master.id}){ - if (master.currentValue("switch") == "on"){ - if (randomYes) getRandomColorMaster() - else slaves?.on() - } - else { - slaves?.off() - } + if (slaves && master) { + if (!slaves?.id.find{it==master.id}){ + if (master?.currentValue("switch") == "on"){ + if (randomYes) getRandomColorMaster() + else slaves?.on() + } + else { + slaves?.off() + } + } } } def colorHandler(evt) { - if (!slaves.id.find{it==master.id} && master.currentValue("switch") == "on"){ - log.debug "Changing Slave units H,S,L" - def dimLevel = master.currentValue("level") - def hueLevel = master.currentValue("hue") - def saturationLevel = master.currentValue("saturation") - def newValue = [hue: hueLevel, saturation: saturationLevel, level: dimLevel as Integer] - slaves?.setColor(newValue) - try { - log.debug "Changing Slave color temp" - def tempLevel = master.currentValue("colorTemperature") - slaves?.setColorTemperature(tempLevel) - } - catch (e){ - log.debug "Color temp for master --" - } + if (slaves && master) { + if (!slaves?.id?.find{it==master.id} && master?.currentValue("switch") == "on"){ + log.debug "Changing Slave units H,S,L" + def dimLevel = master?.currentValue("level") + def hueLevel = master?.currentValue("hue") + def saturationLevel = master.currentValue("saturation") + def newValue = [hue: hueLevel, saturation: saturationLevel, level: dimLevel as Integer] + slaves?.setColor(newValue) + try { + log.debug "Changing Slave color temp" + def tempLevel = master?.currentValue("colorTemperature") + slaves?.setColorTemperature(tempLevel) + } + catch (e){ + log.debug "Color temp for master --" + } + } } } def getRandomColorMaster(){ def hueLevel = Math.floor(Math.random() *1000) def saturationLevel = Math.floor(Math.random() * 100) - def dimLevel = master.currentValue("level") + def dimLevel = master?.currentValue("level") def newValue = [hue: hueLevel, saturation: saturationLevel, level: dimLevel as Integer] log.debug hueLevel log.debug saturationLevel @@ -123,12 +128,14 @@ def getRandomColorMaster(){ } def tempHandler(evt){ - if (!slaves.id.find{it==master.id} && master.currentValue("switch") == "on"){ - if (evt.value != "--") { - log.debug "Changing Slave color temp based on Master change" - def tempLevel = master.currentValue("colorTemperature") - slaves?.setColorTemperature(tempLevel) - } + if (slaves && master) { + if (!slaves?.id?.find{it==master?.id} && master?.currentValue("switch") == "on"){ + if (evt.value != "--") { + log.debug "Changing Slave color temp based on Master change" + def tempLevel = master.currentValue("colorTemperature") + slaves?.setColorTemperature(tempLevel) + } + } } } @@ -139,7 +146,7 @@ private def textAppName() { } private def textVersion() { - def text = "Version 1.1.0 (11/09/2016)" + def text = "Version 1.1.1 (12/13/2016)" } private def textCopyright() { @@ -166,4 +173,4 @@ private def textHelp() { "This application will allow you to control the settings of multiple colored lights with one control. " + "Simply choose a master control light, and then choose the lights that will follow the settings of the master, "+ "including on/off conditions, hue, saturation, level and color temperature. Also includes a random color feature." -} \ No newline at end of file +} From a4bc2480063d1acc13ba7e49e03277d0f204aa17 Mon Sep 17 00:00:00 2001 From: tslagle13 Date: Wed, 14 Dec 2016 11:40:02 -0800 Subject: [PATCH 2/5] One further fix for NPEs --- .../color-coordinator.src/color-coordinator.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/smartapps/michaelstruck/color-coordinator.src/color-coordinator.groovy b/smartapps/michaelstruck/color-coordinator.src/color-coordinator.groovy index d36805c..dc5dfb7 100644 --- a/smartapps/michaelstruck/color-coordinator.src/color-coordinator.groovy +++ b/smartapps/michaelstruck/color-coordinator.src/color-coordinator.groovy @@ -34,7 +34,7 @@ preferences { def mainPage() { dynamicPage(name: "mainPage", title: "", install: true, uninstall: false) { - def masterInList = slaves.id.find{it==master.id} + def masterInList = slaves?.id?.find{it==master?.id} if (masterInList) { section ("**WARNING**"){ paragraph "You have included the Master Light in the Slave Group. This will cause a loop in execution. Please remove this device from the Slave Group.", image: "https://raw.githubusercontent.com/MichaelStruck/SmartThingsPublic/master/img/caution.png" @@ -83,7 +83,7 @@ def init() { //----------------------------------- def onOffHandler(evt){ if (slaves && master) { - if (!slaves?.id.find{it==master.id}){ + if (!slaves?.id.find{it==master?.id}){ if (master?.currentValue("switch") == "on"){ if (randomYes) getRandomColorMaster() else slaves?.on() @@ -97,7 +97,7 @@ def onOffHandler(evt){ def colorHandler(evt) { if (slaves && master) { - if (!slaves?.id?.find{it==master.id} && master?.currentValue("switch") == "on"){ + if (!slaves?.id?.find{it==master?.id} && master?.currentValue("switch") == "on"){ log.debug "Changing Slave units H,S,L" def dimLevel = master?.currentValue("level") def hueLevel = master?.currentValue("hue") From b7a08a88e07124b418428b67e694a7af7e900f6f Mon Sep 17 00:00:00 2001 From: Vinay Rao Date: Thu, 5 Jan 2017 16:41:50 -0800 Subject: [PATCH 3/5] DEVC-518 Iris Smart Water Sensor --- .../smartsense-moisture-sensor.groovy | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/devicetypes/smartthings/smartsense-moisture-sensor.src/smartsense-moisture-sensor.groovy b/devicetypes/smartthings/smartsense-moisture-sensor.src/smartsense-moisture-sensor.groovy index a8cb9d5..2f6e884 100644 --- a/devicetypes/smartthings/smartsense-moisture-sensor.src/smartsense-moisture-sensor.groovy +++ b/devicetypes/smartthings/smartsense-moisture-sensor.src/smartsense-moisture-sensor.groovy @@ -29,9 +29,10 @@ metadata { command "enrollResponse" - fingerprint inClusters: "0000,0001,0003,0402,0500,0020,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3315-S", deviceJoinName: "Water Leak Sensor" - fingerprint inClusters: "0000,0001,0003,0402,0500,0020,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3315" - fingerprint inClusters: "0000,0001,0003,0402,0500,0020,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3315-Seu", deviceJoinName: "Water Leak Sensor" + fingerprint inClusters: "0000,0001,0003,0402,0500,0020,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3315-S", deviceJoinName: "Water Leak Sensor" + fingerprint inClusters: "0000,0001,0003,0402,0500,0020,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3315" + fingerprint inClusters: "0000,0001,0003,0402,0500,0020,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3315-Seu", deviceJoinName: "Water Leak Sensor" + fingerprint inClusters: "0000,0001,0003,0020,0402,0500,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3315-L", deviceJoinName: "Iris Smart Water Sensor" fingerprint inClusters: "0000,0001,0003,000F,0020,0402,0500", outClusters: "0019", manufacturer: "SmartThings", model: "moisturev4", deviceJoinName: "Water Leak Sensor" } From 259516f21f655e34a2995c709a22e45e46572517 Mon Sep 17 00:00:00 2001 From: Vinay Rao Date: Thu, 5 Jan 2017 16:54:46 -0800 Subject: [PATCH 4/5] DEVC-520 DEVC-525 Adding Iris Button after clearing certification --- .../smartthings/zigbee-button.src/zigbee-button.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy b/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy index 3f68e62..b8d5499 100644 --- a/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy +++ b/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy @@ -28,8 +28,8 @@ metadata { fingerprint inClusters: "0000, 0001, 0003, 0020, 0402, 0B05", outClusters: "0003, 0006, 0008, 0019", manufacturer: "OSRAM", model: "LIGHTIFY Dimming Switch", deviceJoinName: "OSRAM LIGHTIFY Dimming Switch" //fingerprint inClusters: "0000, 0001, 0003, 0020, 0500", outClusters: "0003,0019", manufacturer: "CentraLite", model: "3455-L", deviceJoinName: "Iris Care Pendant" - //fingerprint inClusters: "0000, 0001, 0003, 0007, 0020, 0402, 0B05", outClusters: "0003, 0006, 0019", manufacturer: "CentraLite", model: "3460-L", deviceJoinName: "Iris Smart Button" - //fingerprint inClusters: "0000, 0001, 0003, 0007, 0020, 0B05", outClusters: "0003, 0006, 0019", manufacturer: "CentraLite", model:"3450-L", deviceJoinName: "Iris KeyFob" + fingerprint inClusters: "0000, 0001, 0003, 0007, 0020, 0402, 0B05", outClusters: "0003, 0006, 0019", manufacturer: "CentraLite", model: "3460-L", deviceJoinName: "Iris Smart Button" + fingerprint inClusters: "0000, 0001, 0003, 0007, 0020, 0B05", outClusters: "0003, 0006, 0019", manufacturer: "CentraLite", model:"3450-L", deviceJoinName: "Iris KeyFob" } simulator {} From 930c4ed914067b50e2c6f30b06774a41dda1522a Mon Sep 17 00:00:00 2001 From: Zach Varberg Date: Thu, 29 Dec 2016 10:30:08 -0600 Subject: [PATCH 5/5] Increase zigbee message delays This changes our smartsense DTHs that don't use the ZigBee library for everything to have larger delays between ZigBee messages. This is to reduce the network load to try to work around some of the poorer behaving ZigBee routers we support. This resolves: https://smartthings.atlassian.net/browse/DPROT-223 --- .../ge-link-bulb.src/ge-link-bulb.groovy | 4 +-- .../smartpower-dimming-outlet.groovy | 28 +++++++++++-------- .../smartpower-outlet-v1.groovy | 4 +-- .../smartpower-outlet.groovy | 5 ++-- .../smartsense-moisture-sensor.groovy | 10 +++---- .../smartsense-motion-sensor.groovy | 10 +++---- .../smartsense-multi-sensor.groovy | 4 +-- .../smartsense-open-closed-sensor.groovy | 10 +++---- .../smartsense-temp-humidity-sensor.groovy | 6 ++-- 9 files changed, 43 insertions(+), 38 deletions(-) diff --git a/devicetypes/smartthings/ge-link-bulb.src/ge-link-bulb.groovy b/devicetypes/smartthings/ge-link-bulb.src/ge-link-bulb.groovy index d806b69..a2b77ad 100644 --- a/devicetypes/smartthings/ge-link-bulb.src/ge-link-bulb.groovy +++ b/devicetypes/smartthings/ge-link-bulb.src/ge-link-bulb.groovy @@ -99,7 +99,7 @@ def parse(String description) { def poll() { def refreshCmds = [ - "st wattr 0x${device.deviceNetworkId} 1 8 0x10 0x21 {${state?.dOnOff ?: '0000'}}", "delay 500" + "st wattr 0x${device.deviceNetworkId} 1 8 0x10 0x21 {${state?.dOnOff ?: '0000'}}", "delay 2000" ] return refreshCmds + zigbee.onOffRefresh() + zigbee.levelRefresh() @@ -197,7 +197,7 @@ def off() { def refresh() { def refreshCmds = [ - "st wattr 0x${device.deviceNetworkId} 1 8 0x10 0x21 {${state?.dOnOff ?: '0000'}}", "delay 500" + "st wattr 0x${device.deviceNetworkId} 1 8 0x10 0x21 {${state?.dOnOff ?: '0000'}}", "delay 2000" ] return refreshCmds + zigbee.onOffRefresh() + zigbee.levelRefresh() + zigbee.onOffConfig() diff --git a/devicetypes/smartthings/smartpower-dimming-outlet.src/smartpower-dimming-outlet.groovy b/devicetypes/smartthings/smartpower-dimming-outlet.src/smartpower-dimming-outlet.groovy index 9539376..faaed37 100644 --- a/devicetypes/smartthings/smartpower-dimming-outlet.src/smartpower-dimming-outlet.groovy +++ b/devicetypes/smartthings/smartpower-dimming-outlet.src/smartpower-dimming-outlet.groovy @@ -128,9 +128,9 @@ def setLevel(value) { def refresh() { [ - "st rattr 0x${device.deviceNetworkId} ${endpointId} 6 0", "delay 500", - "st rattr 0x${device.deviceNetworkId} ${endpointId} 8 0", "delay 500", - "st rattr 0x${device.deviceNetworkId} ${endpointId} 0x0B04 0x050B", "delay 500" + "st rattr 0x${device.deviceNetworkId} ${endpointId} 6 0", "delay 2000", + "st rattr 0x${device.deviceNetworkId} ${endpointId} 8 0", "delay 2000", + "st rattr 0x${device.deviceNetworkId} ${endpointId} 0x0B04 0x050B", "delay 2000" ] } @@ -313,9 +313,9 @@ def isDescriptionPower(descMap) { def onOffConfig() { [ - "zdo bind 0x${device.deviceNetworkId} 1 ${endpointId} 6 {${device.zigbeeId}} {}", "delay 200", - "zcl global send-me-a-report 6 0 0x10 0 600 {01}", - "send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 1500" + "zdo bind 0x${device.deviceNetworkId} 1 ${endpointId} 6 {${device.zigbeeId}} {}", "delay 2000", + "zcl global send-me-a-report 6 0 0x10 0 600 {01}", "delay 200", + "send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 2000" ] } @@ -323,9 +323,9 @@ def onOffConfig() { //min level change is 01 def levelConfig() { [ - "zdo bind 0x${device.deviceNetworkId} 1 ${endpointId} 8 {${device.zigbeeId}} {}", "delay 200", - "zcl global send-me-a-report 8 0 0x20 5 3600 {01}", - "send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 1500" + "zdo bind 0x${device.deviceNetworkId} 1 ${endpointId} 8 {${device.zigbeeId}} {}", "delay 2000", + "zcl global send-me-a-report 8 0 0x20 5 3600 {01}", "delay 200", + "send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 2000" ] } @@ -333,9 +333,10 @@ def levelConfig() { //min change in value is 05 def powerConfig() { [ - "zdo bind 0x${device.deviceNetworkId} 1 ${endpointId} 0x0B04 {${device.zigbeeId}} {}", "delay 200", + "zdo bind 0x${device.deviceNetworkId} 1 ${endpointId} 0x0B04 {${device.zigbeeId}} {}", "delay 2000", "zcl global send-me-a-report 0x0B04 0x050B 0x29 1 600 {05 00}", //The send-me-a-report is custom to the attribute type for CentraLite - "send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500" + "delay 200", + "send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 2000" ] } @@ -344,7 +345,10 @@ def setLevelWithRate(level, rate) { rate = "0000" } level = convertToHexString(level * 255 / 100) //Converting the 0-100 range to 0-FF range in hex - "st cmd 0x${device.deviceNetworkId} ${endpointId} 8 4 {$level $rate}" + [ + "st cmd 0x${device.deviceNetworkId} ${endpointId} 8 4 {$level $rate}", + "delay 2000" + ] } String convertToHexString(value, width=2) { diff --git a/devicetypes/smartthings/smartpower-outlet-v1.src/smartpower-outlet-v1.groovy b/devicetypes/smartthings/smartpower-outlet-v1.src/smartpower-outlet-v1.groovy index a65c5bc..4be7bce 100644 --- a/devicetypes/smartthings/smartpower-outlet-v1.src/smartpower-outlet-v1.groovy +++ b/devicetypes/smartthings/smartpower-outlet-v1.src/smartpower-outlet-v1.groovy @@ -51,7 +51,7 @@ def on() { 'zcl on-off on', 'delay 200', "send 0x${zigbee.deviceNetworkId} 0x01 0x${zigbee.endpointId}", - 'delay 500' + 'delay 2000' ] @@ -62,6 +62,6 @@ def off() { 'zcl on-off off', 'delay 200', "send 0x${zigbee.deviceNetworkId} 0x01 0x${zigbee.endpointId}", - 'delay 500' + 'delay 2000' ] } diff --git a/devicetypes/smartthings/smartpower-outlet.src/smartpower-outlet.groovy b/devicetypes/smartthings/smartpower-outlet.src/smartpower-outlet.groovy index 03e475c..5001ad8 100644 --- a/devicetypes/smartthings/smartpower-outlet.src/smartpower-outlet.groovy +++ b/devicetypes/smartthings/smartpower-outlet.src/smartpower-outlet.groovy @@ -157,9 +157,10 @@ def configure() { //min change in value is 01 def powerConfig() { [ - "zdo bind 0x${device.deviceNetworkId} 1 ${endpointId} 0x0B04 {${device.zigbeeId}} {}", "delay 200", + "zdo bind 0x${device.deviceNetworkId} 1 ${endpointId} 0x0B04 {${device.zigbeeId}} {}", "delay 2000", "zcl global send-me-a-report 0x0B04 0x050B 0x29 1 600 {05 00}", //The send-me-a-report is custom to the attribute type for CentraLite - "send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500" + "delay 200", + "send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 2000" ] } diff --git a/devicetypes/smartthings/smartsense-moisture-sensor.src/smartsense-moisture-sensor.groovy b/devicetypes/smartthings/smartsense-moisture-sensor.src/smartsense-moisture-sensor.groovy index a8cb9d5..403562b 100644 --- a/devicetypes/smartthings/smartsense-moisture-sensor.src/smartsense-moisture-sensor.groovy +++ b/devicetypes/smartthings/smartsense-moisture-sensor.src/smartsense-moisture-sensor.groovy @@ -285,8 +285,8 @@ def ping() { def refresh() { log.debug "Refreshing Temperature and Battery" def refreshCmds = [ - "st rattr 0x${device.deviceNetworkId} 1 0x402 0", "delay 200", - "st rattr 0x${device.deviceNetworkId} 1 1 0x20", "delay 200" + "st rattr 0x${device.deviceNetworkId} 1 0x402 0", "delay 2000", + "st rattr 0x${device.deviceNetworkId} 1 1 0x20", "delay 2000" ] return refreshCmds + enrollResponse() @@ -308,10 +308,10 @@ def enrollResponse() { [ //Resending the CIE in case the enroll request is sent before CIE is written "zcl global write 0x500 0x10 0xf0 {${zigbeeEui}}", "delay 200", - "send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500", + "send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 2000", //Enroll Response - "raw 0x500 {01 23 00 00 00}", - "send 0x${device.deviceNetworkId} 1 1", "delay 200" + "raw 0x500 {01 23 00 00 00}", "delay 200", + "send 0x${device.deviceNetworkId} 1 1", "delay 2000" ] } diff --git a/devicetypes/smartthings/smartsense-motion-sensor.src/smartsense-motion-sensor.groovy b/devicetypes/smartthings/smartsense-motion-sensor.src/smartsense-motion-sensor.groovy index fa71232..32f95dc 100644 --- a/devicetypes/smartthings/smartsense-motion-sensor.src/smartsense-motion-sensor.groovy +++ b/devicetypes/smartthings/smartsense-motion-sensor.src/smartsense-motion-sensor.groovy @@ -298,8 +298,8 @@ def ping() { def refresh() { log.debug "refresh called" def refreshCmds = [ - "st rattr 0x${device.deviceNetworkId} 1 0x402 0", "delay 200", - "st rattr 0x${device.deviceNetworkId} 1 1 0x20", "delay 200" + "st rattr 0x${device.deviceNetworkId} 1 0x402 0", "delay 2000", + "st rattr 0x${device.deviceNetworkId} 1 1 0x20", "delay 2000" ] return refreshCmds + enrollResponse() @@ -321,10 +321,10 @@ def enrollResponse() { [ //Resending the CIE in case the enroll request is sent before CIE is written "zcl global write 0x500 0x10 0xf0 {${zigbeeEui}}", "delay 200", - "send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500", + "send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 2000", //Enroll Response - "raw 0x500 {01 23 00 00 00}", - "send 0x${device.deviceNetworkId} 1 1", "delay 200" + "raw 0x500 {01 23 00 00 00}", "delay 200", + "send 0x${device.deviceNetworkId} 1 1", "delay 2000" ] } diff --git a/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy b/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy index 5cebcd0..16a2ed2 100644 --- a/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy +++ b/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy @@ -428,10 +428,10 @@ def enrollResponse() { [ //Resending the CIE in case the enroll request is sent before CIE is written "zcl global write 0x500 0x10 0xf0 {${zigbeeEui}}", "delay 200", - "send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500", + "send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 2000", //Enroll Response "raw 0x500 {01 23 00 00 00}", "delay 200", - "send 0x${device.deviceNetworkId} 1 1", "delay 200" + "send 0x${device.deviceNetworkId} 1 1", "delay 2000" ] } diff --git a/devicetypes/smartthings/smartsense-open-closed-sensor.src/smartsense-open-closed-sensor.groovy b/devicetypes/smartthings/smartsense-open-closed-sensor.src/smartsense-open-closed-sensor.groovy index b8c9196..7520ffb 100644 --- a/devicetypes/smartthings/smartsense-open-closed-sensor.src/smartsense-open-closed-sensor.groovy +++ b/devicetypes/smartthings/smartsense-open-closed-sensor.src/smartsense-open-closed-sensor.groovy @@ -252,8 +252,8 @@ def ping() { def refresh() { log.debug "Refreshing Temperature and Battery" def refreshCmds = [ - "st rattr 0x${device.deviceNetworkId} 1 0x402 0", "delay 200", - "st rattr 0x${device.deviceNetworkId} 1 1 0x20", "delay 200" + "st rattr 0x${device.deviceNetworkId} 1 0x402 0", "delay 2000", + "st rattr 0x${device.deviceNetworkId} 1 1 0x20", "delay 2000" ] return refreshCmds + enrollResponse() @@ -277,10 +277,10 @@ def enrollResponse() { [ //Resending the CIE in case the enroll request is sent before CIE is written "zcl global write 0x500 0x10 0xf0 {${zigbeeEui}}", "delay 200", - "send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500", + "send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 2000", //Enroll Response - "raw 0x500 {01 23 00 00 00}", - "send 0x${device.deviceNetworkId} 1 1", "delay 200" + "raw 0x500 {01 23 00 00 00}", "delay 200", + "send 0x${device.deviceNetworkId} 1 1", "delay 2000" ] } diff --git a/devicetypes/smartthings/smartsense-temp-humidity-sensor.src/smartsense-temp-humidity-sensor.groovy b/devicetypes/smartthings/smartsense-temp-humidity-sensor.src/smartsense-temp-humidity-sensor.groovy index cd9648e..666bf01 100644 --- a/devicetypes/smartthings/smartsense-temp-humidity-sensor.src/smartsense-temp-humidity-sensor.groovy +++ b/devicetypes/smartthings/smartsense-temp-humidity-sensor.src/smartsense-temp-humidity-sensor.groovy @@ -270,9 +270,9 @@ def configure() { log.debug "Configuring Reporting and Bindings." def humidityConfigCmds = [ - "zdo bind 0x${device.deviceNetworkId} 1 1 0xFC45 {${device.zigbeeId}} {}", "delay 500", - "zcl global send-me-a-report 0xFC45 0 0x29 30 3600 {6400}", - "send 0x${device.deviceNetworkId} 1 1", "delay 500" + "zdo bind 0x${device.deviceNetworkId} 1 1 0xFC45 {${device.zigbeeId}} {}", "delay 2000", + "zcl global send-me-a-report 0xFC45 0 0x29 30 3600 {6400}", "delay 200", + "send 0x${device.deviceNetworkId} 1 1", "delay 2000" ] // temperature minReportTime 30 seconds, maxReportTime 5 min. Reporting interval if no activity