From f773a3ac574bbffb11673afb1c3e3a79d47b644f Mon Sep 17 00:00:00 2001 From: "k.klimczuk2" Date: Mon, 16 Sep 2019 11:25:15 +0200 Subject: [PATCH 1/2] ICP-10824 - Added fake 'no motion' event to pairing process for Aurora Smart PIR sensor. Removed 'Configuration' capability, because polling this device in pairing process didn't help. --- .../motion-detector.src/motion-detector.groovy | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/devicetypes/smartthings/motion-detector.src/motion-detector.groovy b/devicetypes/smartthings/motion-detector.src/motion-detector.groovy index c0d65f0a272..2c484df4c87 100644 --- a/devicetypes/smartthings/motion-detector.src/motion-detector.groovy +++ b/devicetypes/smartthings/motion-detector.src/motion-detector.groovy @@ -14,7 +14,6 @@ metadata { definition (name: "Motion Detector", namespace: "smartthings", author: "SmartThings") { capability "Actuator" - capability "Configuration" capability "Health Check" capability "Motion Sensor" capability "Sensor" @@ -44,6 +43,11 @@ metadata { def installed() { initialize() + if(isAuroraMotionSensor51AU()) { + // Aurora Smart PIR Sensor doesn't report when there is no motion during pairing process + // reports are sent only if there is motion detected, so fake event is needed here + sendEvent(name: "motion", value: "inactive", descriptionText: "${device.displayName} - initially no motion" ) + } } def updated() { @@ -85,11 +89,9 @@ def parse(String description) { } def isTracked() { - return device.getDataValue("model") == "MotionSensor51AU" + return isAuroraMotionSensor51AU() } -def configure() { - log.debug "configure" - return zigbee.configureReporting(zigbee.IAS_ZONE_CLUSTER, zigbee.ATTRIBUTE_IAS_ZONE_STATUS, 0x19, 0, 180, null) + - zigbee.readAttribute(zigbee.IAS_ZONE_CLUSTER, zigbee.ATTRIBUTE_IAS_ZONE_STATUS) +def isAuroraMotionSensor51AU() { + return device.getDataValue("model") == "MotionSensor51AU" } \ No newline at end of file From d56a11bf89fbfe4d128f8fd76d0c7fd0a53c276a Mon Sep 17 00:00:00 2001 From: "k.klimczuk2" Date: Tue, 17 Sep 2019 10:26:52 +0200 Subject: [PATCH 2/2] ICP-10824 - code refactoring --- .../smartthings/motion-detector.src/motion-detector.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devicetypes/smartthings/motion-detector.src/motion-detector.groovy b/devicetypes/smartthings/motion-detector.src/motion-detector.groovy index 2c484df4c87..fa6fb41865d 100644 --- a/devicetypes/smartthings/motion-detector.src/motion-detector.groovy +++ b/devicetypes/smartthings/motion-detector.src/motion-detector.groovy @@ -46,7 +46,7 @@ def installed() { if(isAuroraMotionSensor51AU()) { // Aurora Smart PIR Sensor doesn't report when there is no motion during pairing process // reports are sent only if there is motion detected, so fake event is needed here - sendEvent(name: "motion", value: "inactive", descriptionText: "${device.displayName} - initially no motion" ) + sendEvent(name: "motion", value: "inactive", displayed: false) } }