mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-18 13:20:53 +00:00
Compare commits
1 Commits
MSA-1925-2
...
MSA-1935-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6e6d0b528 |
900
devicetypes/happy-new/kad.src/kad.groovy
Normal file
900
devicetypes/happy-new/kad.src/kad.groovy
Normal file
@@ -0,0 +1,900 @@
|
|||||||
|
/**
|
||||||
|
* kad
|
||||||
|
*
|
||||||
|
* Copyright 2017 Kadeem Coleman
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
||||||
|
* in compliance with the License. You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
|
||||||
|
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
|
||||||
|
* for the specific language governing permissions and limitations under the License.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
metadata {
|
||||||
|
definition (name: "kad", namespace: "happy new ", author: "Kadeem Coleman") {
|
||||||
|
capability "Acceleration Sensor"
|
||||||
|
capability "Actuator"
|
||||||
|
capability "Alarm"
|
||||||
|
capability "Alarm System"
|
||||||
|
capability "Alarm System Arm Only"
|
||||||
|
capability "Astronomical Data"
|
||||||
|
capability "Audio Notification"
|
||||||
|
capability "Battery"
|
||||||
|
capability "Beacon"
|
||||||
|
capability "Bridge"
|
||||||
|
capability "Buffered Video Capture"
|
||||||
|
capability "Bulb"
|
||||||
|
capability "Button"
|
||||||
|
capability "Carbon Dioxide Measurement"
|
||||||
|
capability "Carbon Monoxide Detector"
|
||||||
|
capability "Color Control"
|
||||||
|
capability "Color Temperature"
|
||||||
|
capability "Configuration"
|
||||||
|
capability "Consumable"
|
||||||
|
capability "Contact Sensor"
|
||||||
|
capability "Door Control"
|
||||||
|
capability "Energy Meter"
|
||||||
|
capability "Estimated Time Of Arrival"
|
||||||
|
capability "Garage Door Control"
|
||||||
|
capability "Health Check"
|
||||||
|
capability "Image Capture"
|
||||||
|
capability "Indicator"
|
||||||
|
capability "Infrared Level"
|
||||||
|
capability "Light"
|
||||||
|
capability "Light"
|
||||||
|
capability "Lock"
|
||||||
|
capability "Lock Codes"
|
||||||
|
capability "Lock Only"
|
||||||
|
capability "Media Controller"
|
||||||
|
capability "Momentary"
|
||||||
|
capability "Motion Sensor"
|
||||||
|
capability "Music Player"
|
||||||
|
capability "Ocf"
|
||||||
|
capability "Outlet"
|
||||||
|
capability "pH Measurement"
|
||||||
|
capability "Polling"
|
||||||
|
capability "Power"
|
||||||
|
capability "Power Meter"
|
||||||
|
capability "Power Source"
|
||||||
|
capability "Presence Sensor"
|
||||||
|
capability "Refresh"
|
||||||
|
capability "Relay Switch"
|
||||||
|
capability "Samsung TV"
|
||||||
|
capability "Sensor"
|
||||||
|
capability "Shock Sensor"
|
||||||
|
capability "Signal Strength"
|
||||||
|
capability "Sleep Sensor"
|
||||||
|
capability "Smoke Detector"
|
||||||
|
capability "Sound Sensor"
|
||||||
|
capability "Speech Recognition"
|
||||||
|
capability "Speech Synthesis"
|
||||||
|
capability "Switch"
|
||||||
|
capability "Switch Level"
|
||||||
|
capability "Tamper Alert"
|
||||||
|
capability "Temperature Measurement"
|
||||||
|
capability "Test Capability"
|
||||||
|
capability "Thermostat"
|
||||||
|
capability "Thermostat Cooling Setpoint"
|
||||||
|
capability "Thermostat Fan Mode"
|
||||||
|
capability "Thermostat Heating Setpoint"
|
||||||
|
capability "Thermostat Mode"
|
||||||
|
capability "Thermostat Operating State"
|
||||||
|
capability "Thermostat Setpoint"
|
||||||
|
capability "Three Axis"
|
||||||
|
capability "Timed Session"
|
||||||
|
capability "Tone"
|
||||||
|
capability "Touch Sensor"
|
||||||
|
capability "Ultraviolet Index"
|
||||||
|
capability "Valve"
|
||||||
|
capability "Video Camera"
|
||||||
|
capability "Video Capture"
|
||||||
|
capability "Voltage Measurement"
|
||||||
|
capability "Water Sensor"
|
||||||
|
capability "Window Shade"
|
||||||
|
capability "Zw Multichannel"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
simulator {
|
||||||
|
// TODO: define status and reply messages here
|
||||||
|
}
|
||||||
|
|
||||||
|
tiles {
|
||||||
|
// TODO: define your main and details tiles here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// parse events into attributes
|
||||||
|
def parse(String description) {
|
||||||
|
log.debug "Parsing '${description}'"
|
||||||
|
// TODO: handle 'acceleration' attribute
|
||||||
|
// TODO: handle 'alarm' attribute
|
||||||
|
// TODO: handle 'alarmSystemStatus' attribute
|
||||||
|
// TODO: handle 'alarmSystemStatus' attribute
|
||||||
|
// TODO: handle 'sunrise' attribute
|
||||||
|
// TODO: handle 'sunset' attribute
|
||||||
|
// TODO: handle 'sunriseTime' attribute
|
||||||
|
// TODO: handle 'sunsetTime' attribute
|
||||||
|
// TODO: handle 'battery' attribute
|
||||||
|
// TODO: handle 'presence' attribute
|
||||||
|
// TODO: handle 'clip' attribute
|
||||||
|
// TODO: handle 'switch' attribute
|
||||||
|
// TODO: handle 'button' attribute
|
||||||
|
// TODO: handle 'numberOfButtons' attribute
|
||||||
|
// TODO: handle 'carbonDioxide' attribute
|
||||||
|
// TODO: handle 'carbonMonoxide' attribute
|
||||||
|
// TODO: handle 'hue' attribute
|
||||||
|
// TODO: handle 'saturation' attribute
|
||||||
|
// TODO: handle 'color' attribute
|
||||||
|
// TODO: handle 'colorTemperature' attribute
|
||||||
|
// TODO: handle 'consumableStatus' attribute
|
||||||
|
// TODO: handle 'contact' attribute
|
||||||
|
// TODO: handle 'door' attribute
|
||||||
|
// TODO: handle 'energy' attribute
|
||||||
|
// TODO: handle 'eta' attribute
|
||||||
|
// TODO: handle 'door' attribute
|
||||||
|
// TODO: handle 'checkInterval' attribute
|
||||||
|
// TODO: handle 'image' attribute
|
||||||
|
// TODO: handle 'indicatorStatus' attribute
|
||||||
|
// TODO: handle 'infraredLevel' attribute
|
||||||
|
// TODO: handle 'switch' attribute
|
||||||
|
// TODO: handle 'switch' attribute
|
||||||
|
// TODO: handle 'lock' attribute
|
||||||
|
// TODO: handle 'lock' attribute
|
||||||
|
// TODO: handle 'codeReport' attribute
|
||||||
|
// TODO: handle 'codeChanged' attribute
|
||||||
|
// TODO: handle 'lock' attribute
|
||||||
|
// TODO: handle 'activities' attribute
|
||||||
|
// TODO: handle 'currentActivity' attribute
|
||||||
|
// TODO: handle 'motion' attribute
|
||||||
|
// TODO: handle 'status' attribute
|
||||||
|
// TODO: handle 'level' attribute
|
||||||
|
// TODO: handle 'trackDescription' attribute
|
||||||
|
// TODO: handle 'trackData' attribute
|
||||||
|
// TODO: handle 'mute' attribute
|
||||||
|
// TODO: handle 'switch' attribute
|
||||||
|
// TODO: handle 'pH' attribute
|
||||||
|
// TODO: handle 'powerSource' attribute
|
||||||
|
// TODO: handle 'power' attribute
|
||||||
|
// TODO: handle 'powerSource' attribute
|
||||||
|
// TODO: handle 'presence' attribute
|
||||||
|
// TODO: handle 'switch' attribute
|
||||||
|
// TODO: handle 'volume' attribute
|
||||||
|
// TODO: handle 'mute' attribute
|
||||||
|
// TODO: handle 'pictureMode' attribute
|
||||||
|
// TODO: handle 'soundMode' attribute
|
||||||
|
// TODO: handle 'switch' attribute
|
||||||
|
// TODO: handle 'messageButton' attribute
|
||||||
|
// TODO: handle 'shock' attribute
|
||||||
|
// TODO: handle 'lqi' attribute
|
||||||
|
// TODO: handle 'rssi' attribute
|
||||||
|
// TODO: handle 'sleeping' attribute
|
||||||
|
// TODO: handle 'smoke' attribute
|
||||||
|
// TODO: handle 'carbonMonoxide' attribute
|
||||||
|
// TODO: handle 'sound' attribute
|
||||||
|
// TODO: handle 'phraseSpoken' attribute
|
||||||
|
// TODO: handle 'switch' attribute
|
||||||
|
// TODO: handle 'level' attribute
|
||||||
|
// TODO: handle 'tamper' attribute
|
||||||
|
// TODO: handle 'temperature' attribute
|
||||||
|
// TODO: handle 'temperature' attribute
|
||||||
|
// TODO: handle 'heatingSetpoint' attribute
|
||||||
|
// TODO: handle 'coolingSetpoint' attribute
|
||||||
|
// TODO: handle 'thermostatSetpoint' attribute
|
||||||
|
// TODO: handle 'thermostatMode' attribute
|
||||||
|
// TODO: handle 'thermostatFanMode' attribute
|
||||||
|
// TODO: handle 'thermostatOperatingState' attribute
|
||||||
|
// TODO: handle 'schedule' attribute
|
||||||
|
// TODO: handle 'coolingSetpointMin' attribute
|
||||||
|
// TODO: handle 'coolingSetpointMax' attribute
|
||||||
|
// TODO: handle 'heatingSetpointMin' attribute
|
||||||
|
// TODO: handle 'heatingSetpointMax' attribute
|
||||||
|
// TODO: handle 'thermostatSetpointMin' attribute
|
||||||
|
// TODO: handle 'thermostatSetpointMax' attribute
|
||||||
|
// TODO: handle 'coolingSetpointMin' attribute
|
||||||
|
// TODO: handle 'coolingSetpointMax' attribute
|
||||||
|
// TODO: handle 'heatingSetpointMin' attribute
|
||||||
|
// TODO: handle 'heatingSetpointMax' attribute
|
||||||
|
// TODO: handle 'thermostatSetpointMin' attribute
|
||||||
|
// TODO: handle 'thermostatSetpointMax' attribute
|
||||||
|
// TODO: handle 'coolingSetpoint' attribute
|
||||||
|
// TODO: handle 'coolingSetpointMin' attribute
|
||||||
|
// TODO: handle 'coolingSetpointMax' attribute
|
||||||
|
// TODO: handle 'thermostatFanMode' attribute
|
||||||
|
// TODO: handle 'heatingSetpoint' attribute
|
||||||
|
// TODO: handle 'heatingSetpointMin' attribute
|
||||||
|
// TODO: handle 'heatingSetpointMax' attribute
|
||||||
|
// TODO: handle 'thermostatMode' attribute
|
||||||
|
// TODO: handle 'thermostatOperatingState' attribute
|
||||||
|
// TODO: handle 'thermostatSetpoint' attribute
|
||||||
|
// TODO: handle 'thermostatSetpointMin' attribute
|
||||||
|
// TODO: handle 'thermostatSetpointMax' attribute
|
||||||
|
// TODO: handle 'threeAxis' attribute
|
||||||
|
// TODO: handle 'sessionStatus' attribute
|
||||||
|
// TODO: handle 'timeRemaining' attribute
|
||||||
|
// TODO: handle 'touch' attribute
|
||||||
|
// TODO: handle 'ultravioletIndex' attribute
|
||||||
|
// TODO: handle 'contact' attribute
|
||||||
|
// TODO: handle 'valve' attribute
|
||||||
|
// TODO: handle 'camera' attribute
|
||||||
|
// TODO: handle 'statusMessage' attribute
|
||||||
|
// TODO: handle 'mute' attribute
|
||||||
|
// TODO: handle 'settings' attribute
|
||||||
|
// TODO: handle 'clip' attribute
|
||||||
|
// TODO: handle 'stream' attribute
|
||||||
|
// TODO: handle 'voltage' attribute
|
||||||
|
// TODO: handle 'water' attribute
|
||||||
|
// TODO: handle 'windowShade' attribute
|
||||||
|
// TODO: handle 'epEvent' attribute
|
||||||
|
// TODO: handle 'epInfo' attribute
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// handle commands
|
||||||
|
def off() {
|
||||||
|
log.debug "Executing 'off'"
|
||||||
|
// TODO: handle 'off' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def strobe() {
|
||||||
|
log.debug "Executing 'strobe'"
|
||||||
|
// TODO: handle 'strobe' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def siren() {
|
||||||
|
log.debug "Executing 'siren'"
|
||||||
|
// TODO: handle 'siren' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def both() {
|
||||||
|
log.debug "Executing 'both'"
|
||||||
|
// TODO: handle 'both' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def sendEvent(alarmSystemStatus,off)() {
|
||||||
|
log.debug "Executing 'sendEvent(alarmSystemStatus,off)'"
|
||||||
|
// TODO: handle 'sendEvent(alarmSystemStatus,off)' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def sendEvent(alarmSystemStatus,stay)() {
|
||||||
|
log.debug "Executing 'sendEvent(alarmSystemStatus,stay)'"
|
||||||
|
// TODO: handle 'sendEvent(alarmSystemStatus,stay)' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def sendEvent(alarmSystemStatus,away)() {
|
||||||
|
log.debug "Executing 'sendEvent(alarmSystemStatus,away)'"
|
||||||
|
// TODO: handle 'sendEvent(alarmSystemStatus,away)' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def sendEvent(alarmSystemStatus,stay)() {
|
||||||
|
log.debug "Executing 'sendEvent(alarmSystemStatus,stay)'"
|
||||||
|
// TODO: handle 'sendEvent(alarmSystemStatus,stay)' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def sendEvent(alarmSystemStatus,away)() {
|
||||||
|
log.debug "Executing 'sendEvent(alarmSystemStatus,away)'"
|
||||||
|
// TODO: handle 'sendEvent(alarmSystemStatus,away)' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def sendEvent(sunrise)() {
|
||||||
|
log.debug "Executing 'sendEvent(sunrise)'"
|
||||||
|
// TODO: handle 'sendEvent(sunrise)' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def sendEvent(sunset)() {
|
||||||
|
log.debug "Executing 'sendEvent(sunset)'"
|
||||||
|
// TODO: handle 'sendEvent(sunset)' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def sendEvent(sunriseTime)() {
|
||||||
|
log.debug "Executing 'sendEvent(sunriseTime)'"
|
||||||
|
// TODO: handle 'sendEvent(sunriseTime)' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def sendEvent(sunsetTime)() {
|
||||||
|
log.debug "Executing 'sendEvent(sunsetTime)'"
|
||||||
|
// TODO: handle 'sendEvent(sunsetTime)' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def playText() {
|
||||||
|
log.debug "Executing 'playText'"
|
||||||
|
// TODO: handle 'playText' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def playTextAndResume() {
|
||||||
|
log.debug "Executing 'playTextAndResume'"
|
||||||
|
// TODO: handle 'playTextAndResume' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def playTextAndRestore() {
|
||||||
|
log.debug "Executing 'playTextAndRestore'"
|
||||||
|
// TODO: handle 'playTextAndRestore' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def playTrack() {
|
||||||
|
log.debug "Executing 'playTrack'"
|
||||||
|
// TODO: handle 'playTrack' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def playTrackAndResume() {
|
||||||
|
log.debug "Executing 'playTrackAndResume'"
|
||||||
|
// TODO: handle 'playTrackAndResume' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def playTrackAndRestore() {
|
||||||
|
log.debug "Executing 'playTrackAndRestore'"
|
||||||
|
// TODO: handle 'playTrackAndRestore' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def capture() {
|
||||||
|
log.debug "Executing 'capture'"
|
||||||
|
// TODO: handle 'capture' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def off() {
|
||||||
|
log.debug "Executing 'off'"
|
||||||
|
// TODO: handle 'off' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def on() {
|
||||||
|
log.debug "Executing 'on'"
|
||||||
|
// TODO: handle 'on' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def setHue() {
|
||||||
|
log.debug "Executing 'setHue'"
|
||||||
|
// TODO: handle 'setHue' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def setSaturation() {
|
||||||
|
log.debug "Executing 'setSaturation'"
|
||||||
|
// TODO: handle 'setSaturation' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def setColor() {
|
||||||
|
log.debug "Executing 'setColor'"
|
||||||
|
// TODO: handle 'setColor' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def setColorTemperature() {
|
||||||
|
log.debug "Executing 'setColorTemperature'"
|
||||||
|
// TODO: handle 'setColorTemperature' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def configure() {
|
||||||
|
log.debug "Executing 'configure'"
|
||||||
|
// TODO: handle 'configure' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def setConsumableStatus() {
|
||||||
|
log.debug "Executing 'setConsumableStatus'"
|
||||||
|
// TODO: handle 'setConsumableStatus' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def open() {
|
||||||
|
log.debug "Executing 'open'"
|
||||||
|
// TODO: handle 'open' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def close() {
|
||||||
|
log.debug "Executing 'close'"
|
||||||
|
// TODO: handle 'close' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def open() {
|
||||||
|
log.debug "Executing 'open'"
|
||||||
|
// TODO: handle 'open' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def close() {
|
||||||
|
log.debug "Executing 'close'"
|
||||||
|
// TODO: handle 'close' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def ping() {
|
||||||
|
log.debug "Executing 'ping'"
|
||||||
|
// TODO: handle 'ping' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def take() {
|
||||||
|
log.debug "Executing 'take'"
|
||||||
|
// TODO: handle 'take' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def indicatorWhenOn() {
|
||||||
|
log.debug "Executing 'indicatorWhenOn'"
|
||||||
|
// TODO: handle 'indicatorWhenOn' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def indicatorWhenOff() {
|
||||||
|
log.debug "Executing 'indicatorWhenOff'"
|
||||||
|
// TODO: handle 'indicatorWhenOff' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def indicatorNever() {
|
||||||
|
log.debug "Executing 'indicatorNever'"
|
||||||
|
// TODO: handle 'indicatorNever' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def setInfraredLevel() {
|
||||||
|
log.debug "Executing 'setInfraredLevel'"
|
||||||
|
// TODO: handle 'setInfraredLevel' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def off() {
|
||||||
|
log.debug "Executing 'off'"
|
||||||
|
// TODO: handle 'off' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def on() {
|
||||||
|
log.debug "Executing 'on'"
|
||||||
|
// TODO: handle 'on' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def off() {
|
||||||
|
log.debug "Executing 'off'"
|
||||||
|
// TODO: handle 'off' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def on() {
|
||||||
|
log.debug "Executing 'on'"
|
||||||
|
// TODO: handle 'on' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def lock() {
|
||||||
|
log.debug "Executing 'lock'"
|
||||||
|
// TODO: handle 'lock' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def unlock() {
|
||||||
|
log.debug "Executing 'unlock'"
|
||||||
|
// TODO: handle 'unlock' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def lock() {
|
||||||
|
log.debug "Executing 'lock'"
|
||||||
|
// TODO: handle 'lock' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def unlock() {
|
||||||
|
log.debug "Executing 'unlock'"
|
||||||
|
// TODO: handle 'unlock' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def updateCodes() {
|
||||||
|
log.debug "Executing 'updateCodes'"
|
||||||
|
// TODO: handle 'updateCodes' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def setCode() {
|
||||||
|
log.debug "Executing 'setCode'"
|
||||||
|
// TODO: handle 'setCode' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def deleteCode() {
|
||||||
|
log.debug "Executing 'deleteCode'"
|
||||||
|
// TODO: handle 'deleteCode' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def requestCode() {
|
||||||
|
log.debug "Executing 'requestCode'"
|
||||||
|
// TODO: handle 'requestCode' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def reloadAllCodes() {
|
||||||
|
log.debug "Executing 'reloadAllCodes'"
|
||||||
|
// TODO: handle 'reloadAllCodes' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def lock() {
|
||||||
|
log.debug "Executing 'lock'"
|
||||||
|
// TODO: handle 'lock' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def startActivity() {
|
||||||
|
log.debug "Executing 'startActivity'"
|
||||||
|
// TODO: handle 'startActivity' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def getAllActivities() {
|
||||||
|
log.debug "Executing 'getAllActivities'"
|
||||||
|
// TODO: handle 'getAllActivities' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def getCurrentActivity() {
|
||||||
|
log.debug "Executing 'getCurrentActivity'"
|
||||||
|
// TODO: handle 'getCurrentActivity' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def push() {
|
||||||
|
log.debug "Executing 'push'"
|
||||||
|
// TODO: handle 'push' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def play() {
|
||||||
|
log.debug "Executing 'play'"
|
||||||
|
// TODO: handle 'play' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def pause() {
|
||||||
|
log.debug "Executing 'pause'"
|
||||||
|
// TODO: handle 'pause' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def stop() {
|
||||||
|
log.debug "Executing 'stop'"
|
||||||
|
// TODO: handle 'stop' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def nextTrack() {
|
||||||
|
log.debug "Executing 'nextTrack'"
|
||||||
|
// TODO: handle 'nextTrack' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def playTrack() {
|
||||||
|
log.debug "Executing 'playTrack'"
|
||||||
|
// TODO: handle 'playTrack' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def setLevel() {
|
||||||
|
log.debug "Executing 'setLevel'"
|
||||||
|
// TODO: handle 'setLevel' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def mute() {
|
||||||
|
log.debug "Executing 'mute'"
|
||||||
|
// TODO: handle 'mute' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def previousTrack() {
|
||||||
|
log.debug "Executing 'previousTrack'"
|
||||||
|
// TODO: handle 'previousTrack' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def unmute() {
|
||||||
|
log.debug "Executing 'unmute'"
|
||||||
|
// TODO: handle 'unmute' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def setTrack() {
|
||||||
|
log.debug "Executing 'setTrack'"
|
||||||
|
// TODO: handle 'setTrack' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def resumeTrack() {
|
||||||
|
log.debug "Executing 'resumeTrack'"
|
||||||
|
// TODO: handle 'resumeTrack' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def restoreTrack() {
|
||||||
|
log.debug "Executing 'restoreTrack'"
|
||||||
|
// TODO: handle 'restoreTrack' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def postOcfCommand() {
|
||||||
|
log.debug "Executing 'postOcfCommand'"
|
||||||
|
// TODO: handle 'postOcfCommand' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def off() {
|
||||||
|
log.debug "Executing 'off'"
|
||||||
|
// TODO: handle 'off' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def on() {
|
||||||
|
log.debug "Executing 'on'"
|
||||||
|
// TODO: handle 'on' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def poll() {
|
||||||
|
log.debug "Executing 'poll'"
|
||||||
|
// TODO: handle 'poll' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def refresh() {
|
||||||
|
log.debug "Executing 'refresh'"
|
||||||
|
// TODO: handle 'refresh' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def on() {
|
||||||
|
log.debug "Executing 'on'"
|
||||||
|
// TODO: handle 'on' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def off() {
|
||||||
|
log.debug "Executing 'off'"
|
||||||
|
// TODO: handle 'off' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def volumeUp() {
|
||||||
|
log.debug "Executing 'volumeUp'"
|
||||||
|
// TODO: handle 'volumeUp' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def volumeDown() {
|
||||||
|
log.debug "Executing 'volumeDown'"
|
||||||
|
// TODO: handle 'volumeDown' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def setVolume() {
|
||||||
|
log.debug "Executing 'setVolume'"
|
||||||
|
// TODO: handle 'setVolume' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def mute() {
|
||||||
|
log.debug "Executing 'mute'"
|
||||||
|
// TODO: handle 'mute' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def unmute() {
|
||||||
|
log.debug "Executing 'unmute'"
|
||||||
|
// TODO: handle 'unmute' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def setPictureMode() {
|
||||||
|
log.debug "Executing 'setPictureMode'"
|
||||||
|
// TODO: handle 'setPictureMode' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def setSoundMode() {
|
||||||
|
log.debug "Executing 'setSoundMode'"
|
||||||
|
// TODO: handle 'setSoundMode' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def on() {
|
||||||
|
log.debug "Executing 'on'"
|
||||||
|
// TODO: handle 'on' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def off() {
|
||||||
|
log.debug "Executing 'off'"
|
||||||
|
// TODO: handle 'off' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def showMessage() {
|
||||||
|
log.debug "Executing 'showMessage'"
|
||||||
|
// TODO: handle 'showMessage' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def speak() {
|
||||||
|
log.debug "Executing 'speak'"
|
||||||
|
// TODO: handle 'speak' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def on() {
|
||||||
|
log.debug "Executing 'on'"
|
||||||
|
// TODO: handle 'on' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def off() {
|
||||||
|
log.debug "Executing 'off'"
|
||||||
|
// TODO: handle 'off' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def setLevel() {
|
||||||
|
log.debug "Executing 'setLevel'"
|
||||||
|
// TODO: handle 'setLevel' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def setHeatingSetpoint() {
|
||||||
|
log.debug "Executing 'setHeatingSetpoint'"
|
||||||
|
// TODO: handle 'setHeatingSetpoint' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def setCoolingSetpoint() {
|
||||||
|
log.debug "Executing 'setCoolingSetpoint'"
|
||||||
|
// TODO: handle 'setCoolingSetpoint' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def off() {
|
||||||
|
log.debug "Executing 'off'"
|
||||||
|
// TODO: handle 'off' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def heat() {
|
||||||
|
log.debug "Executing 'heat'"
|
||||||
|
// TODO: handle 'heat' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def emergencyHeat() {
|
||||||
|
log.debug "Executing 'emergencyHeat'"
|
||||||
|
// TODO: handle 'emergencyHeat' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def cool() {
|
||||||
|
log.debug "Executing 'cool'"
|
||||||
|
// TODO: handle 'cool' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def setThermostatMode() {
|
||||||
|
log.debug "Executing 'setThermostatMode'"
|
||||||
|
// TODO: handle 'setThermostatMode' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def fanOn() {
|
||||||
|
log.debug "Executing 'fanOn'"
|
||||||
|
// TODO: handle 'fanOn' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def fanAuto() {
|
||||||
|
log.debug "Executing 'fanAuto'"
|
||||||
|
// TODO: handle 'fanAuto' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def fanCirculate() {
|
||||||
|
log.debug "Executing 'fanCirculate'"
|
||||||
|
// TODO: handle 'fanCirculate' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def setThermostatFanMode() {
|
||||||
|
log.debug "Executing 'setThermostatFanMode'"
|
||||||
|
// TODO: handle 'setThermostatFanMode' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def auto() {
|
||||||
|
log.debug "Executing 'auto'"
|
||||||
|
// TODO: handle 'auto' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def setSchedule() {
|
||||||
|
log.debug "Executing 'setSchedule'"
|
||||||
|
// TODO: handle 'setSchedule' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def setCoolingSetpoint() {
|
||||||
|
log.debug "Executing 'setCoolingSetpoint'"
|
||||||
|
// TODO: handle 'setCoolingSetpoint' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def fanOn() {
|
||||||
|
log.debug "Executing 'fanOn'"
|
||||||
|
// TODO: handle 'fanOn' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def fanAuto() {
|
||||||
|
log.debug "Executing 'fanAuto'"
|
||||||
|
// TODO: handle 'fanAuto' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def fanCirculate() {
|
||||||
|
log.debug "Executing 'fanCirculate'"
|
||||||
|
// TODO: handle 'fanCirculate' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def setThermostatFanMode() {
|
||||||
|
log.debug "Executing 'setThermostatFanMode'"
|
||||||
|
// TODO: handle 'setThermostatFanMode' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def setHeatingSetpoint() {
|
||||||
|
log.debug "Executing 'setHeatingSetpoint'"
|
||||||
|
// TODO: handle 'setHeatingSetpoint' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def off() {
|
||||||
|
log.debug "Executing 'off'"
|
||||||
|
// TODO: handle 'off' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def heat() {
|
||||||
|
log.debug "Executing 'heat'"
|
||||||
|
// TODO: handle 'heat' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def emergencyHeat() {
|
||||||
|
log.debug "Executing 'emergencyHeat'"
|
||||||
|
// TODO: handle 'emergencyHeat' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def cool() {
|
||||||
|
log.debug "Executing 'cool'"
|
||||||
|
// TODO: handle 'cool' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def auto() {
|
||||||
|
log.debug "Executing 'auto'"
|
||||||
|
// TODO: handle 'auto' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def setThermostatMode() {
|
||||||
|
log.debug "Executing 'setThermostatMode'"
|
||||||
|
// TODO: handle 'setThermostatMode' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def setTimeRemaining() {
|
||||||
|
log.debug "Executing 'setTimeRemaining'"
|
||||||
|
// TODO: handle 'setTimeRemaining' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def start() {
|
||||||
|
log.debug "Executing 'start'"
|
||||||
|
// TODO: handle 'start' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def stop() {
|
||||||
|
log.debug "Executing 'stop'"
|
||||||
|
// TODO: handle 'stop' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def pause() {
|
||||||
|
log.debug "Executing 'pause'"
|
||||||
|
// TODO: handle 'pause' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def cancel() {
|
||||||
|
log.debug "Executing 'cancel'"
|
||||||
|
// TODO: handle 'cancel' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def beep() {
|
||||||
|
log.debug "Executing 'beep'"
|
||||||
|
// TODO: handle 'beep' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def open() {
|
||||||
|
log.debug "Executing 'open'"
|
||||||
|
// TODO: handle 'open' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def close() {
|
||||||
|
log.debug "Executing 'close'"
|
||||||
|
// TODO: handle 'close' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def on() {
|
||||||
|
log.debug "Executing 'on'"
|
||||||
|
// TODO: handle 'on' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def off() {
|
||||||
|
log.debug "Executing 'off'"
|
||||||
|
// TODO: handle 'off' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def mute() {
|
||||||
|
log.debug "Executing 'mute'"
|
||||||
|
// TODO: handle 'mute' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def unmute() {
|
||||||
|
log.debug "Executing 'unmute'"
|
||||||
|
// TODO: handle 'unmute' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def flip() {
|
||||||
|
log.debug "Executing 'flip'"
|
||||||
|
// TODO: handle 'flip' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def capture() {
|
||||||
|
log.debug "Executing 'capture'"
|
||||||
|
// TODO: handle 'capture' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def open() {
|
||||||
|
log.debug "Executing 'open'"
|
||||||
|
// TODO: handle 'open' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def close() {
|
||||||
|
log.debug "Executing 'close'"
|
||||||
|
// TODO: handle 'close' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def presetPosition() {
|
||||||
|
log.debug "Executing 'presetPosition'"
|
||||||
|
// TODO: handle 'presetPosition' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def enableEpEvents() {
|
||||||
|
log.debug "Executing 'enableEpEvents'"
|
||||||
|
// TODO: handle 'enableEpEvents' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def epCmd() {
|
||||||
|
log.debug "Executing 'epCmd'"
|
||||||
|
// TODO: handle 'epCmd' command
|
||||||
|
}
|
||||||
@@ -1,182 +0,0 @@
|
|||||||
/**
|
|
||||||
* SmartSense Open/Closed Sensor
|
|
||||||
*
|
|
||||||
* Copyright 2014 SmartThings
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
|
||||||
* in compliance with the License. You may obtain a copy of the License at:
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
|
|
||||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
|
|
||||||
* for the specific language governing permissions and limitations under the License.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
import physicalgraph.zigbee.clusters.iaszone.ZoneStatus
|
|
||||||
|
|
||||||
metadata {
|
|
||||||
definition(name: "Sensative ZB Strips", namespace: "sensative", author: "SmartThings") {
|
|
||||||
capability "Battery"
|
|
||||||
capability "Configuration"
|
|
||||||
capability "Contact Sensor"
|
|
||||||
capability "Refresh"
|
|
||||||
capability "Temperature Measurement"
|
|
||||||
capability "Health Check"
|
|
||||||
capability "Sensor"
|
|
||||||
|
|
||||||
command "enrollResponse"
|
|
||||||
|
|
||||||
|
|
||||||
fingerprint inClusters: "0000,0001,0003,0402,0500,0020,0B05", outClusters: "0019", manufacturer: "Sensative", model: "Strips-001"
|
|
||||||
fingerprint inClusters: "0000,0001,0003,0402,0500,0020,0B05", outClusters: "0019", manufacturer: "Sensative", model: "Strips-001"
|
|
||||||
fingerprint inClusters: "0000,0001,0003,0020,0402,0500,0B05", outClusters: "0019", manufacturer: "Sensativee", model: "Strips-001", deviceJoinName: "Sensative ZB Strips"
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
simulator {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
preferences {
|
|
||||||
input title: "Temperature Offset", description: "This feature allows you to correct any temperature variations by selecting an offset. Ex: If your sensor consistently reports a temp that's 5 degrees too warm, you'd enter \"-5\". If 3 degrees too cold, enter \"+3\".", displayDuringSetup: false, type: "paragraph", element: "paragraph"
|
|
||||||
input "tempOffset", "number", title: "Degrees", description: "Adjust temperature by this many degrees", range: "*..*", displayDuringSetup: false
|
|
||||||
}
|
|
||||||
|
|
||||||
tiles(scale: 2) {
|
|
||||||
multiAttributeTile(name: "contact", type: "generic", width: 6, height: 4) {
|
|
||||||
tileAttribute("device.contact", key: "PRIMARY_CONTROL") {
|
|
||||||
attributeState "open", label: '${name}', icon: "st.contact.contact.open", backgroundColor: "#e86d13"
|
|
||||||
attributeState "closed", label: '${name}', icon: "st.contact.contact.closed", backgroundColor: "#00A0DC"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
valueTile("temperature", "device.temperature", inactiveLabel: false, width: 2, height: 2) {
|
|
||||||
state "temperature", label: '${currentValue}°F',
|
|
||||||
backgroundColors: [
|
|
||||||
[value: 31, color: "#153591"],
|
|
||||||
[value: 44, color: "#1e9cbb"],
|
|
||||||
[value: 59, color: "#90d2a7"],
|
|
||||||
[value: 74, color: "#44b621"],
|
|
||||||
[value: 84, color: "#f1d801"],
|
|
||||||
[value: 95, color: "#d04e00"],
|
|
||||||
[value: 96, color: "#bc2323"]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false, width: 2, height: 2) {
|
|
||||||
state "battery", label: 'Battery\n${currentValue}%', unit: ""
|
|
||||||
}
|
|
||||||
|
|
||||||
standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
|
|
||||||
state "default", action: "refresh.refresh", icon: "st.secondary.refresh"
|
|
||||||
}
|
|
||||||
|
|
||||||
main(["contact"])
|
|
||||||
details(["contact", "battery", "temperature", "refresh"])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def parse(String description) {
|
|
||||||
log.debug "description: $description"
|
|
||||||
|
|
||||||
Map map = zigbee.getEvent(description)
|
|
||||||
if (!map) {
|
|
||||||
if (description?.startsWith('zone status')) {
|
|
||||||
map = parseIasMessage(description)
|
|
||||||
} else {
|
|
||||||
Map descMap = zigbee.parseDescriptionAsMap(description)
|
|
||||||
if (descMap?.clusterInt == 0x0001 && descMap.commandInt != 0x07 && descMap?.value) {
|
|
||||||
map = getBatteryResult(Integer.parseInt(descMap.value, 16))
|
|
||||||
} else if (descMap?.clusterInt == zigbee.TEMPERATURE_MEASUREMENT_CLUSTER && descMap.commandInt == 0x07) {
|
|
||||||
if (descMap.data[0] == "00") {
|
|
||||||
log.debug "TEMP REPORTING CONFIG RESPONSE: $descMap"
|
|
||||||
sendEvent(name: "checkInterval", value: 60 * 12, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID])
|
|
||||||
} else {
|
|
||||||
log.warn "TEMP REPORTING CONFIG FAILED- error code: ${descMap.data[0]}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (map.name == "temperature") {
|
|
||||||
if (tempOffset) {
|
|
||||||
map.value = (int) map.value + (int) tempOffset
|
|
||||||
}
|
|
||||||
map.descriptionText = temperatureScale == 'C' ? '{{ device.displayName }} was {{ value }}°C' : '{{ device.displayName }} was {{ value }}°F'
|
|
||||||
map.translatable = true
|
|
||||||
}
|
|
||||||
|
|
||||||
log.debug "Parse returned $map"
|
|
||||||
def result = map ? createEvent(map) : [:]
|
|
||||||
|
|
||||||
if (description?.startsWith('enroll request')) {
|
|
||||||
List cmds = zigbee.enrollResponse()
|
|
||||||
log.debug "enroll response: ${cmds}"
|
|
||||||
result = cmds?.collect { new physicalgraph.device.HubAction(it) }
|
|
||||||
}
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private Map parseIasMessage(String description) {
|
|
||||||
ZoneStatus zs = zigbee.parseZoneStatus(description)
|
|
||||||
return zs.isAlarm1Set() ? getContactResult('open') : getContactResult('closed')
|
|
||||||
}
|
|
||||||
|
|
||||||
private Map getBatteryResult(rawValue) {
|
|
||||||
log.debug 'Battery'
|
|
||||||
def linkText = getLinkText(device)
|
|
||||||
|
|
||||||
def result = [:]
|
|
||||||
|
|
||||||
def volts = rawValue / 10
|
|
||||||
if (!(rawValue == 0 || rawValue == 255)) {
|
|
||||||
def minVolts = 2.1
|
|
||||||
def maxVolts = 3.0
|
|
||||||
def pct = (volts - minVolts) / (maxVolts - minVolts)
|
|
||||||
def roundedPct = Math.round(pct * 100)
|
|
||||||
if (roundedPct <= 0)
|
|
||||||
roundedPct = 1
|
|
||||||
result.value = Math.min(100, roundedPct)
|
|
||||||
result.descriptionText = "${linkText} battery was ${result.value}%"
|
|
||||||
result.name = 'battery'
|
|
||||||
}
|
|
||||||
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
private Map getContactResult(value) {
|
|
||||||
log.debug 'Contact Status'
|
|
||||||
def linkText = getLinkText(device)
|
|
||||||
def descriptionText = "${linkText} was ${value == 'open' ? 'opened' : 'closed'}"
|
|
||||||
return [
|
|
||||||
name : 'contact',
|
|
||||||
value : value,
|
|
||||||
descriptionText: descriptionText
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PING is used by Device-Watch in attempt to reach the Device
|
|
||||||
* */
|
|
||||||
def ping() {
|
|
||||||
return zigbee.readAttribute(0x001, 0x0020) // Read the Battery Level
|
|
||||||
}
|
|
||||||
|
|
||||||
def refresh() {
|
|
||||||
log.debug "Refreshing Temperature and Battery"
|
|
||||||
def refreshCmds = zigbee.readAttribute(zigbee.TEMPERATURE_MEASUREMENT_CLUSTER, 0x0000) +
|
|
||||||
zigbee.readAttribute(zigbee.POWER_CONFIGURATION_CLUSTER, 0x0020)
|
|
||||||
|
|
||||||
return refreshCmds + zigbee.enrollResponse()
|
|
||||||
}
|
|
||||||
|
|
||||||
def configure() {
|
|
||||||
// Device-Watch allows 2 check-in misses from device + ping (plus 1 min lag time)
|
|
||||||
// enrolls with default periodic reporting until newer 5 min interval is confirmed
|
|
||||||
sendEvent(name: "checkInterval", value: 2 * 60 * 60 + 1 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID])
|
|
||||||
|
|
||||||
log.debug "Configuring Reporting, IAS CIE, and Bindings."
|
|
||||||
|
|
||||||
// temperature minReportTime 30 seconds, maxReportTime 5 min. Reporting interval if no activity
|
|
||||||
// battery minReport 30 seconds, maxReportTime 6 hrs by default
|
|
||||||
return refresh() + zigbee.batteryConfig() + zigbee.temperatureConfig(30, 300) // send refresh cmds as part of config
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user