mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-04-03 22:04:41 +01:00
[CHF-577] Added Health Check Implementation for Spruce Controller.
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
.st-ignore
|
||||||
|
README.md
|
||||||
37
devicetypes/plaidsystems/spruce-controller.src/README.md
Normal file
37
devicetypes/plaidsystems/spruce-controller.src/README.md
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# Spruce Controller
|
||||||
|
|
||||||
|
Cloud Execution
|
||||||
|
|
||||||
|
Works with:
|
||||||
|
|
||||||
|
* [Spruce Irrigation Controller](https://www.smartthings.com/works-with-smartthings/spruce/spruce-irrigation-controller)
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
* [Capabilities](#capabilities)
|
||||||
|
* [Health](#device-health)
|
||||||
|
* [Troubleshooting](#troubleshooting)
|
||||||
|
|
||||||
|
## Capabilities
|
||||||
|
|
||||||
|
* **Switch** - can detect state (possible values: on/off)
|
||||||
|
* **Configuration** - _configure()_ command called when device is installed or device preferences updated
|
||||||
|
* **Refresh** - _refresh()_ command for status updates
|
||||||
|
* **Actuator** - represents that a Device has commands
|
||||||
|
* **Valve** - allows for the control of a valve device
|
||||||
|
* **Health Check** - indicates ability to get device health notifications
|
||||||
|
|
||||||
|
## Device Health
|
||||||
|
|
||||||
|
Spruce Controller with reporting interval of 10 mins.
|
||||||
|
SmartThings platform will ping the device after `checkInterval` seconds of inactivity in last attempt to reach the device before marking it `OFFLINE`
|
||||||
|
|
||||||
|
* __22min__ checkInterval
|
||||||
|
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
If the device doesn't pair when trying from the SmartThings mobile app, it is possible that the device is out of range.
|
||||||
|
Pairing needs to be tried again by placing the device closer to the hub.
|
||||||
|
Other troubleshooting tips are listed as follows:
|
||||||
|
* [Spruce Irrigation Controller Troubleshooting:](https://support.smartthings.com/hc/en-us/articles/208053773-Spruce-Irrigation-Controller-Sensor)
|
||||||
@@ -27,6 +27,7 @@ metadata {
|
|||||||
capability "Refresh"
|
capability "Refresh"
|
||||||
capability "Actuator"
|
capability "Actuator"
|
||||||
capability "Valve"
|
capability "Valve"
|
||||||
|
capability "Health Check"
|
||||||
|
|
||||||
attribute "switch", "string"
|
attribute "switch", "string"
|
||||||
attribute "switch1", "string"
|
attribute "switch1", "string"
|
||||||
@@ -96,7 +97,7 @@ metadata {
|
|||||||
command "notify"
|
command "notify"
|
||||||
command "updated"
|
command "updated"
|
||||||
|
|
||||||
fingerprint endpointId: "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18", profileId: "0104", deviceId: "0002", deviceVersion: "00", inClusters: "0000,0003,0004,0005,0006,000F", outClusters: "0003, 0019", manufacturer: "PLAID SYSTEMS", model: "PS-SPRZ16-01"
|
fingerprint endpointId: "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18", profileId: "0104", deviceId: "0002", deviceVersion: "00", inClusters: "0000,0003,0004,0005,0006,000F", outClusters: "0003, 0019", manufacturer: "PLAID SYSTEMS", model: "PS-SPRZ16-01", deviceJoinName: "Spruce Irrigation Controller"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,14 +367,14 @@ def writeTime(wEP, runTime){
|
|||||||
|
|
||||||
//set reporting and binding
|
//set reporting and binding
|
||||||
def configure() {
|
def configure() {
|
||||||
|
// Device-Watch allows 2 check-in misses from device (plus 2 mins lag time)
|
||||||
|
sendEvent(name: "checkInterval", value: 2 * 10 * 60 + 2 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID])
|
||||||
String zigbeeId = swapEndianHex(device.hub.zigbeeId)
|
String zigbeeId = swapEndianHex(device.hub.zigbeeId)
|
||||||
log.debug "Confuguring Reporting and Bindings ${device.deviceNetworkId} ${device.zigbeeId}"
|
log.debug "Confuguring Reporting and Bindings ${device.deviceNetworkId} ${device.zigbeeId}"
|
||||||
sendEvent(name: 'configuration',value: 100, descriptionText: "Configuration initialized")
|
sendEvent(name: 'configuration',value: 100, descriptionText: "Configuration initialized")
|
||||||
|
|
||||||
def configCmds = [
|
def configCmds = [
|
||||||
//program on/off
|
//program on/off
|
||||||
"zdo bind 0x${device.deviceNetworkId} 1 1 6 {${device.zigbeeId}} {}", "delay 1000",
|
|
||||||
"zdo bind 0x${device.deviceNetworkId} 1 1 0x09 {${device.zigbeeId}} {}", "delay 1000",
|
"zdo bind 0x${device.deviceNetworkId} 1 1 0x09 {${device.zigbeeId}} {}", "delay 1000",
|
||||||
"zdo bind 0x${device.deviceNetworkId} 1 1 0x0F {${device.zigbeeId}} {}", "delay 1000",
|
"zdo bind 0x${device.deviceNetworkId} 1 1 0x0F {${device.zigbeeId}} {}", "delay 1000",
|
||||||
//zones 1-8
|
//zones 1-8
|
||||||
@@ -397,9 +398,6 @@ def configure() {
|
|||||||
//rain sensor
|
//rain sensor
|
||||||
"zdo bind 0x${device.deviceNetworkId} 18 1 0x0F {${device.zigbeeId}} {}",
|
"zdo bind 0x${device.deviceNetworkId} 18 1 0x0F {${device.zigbeeId}} {}",
|
||||||
|
|
||||||
"zcl global send-me-a-report 6 0 0x10 1 0 {01}", "delay 500",
|
|
||||||
"send 0x${device.deviceNetworkId} 1 1", "delay 500",
|
|
||||||
|
|
||||||
"zcl global send-me-a-report 0x0F 0x55 0x10 1 0 {01}", "delay 500",
|
"zcl global send-me-a-report 0x0F 0x55 0x10 1 0 {01}", "delay 500",
|
||||||
"send 0x${device.deviceNetworkId} 1 1", "delay 500",
|
"send 0x${device.deviceNetworkId} 1 1", "delay 500",
|
||||||
|
|
||||||
@@ -458,7 +456,7 @@ def configure() {
|
|||||||
"zcl global send-me-a-report 0x09 0x00 0x21 1 0 {00}", "delay 500",
|
"zcl global send-me-a-report 0x09 0x00 0x21 1 0 {00}", "delay 500",
|
||||||
"send 0x${device.deviceNetworkId} 1 1", "delay 500"
|
"send 0x${device.deviceNetworkId} 1 1", "delay 500"
|
||||||
]
|
]
|
||||||
return configCmds + rain() + manual()
|
return configCmds + zigbee.onOffConfig() + rain() + manual()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -485,6 +483,13 @@ private byte[] reverseArray(byte[] array) {
|
|||||||
return array
|
return array
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PING is used by Device-Watch in attempt to reach the Device
|
||||||
|
* */
|
||||||
|
def ping() {
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
|
||||||
def refresh() {
|
def refresh() {
|
||||||
|
|
||||||
log.debug "refresh"
|
log.debug "refresh"
|
||||||
|
|||||||
Reference in New Issue
Block a user