From 4da49283bff51c9a45a6a4d52035d29e7e81a40f Mon Sep 17 00:00:00 2001 From: Nathan Cauffman Date: Thu, 6 Jul 2017 13:22:12 -0700 Subject: [PATCH 1/2] MSA-2084: Updated with new model number and health check --- .../spruce-sensor.src/spruce-sensor.groovy | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/devicetypes/plaidsystems/spruce-sensor.src/spruce-sensor.groovy b/devicetypes/plaidsystems/spruce-sensor.src/spruce-sensor.groovy index 77a5698..fc1fe39 100644 --- a/devicetypes/plaidsystems/spruce-sensor.src/spruce-sensor.groovy +++ b/devicetypes/plaidsystems/spruce-sensor.src/spruce-sensor.groovy @@ -1,5 +1,5 @@ /** - * Spruce Sensor -Pre-release V2 10/8/2015 + * Spruce Sensor -updated with SLP model number 5/2017 * * Copyright 2014 Plaid Systems * @@ -14,25 +14,34 @@ * -------10/20/2015 Updates-------- -Fix/add battery reporting interval to update - -remove polling and/or refresh(?) + -remove polling and/or refresh + + -------5/2017 Updates-------- + -Add fingerprints for SLP + -add device health, check every 60mins + 2mins */ + metadata { - definition (name: "Spruce Sensor", namespace: "plaidsystems", author: "NCauffman") { + definition (name: "Spruce Sensor", namespace: "plaidsystems", author: "Plaid Systems") { capability "Configuration" capability "Battery" capability "Relative Humidity Measurement" capability "Temperature Measurement" capability "Sensor" + capability "Health Check" //capability "Polling" + attribute "checkInterval", "string" attribute "maxHum", "string" attribute "minHum", "string" + command "resetHumidity" command "refresh" - fingerprint profileId: "0104", inClusters: "0000,0001,0003,0402,0405", outClusters: "0003, 0019", manufacturer: "PLAID SYSTEMS", model: "PS-SPRZMS-01" + fingerprint profileId: "0104", inClusters: "0000,0001,0003,0402,0405", outClusters: "0003, 0019", manufacturer: "PLAID SYSTEMS", model: "PS-SPRZMS-01", deviceJoinName: "Spruce Sensor" + fingerprint profileId: "0104", inClusters: "0000,0001,0003,0402,0405", outClusters: "0003, 0019", manufacturer: "PLAID SYSTEMS", model: "PS-SPRZMS-SLP1", deviceJoinName: "Spruce Sensor" } preferences { @@ -293,6 +302,11 @@ def setConfig(){ sendEvent(name: 'configuration',value: configInterval, descriptionText: "Configuration initialized") } +def installed(){ + //check every 1 hour + 2mins + sendEvent(name: "checkInterval", value: 1 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) +} + //when device preferences are changed def updated(){ log.debug "device updated" @@ -303,6 +317,8 @@ def updated(){ sendEvent(name: 'configuration',value: 0, descriptionText: "Settings changed and will update at next report. Measure interval set to ${interval} mins") } } + //check every 1 hour + 2mins + sendEvent(name: "checkInterval", value: 1 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) } //poll From f519a2d828ec3e9e5e0673d4af7d35f4d8a9d817 Mon Sep 17 00:00:00 2001 From: natec007 Date: Thu, 6 Jul 2017 14:27:33 -0700 Subject: [PATCH 2/2] Update spruce-sensor.groovy Removed checkInterval attribute sendEvent(name: "checkInterval" already in updated and installed --- .../plaidsystems/spruce-sensor.src/spruce-sensor.groovy | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/devicetypes/plaidsystems/spruce-sensor.src/spruce-sensor.groovy b/devicetypes/plaidsystems/spruce-sensor.src/spruce-sensor.groovy index fc1fe39..f2e1154 100644 --- a/devicetypes/plaidsystems/spruce-sensor.src/spruce-sensor.groovy +++ b/devicetypes/plaidsystems/spruce-sensor.src/spruce-sensor.groovy @@ -32,7 +32,6 @@ metadata { capability "Health Check" //capability "Polling" - attribute "checkInterval", "string" attribute "maxHum", "string" attribute "minHum", "string" @@ -411,4 +410,4 @@ private byte[] reverseArray(byte[] array) { i++; } return array -} \ No newline at end of file +}