From a9c078c0cb011d69989e696349d4ce359a7eeb82 Mon Sep 17 00:00:00 2001 From: "Donald C. Kirker" Date: Fri, 19 Feb 2016 05:41:34 -0600 Subject: [PATCH 1/2] DEVC-246: As noted in the Z-Wave Door/Window Sensor source code, "Enerwave motion doesn't always get the associationSet that the hub sends on join". It appears that sometimes when the Enerwave motion sensor joins it does not report events, which would be indicative of this. What can be done to resolve this? Is this a manufacturer firmware bug, or a bug with our stack? Enerwave claims that their DTH works "perfectly". --- .../zwave-motion-sensor.src/zwave-motion-sensor.groovy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/devicetypes/smartthings/zwave-motion-sensor.src/zwave-motion-sensor.groovy b/devicetypes/smartthings/zwave-motion-sensor.src/zwave-motion-sensor.groovy index b46f9c6..4015be3 100644 --- a/devicetypes/smartthings/zwave-motion-sensor.src/zwave-motion-sensor.groovy +++ b/devicetypes/smartthings/zwave-motion-sensor.src/zwave-motion-sensor.groovy @@ -119,6 +119,10 @@ def zwaveEvent(physicalgraph.zwave.commands.notificationv3.NotificationReport cm def zwaveEvent(physicalgraph.zwave.commands.wakeupv1.WakeUpNotification cmd) { def result = [createEvent(descriptionText: "${device.displayName} woke up", isStateChange: false)] + + if (msr == "011A-0601-0901") { // Enerwave motion doesn't always get the associationSet that the hub sends on join + result << response(zwave.associationV1.associationSet(groupingIdentifier:1, nodeId:zwaveHubNodeId)) + } if (!state.lastbat || (new Date().time) - state.lastbat > 53*60*60*1000) { result << response(zwave.batteryV1.batteryGet()) result << response("delay 1200") @@ -179,4 +183,4 @@ def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.ManufacturerS result << createEvent(descriptionText: "$device.displayName MSR: $msr", isStateChange: false) result -} +} \ No newline at end of file From 89335104365fc8775c5e26daa61ede8746c25327 Mon Sep 17 00:00:00 2001 From: Duncan McKee Date: Wed, 24 Feb 2016 18:07:48 -0500 Subject: [PATCH 2/2] Send associationSet to Enerwave Motion on wake only when it isn't already working --- .../zwave-motion-sensor.src/zwave-motion-sensor.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devicetypes/smartthings/zwave-motion-sensor.src/zwave-motion-sensor.groovy b/devicetypes/smartthings/zwave-motion-sensor.src/zwave-motion-sensor.groovy index 4015be3..8618631 100644 --- a/devicetypes/smartthings/zwave-motion-sensor.src/zwave-motion-sensor.groovy +++ b/devicetypes/smartthings/zwave-motion-sensor.src/zwave-motion-sensor.groovy @@ -120,7 +120,7 @@ def zwaveEvent(physicalgraph.zwave.commands.wakeupv1.WakeUpNotification cmd) { def result = [createEvent(descriptionText: "${device.displayName} woke up", isStateChange: false)] - if (msr == "011A-0601-0901") { // Enerwave motion doesn't always get the associationSet that the hub sends on join + if (state.MSR == "011A-0601-0901" && device.currentState('motion') == null) { // Enerwave motion doesn't always get the associationSet that the hub sends on join result << response(zwave.associationV1.associationSet(groupingIdentifier:1, nodeId:zwaveHubNodeId)) } if (!state.lastbat || (new Date().time) - state.lastbat > 53*60*60*1000) {