From dc2c16ea6b34f0f45ebc5fdf37bb422f756732f3 Mon Sep 17 00:00:00 2001 From: Aeotec-ccheng <63321041+Aeotec-ccheng@users.noreply.github.com> Date: Tue, 15 Sep 2020 18:58:54 -0700 Subject: [PATCH 1/5] Z-Wave Basic Window Shade fix + Calibration - Open() and Close() buttons resolved - Calibration Parameter setting included in preference --- .../zwave-basic-window-shade.groovy | 37 +++++++++++++++---- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/devicetypes/smartthings/zwave-basic-window-shade.src/zwave-basic-window-shade.groovy b/devicetypes/smartthings/zwave-basic-window-shade.src/zwave-basic-window-shade.groovy index eb670ddf29b..cd4a2c71893 100644 --- a/devicetypes/smartthings/zwave-basic-window-shade.src/zwave-basic-window-shade.groovy +++ b/devicetypes/smartthings/zwave-basic-window-shade.src/zwave-basic-window-shade.groovy @@ -25,10 +25,10 @@ metadata { command "close" command "pause" - fingerprint mfr:"0086", prod:"0003", model:"008D", deviceJoinName: "Aeotec Window Treatment" //Aeotec Nano Shutter - fingerprint mfr:"0086", prod:"0103", model:"008D", deviceJoinName: "Aeotec Window Treatment" //Aeotec Nano Shutter - fingerprint mfr:"0371", prod:"0003", model:"008D", deviceJoinName: "Aeotec Window Treatment" //Aeotec Nano Shutter - fingerprint mfr:"0371", prod:"0103", model:"008D", deviceJoinName: "Aeotec Window Treatment" //Aeotec Nano Shutter + fingerprint mfr:"0086", prod:"0003", model:"008D", deviceJoinName: "Aeotec Nano Shutter" //Aeotec Nano Shutter + fingerprint mfr:"0086", prod:"0103", model:"008D", deviceJoinName: "Aeotec Nano Shutter" //Aeotec Nano Shutter + fingerprint mfr:"0371", prod:"0003", model:"008D", deviceJoinName: "Aeotec Nano Shutter" //Aeotec Nano Shutter + fingerprint mfr:"0371", prod:"0103", model:"008D", deviceJoinName: "Aeotec Nano Shutter" //Aeotec Nano Shutter } tiles(scale: 2) { @@ -58,11 +58,25 @@ metadata { defaultValue: false, displayDuringSetup: false ) + + input(title: "Aeotec Nano Shutter settings", + description: "Sets the Open/Close time.", + displayDuringSetup: false, + type: "paragraph", + element: "paragraph") + + input("calibrationTime", "number", + title: "Set the open/close time for motor, range = 5 - 255", + defaultValue: false, + displayDuringSetup: false, + default: 10 + ) } } } def parse(String description) { + log.debug "parse() - description: $description" def result = [] if (description.startsWith("Err")) { result = createEvent(descriptionText:description, isStateChange:true) @@ -101,11 +115,12 @@ def zwaveEvent(physicalgraph.zwave.Command cmd) { } def setButton(button) { + log.debug "button: $button" switch(button) { - case "open": + case "statelessCurtainPowerButton_open_button": open() break - case "close": + case "statelessCurtainPowerButton_close_button": close() break default: @@ -147,6 +162,14 @@ def installed() { def updated() { sendHubCommand(pause()) state.reverseDirection = reverseDirection ? reverseDirection : false + int time = calibrationTime + + if (calibrationTime >= 5 && calibrationTime <= 255) { + response([ + secure(zwave.configurationV1.configurationSet(parameterNumber: 35, size: 1, scaledConfigurationValue: time)), + ]) + } else {} + } def configure() { @@ -171,4 +194,4 @@ private getOpenValue() { private getCloseValue() { !state.reverseDirection ? 0xFF : 0x00 -} \ No newline at end of file +} From 8ccd16ab89ad4fc87b07f1fafcd64d1ade5ee8e9 Mon Sep 17 00:00:00 2001 From: Aeotec-ccheng <63321041+Aeotec-ccheng@users.noreply.github.com> Date: Wed, 16 Sep 2020 00:18:10 -0700 Subject: [PATCH 2/5] Fix of requested issues - Return pair name to "Aeotec Window Treatment" - Fixed spacing of lines 61 - 73 - Removed else block on line 171 --- .../zwave-basic-window-shade.groovy | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/devicetypes/smartthings/zwave-basic-window-shade.src/zwave-basic-window-shade.groovy b/devicetypes/smartthings/zwave-basic-window-shade.src/zwave-basic-window-shade.groovy index cd4a2c71893..102353d6470 100644 --- a/devicetypes/smartthings/zwave-basic-window-shade.src/zwave-basic-window-shade.groovy +++ b/devicetypes/smartthings/zwave-basic-window-shade.src/zwave-basic-window-shade.groovy @@ -25,10 +25,10 @@ metadata { command "close" command "pause" - fingerprint mfr:"0086", prod:"0003", model:"008D", deviceJoinName: "Aeotec Nano Shutter" //Aeotec Nano Shutter - fingerprint mfr:"0086", prod:"0103", model:"008D", deviceJoinName: "Aeotec Nano Shutter" //Aeotec Nano Shutter - fingerprint mfr:"0371", prod:"0003", model:"008D", deviceJoinName: "Aeotec Nano Shutter" //Aeotec Nano Shutter - fingerprint mfr:"0371", prod:"0103", model:"008D", deviceJoinName: "Aeotec Nano Shutter" //Aeotec Nano Shutter + fingerprint mfr:"0086", prod:"0003", model:"008D", deviceJoinName: "Aeotec Window Treatment" //Aeotec Nano Shutter + fingerprint mfr:"0086", prod:"0103", model:"008D", deviceJoinName: "Aeotec Window Treatment" //Aeotec Nano Shutter + fingerprint mfr:"0371", prod:"0003", model:"008D", deviceJoinName: "Aeotec Window Treatment" //Aeotec Nano Shutter + fingerprint mfr:"0371", prod:"0103", model:"008D", deviceJoinName: "Aeotec Window Treatment" //Aeotec Nano Shutter } tiles(scale: 2) { @@ -58,19 +58,19 @@ metadata { defaultValue: false, displayDuringSetup: false ) - - input(title: "Aeotec Nano Shutter settings", - description: "Sets the Open/Close time.", - displayDuringSetup: false, - type: "paragraph", - element: "paragraph") - - input("calibrationTime", "number", - title: "Set the open/close time for motor, range = 5 - 255", - defaultValue: false, - displayDuringSetup: false, - default: 10 - ) + + input(title: "Aeotec Nano Shutter settings", + description: "Sets the Open/Close time.", + displayDuringSetup: false, + type: "paragraph", + element: "paragraph") + + input("calibrationTime", "number", + title: "Set the open/close time for motor, range = 5 - 255", + defaultValue: false, + displayDuringSetup: false, + default: 10 + ) } } } @@ -168,7 +168,7 @@ def updated() { response([ secure(zwave.configurationV1.configurationSet(parameterNumber: 35, size: 1, scaledConfigurationValue: time)), ]) - } else {} + } } From 18fe124b0be014f7bdba4bac502bec372e0c40b1 Mon Sep 17 00:00:00 2001 From: Aeotec-ccheng <63321041+Aeotec-ccheng@users.noreply.github.com> Date: Wed, 16 Sep 2020 22:20:22 -0700 Subject: [PATCH 3/5] Fixed Requested issues - Fixed indentation to use tabs. (line 165) - Fixed range instead of the use of text. (line 69) --- .../zwave-basic-window-shade.groovy | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/devicetypes/smartthings/zwave-basic-window-shade.src/zwave-basic-window-shade.groovy b/devicetypes/smartthings/zwave-basic-window-shade.src/zwave-basic-window-shade.groovy index 102353d6470..649fad9a685 100644 --- a/devicetypes/smartthings/zwave-basic-window-shade.src/zwave-basic-window-shade.groovy +++ b/devicetypes/smartthings/zwave-basic-window-shade.src/zwave-basic-window-shade.groovy @@ -66,9 +66,10 @@ metadata { element: "paragraph") input("calibrationTime", "number", - title: "Set the open/close time for motor, range = 5 - 255", + title: "Set the open/close time for motor", defaultValue: false, displayDuringSetup: false, + range: "5..255", default: 10 ) } @@ -162,21 +163,21 @@ def installed() { def updated() { sendHubCommand(pause()) state.reverseDirection = reverseDirection ? reverseDirection : false - int time = calibrationTime - - if (calibrationTime >= 5 && calibrationTime <= 255) { - response([ - secure(zwave.configurationV1.configurationSet(parameterNumber: 35, size: 1, scaledConfigurationValue: time)), - ]) - } + int time = calibrationTime + + if (calibrationTime >= 5 && calibrationTime <= 255) { + response([ + secure(zwave.configurationV1.configurationSet(parameterNumber: 35, size: 1, scaledConfigurationValue: time)), + ]) + } } def configure() { log.debug "Configure..." response([ - secure(zwave.configurationV1.configurationSet(parameterNumber: 80, size: 1, scaledConfigurationValue: 1)), - secure(zwave.configurationV1.configurationSet(parameterNumber: 85, size: 1, scaledConfigurationValue: 1)) + secure(zwave.configurationV1.configurationSet(parameterNumber: 80, size: 1, scaledConfigurationValue: 1)), + secure(zwave.configurationV1.configurationSet(parameterNumber: 85, size: 1, scaledConfigurationValue: 1)) ]) } From 089aef13d8e69853de2f8dbe8cad6ade2a638bdc Mon Sep 17 00:00:00 2001 From: Aeotec-ccheng <63321041+Aeotec-ccheng@users.noreply.github.com> Date: Thu, 17 Sep 2020 15:31:53 -0700 Subject: [PATCH 4/5] Update Part 3 - Nano Shutter - used calibrationTime rather than int Time. (Line 164) - Condensed preference input for "calibrationTime" - Added note on top of calibrationTime to indicate it is specific to Nano Shutter and the function its used in. --- .../zwave-basic-window-shade.groovy | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/devicetypes/smartthings/zwave-basic-window-shade.src/zwave-basic-window-shade.groovy b/devicetypes/smartthings/zwave-basic-window-shade.src/zwave-basic-window-shade.groovy index 649fad9a685..0dde17361bd 100644 --- a/devicetypes/smartthings/zwave-basic-window-shade.src/zwave-basic-window-shade.groovy +++ b/devicetypes/smartthings/zwave-basic-window-shade.src/zwave-basic-window-shade.groovy @@ -59,14 +59,10 @@ metadata { displayDuringSetup: false ) - input(title: "Aeotec Nano Shutter settings", - description: "Sets the Open/Close time.", - displayDuringSetup: false, - type: "paragraph", - element: "paragraph") - + //This setting for calibrationTime is specific to Aeotec Nano Shutter and operates under def updated() - Line 159 input("calibrationTime", "number", - title: "Set the open/close time for motor", + title: "Open/Close timing", + description: "Set the motor's open/close time", defaultValue: false, displayDuringSetup: false, range: "5..255", @@ -163,11 +159,10 @@ def installed() { def updated() { sendHubCommand(pause()) state.reverseDirection = reverseDirection ? reverseDirection : false - int time = calibrationTime if (calibrationTime >= 5 && calibrationTime <= 255) { response([ - secure(zwave.configurationV1.configurationSet(parameterNumber: 35, size: 1, scaledConfigurationValue: time)), + secure(zwave.configurationV1.configurationSet(parameterNumber: 35, size: 1, scaledConfigurationValue: calibrationTime)), ]) } From 3b2f208ae0e81a0a8ebaf22962f733f4a7a7b79d Mon Sep 17 00:00:00 2001 From: Aeotec-ccheng <63321041+Aeotec-ccheng@users.noreply.github.com> Date: Thu, 17 Sep 2020 15:35:13 -0700 Subject: [PATCH 5/5] Update Nano Shutter Part 4 - Added case "open": on line 117 case "close": on line 121 --- .../zwave-basic-window-shade.groovy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/devicetypes/smartthings/zwave-basic-window-shade.src/zwave-basic-window-shade.groovy b/devicetypes/smartthings/zwave-basic-window-shade.src/zwave-basic-window-shade.groovy index 0dde17361bd..7276b9a52f8 100644 --- a/devicetypes/smartthings/zwave-basic-window-shade.src/zwave-basic-window-shade.groovy +++ b/devicetypes/smartthings/zwave-basic-window-shade.src/zwave-basic-window-shade.groovy @@ -114,9 +114,11 @@ def zwaveEvent(physicalgraph.zwave.Command cmd) { def setButton(button) { log.debug "button: $button" switch(button) { + case "open": case "statelessCurtainPowerButton_open_button": open() break + case "close": case "statelessCurtainPowerButton_close_button": close() break