mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-15 13:10:51 +00:00
Compare commits
7 Commits
PROD_2016.
...
DEVTOOLS-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f5c91f82b6 | ||
|
|
47183ebbff | ||
|
|
d68f70b3dd | ||
|
|
e1b1479cfc | ||
|
|
16e4954f10 | ||
|
|
7beb2e3905 | ||
|
|
7bfa0304af |
@@ -0,0 +1,37 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 2015 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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
metadata {
|
||||||
|
definition (name: "Beacon Capability", namespace: "capabilities", author: "SmartThings") {
|
||||||
|
capability "Beacon"
|
||||||
|
}
|
||||||
|
|
||||||
|
simulator {
|
||||||
|
status "present": "beacon: present"
|
||||||
|
status "not present": "beacon: not present"
|
||||||
|
}
|
||||||
|
|
||||||
|
tiles {
|
||||||
|
standardTile("beacon", "device.beacon", width: 2, height: 2) {
|
||||||
|
state("not present", label:'not present', icon:"st.presence.tile.not-present", backgroundColor:"#ffffff")
|
||||||
|
state("present", label:'present', icon:"st.presence.tile.present", backgroundColor:"#53a7c0")
|
||||||
|
}
|
||||||
|
main "beacon"
|
||||||
|
details "beacon"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def parse(String description) {
|
||||||
|
def pair = description.split(":")
|
||||||
|
createEvent(name: pair[0].trim(), value: pair[1].trim())
|
||||||
|
}
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
* for the specific language governing permissions and limitations under the License.
|
* for the specific language governing permissions and limitations under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
import physicalgraph.zigbee.clusters.iaszone.ZoneStatus
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "NYCE Motion Sensor", namespace: "smartthings", author: "SmartThings") {
|
definition (name: "NYCE Motion Sensor", namespace: "smartthings", author: "SmartThings") {
|
||||||
@@ -143,51 +144,14 @@ private Map parseReportAttributeMessage(String description) {
|
|||||||
|
|
||||||
|
|
||||||
private Map parseIasMessage(String description) {
|
private Map parseIasMessage(String description) {
|
||||||
List parsedMsg = description.split(' ')
|
ZoneStatus zs = zigbee.parseZoneStatus(description)
|
||||||
String msgCode = parsedMsg[2]
|
Map resultMap = [:]
|
||||||
|
|
||||||
Map resultMap = [:]
|
result.name = 'motion'
|
||||||
switch(msgCode) {
|
result.value = zs.isAlarm2Set() ? 'active' : 'inactive'
|
||||||
case '0x0030': // Closed/No Motion/Dry
|
log.debug(zs.isAlarm2Set() ? 'motion' : 'no motion')
|
||||||
log.debug 'no motion'
|
|
||||||
resultMap.name = 'motion'
|
|
||||||
resultMap.value = 'inactive'
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0032': // Open/Motion/Wet
|
return resultMap
|
||||||
log.debug 'motion'
|
|
||||||
resultMap.name = 'motion'
|
|
||||||
resultMap.value = 'active'
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0032': // Tamper Alarm
|
|
||||||
log.debug 'motion with tamper alarm'
|
|
||||||
resultMap.name = 'motion'
|
|
||||||
resultMap.value = 'active'
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0033': // Battery Alarm
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0034': // Supervision Report
|
|
||||||
log.debug 'no motion with tamper alarm'
|
|
||||||
resultMap.name = 'motion'
|
|
||||||
resultMap.value = 'inactive'
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0035': // Restore Report
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0036': // Trouble/Failure
|
|
||||||
log.debug 'motion with failure alarm'
|
|
||||||
resultMap.name = 'motion'
|
|
||||||
resultMap.value = 'active'
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0038': // Test Mode
|
|
||||||
break
|
|
||||||
}
|
|
||||||
return resultMap
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def refresh()
|
def refresh()
|
||||||
|
|||||||
@@ -14,6 +14,9 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import physicalgraph.zigbee.clusters.iaszone.ZoneStatus
|
||||||
|
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "NYCE Open/Closed Sensor", namespace: "smartthings", author: "NYCE") {
|
definition (name: "NYCE Open/Closed Sensor", namespace: "smartthings", author: "NYCE") {
|
||||||
capability "Battery"
|
capability "Battery"
|
||||||
@@ -219,40 +222,33 @@ private Map parseReportAttributeMessage(String description) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private List parseIasMessage(String description) {
|
private List parseIasMessage(String description) {
|
||||||
List parsedMsg = description.split(" ")
|
ZoneStatus zs = zigbee.parseZoneStatus(description)
|
||||||
String msgCode = parsedMsg[2]
|
log.debug "parseIasMessage: $description"
|
||||||
|
|
||||||
List resultListMap = []
|
List resultListMap = []
|
||||||
Map resultMap_battery = [:]
|
Map resultMap_battery = [:]
|
||||||
Map resultMap_battery_state = [:]
|
Map resultMap_battery_state = [:]
|
||||||
Map resultMap_sensor = [:]
|
Map resultMap_sensor = [:]
|
||||||
|
|
||||||
// Relevant bit field definitions from ZigBee spec
|
resultMap_sensor.name = "contact"
|
||||||
def BATTERY_BIT = ( 1 << 3 )
|
resultMap_sensor.value = zs.isAlarm1Set() ? "open" : "closed"
|
||||||
def TROUBLE_BIT = ( 1 << 6 )
|
|
||||||
def SENSOR_BIT = ( 1 << 0 ) // it's ALARM1 bit from the ZCL spec
|
|
||||||
|
|
||||||
// Convert hex string to integer
|
|
||||||
def zoneStatus = Integer.parseInt(msgCode[-4..-1],16)
|
|
||||||
|
|
||||||
log.debug "parseIasMessage: zoneStatus: ${zoneStatus}"
|
|
||||||
|
|
||||||
// Check each relevant bit, create map for it, and add to list
|
// Check each relevant bit, create map for it, and add to list
|
||||||
log.debug "parseIasMessage: Battery Status ${zoneStatus & BATTERY_BIT}"
|
log.debug "parseIasMessage: Battery Status ${zs.battery}"
|
||||||
log.debug "parseIasMessage: Trouble Status ${zoneStatus & TROUBLE_BIT}"
|
log.debug "parseIasMessage: Trouble Status ${zs.trouble}"
|
||||||
log.debug "parseIasMessage: Sensor Status ${zoneStatus & SENSOR_BIT}"
|
log.debug "parseIasMessage: Sensor Status ${zs.alarm1}"
|
||||||
|
|
||||||
/* Comment out this path to check the battery state to avoid overwriting the
|
/* Comment out this path to check the battery state to avoid overwriting the
|
||||||
battery value (Change log #2), but keep these conditions for later use
|
battery value (Change log #2), but keep these conditions for later use
|
||||||
resultMap_battery_state.name = "battery_state"
|
resultMap_battery_state.name = "battery_state"
|
||||||
if (zoneStatus & TROUBLE_BIT) {
|
if (zs.isTroubleSet()) {
|
||||||
resultMap_battery_state.value = "failed"
|
resultMap_battery_state.value = "failed"
|
||||||
|
|
||||||
resultMap_battery.name = "battery"
|
resultMap_battery.name = "battery"
|
||||||
resultMap_battery.value = 0
|
resultMap_battery.value = 0
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (zoneStatus & BATTERY_BIT) {
|
if (zs.isBatterySet()) {
|
||||||
resultMap_battery_state.value = "low"
|
resultMap_battery_state.value = "low"
|
||||||
|
|
||||||
// to generate low battery notification by the platform
|
// to generate low battery notification by the platform
|
||||||
@@ -270,9 +266,6 @@ private List parseIasMessage(String description) {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
resultMap_sensor.name = "contact"
|
|
||||||
resultMap_sensor.value = (zoneStatus & SENSOR_BIT) ? "open" : "closed"
|
|
||||||
|
|
||||||
resultListMap << resultMap_battery_state
|
resultListMap << resultMap_battery_state
|
||||||
resultListMap << resultMap_battery
|
resultListMap << resultMap_battery
|
||||||
resultListMap << resultMap_sensor
|
resultListMap << resultMap_sensor
|
||||||
|
|||||||
@@ -101,6 +101,12 @@ def parse(String description) {
|
|||||||
else {
|
else {
|
||||||
def descriptionText = finalResult.value == "on" ? '{{ device.displayName }} is On' : '{{ device.displayName }} is Off'
|
def descriptionText = finalResult.value == "on" ? '{{ device.displayName }} is On' : '{{ device.displayName }} is Off'
|
||||||
sendEvent(name: finalResult.type, value: finalResult.value, descriptionText: descriptionText, translatable: true)
|
sendEvent(name: finalResult.type, value: finalResult.value, descriptionText: descriptionText, translatable: true)
|
||||||
|
// Temporary fix for the case when Device is OFFLINE and is connected again
|
||||||
|
if (state.lastOnOff == null){
|
||||||
|
state.lastOnOff = now()
|
||||||
|
sendEvent(name: "deviceWatch-lastActivity", value: state.lastOnOff, description: "Last Activity is on ${new Date(state.lastOnOff)}", displayed: false, isStateChange: true)
|
||||||
|
}
|
||||||
|
state.lastOnOff = now()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -116,9 +122,24 @@ def off() {
|
|||||||
def on() {
|
def on() {
|
||||||
zigbee.on()
|
zigbee.on()
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* PING is used by Device-Watch in attempt to reach the Outlet
|
||||||
|
* */
|
||||||
|
def ping() {
|
||||||
|
|
||||||
|
// send read attribute onOFF if the last time we heard from the outlet is outside of the checkInterval
|
||||||
|
if (state.lastOnOff < (now() - (1000 * device.currentValue("checkInterval"))) ){
|
||||||
|
log.info "ping, alive=no, lastOnOff=${new Date(state.lastOnOff)}"
|
||||||
|
state.lastOnOff = null
|
||||||
|
return zigbee.onOffRefresh()
|
||||||
|
} else { // if the last onOff activity is within the checkInterval we artificially create a Device-Watch event
|
||||||
|
log.info "ping, alive=yes, lastOnOff=${new Date(state.lastOnOff)}"
|
||||||
|
sendEvent(name: "deviceWatch-lastActivity", value: state.lastOnOff, description: "Last Activity is on ${new Date(state.lastOnOff)}", displayed: false, isStateChange: true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def refresh() {
|
def refresh() {
|
||||||
zigbee.onOffRefresh() + zigbee.refreshData("0x0B04", "0x050B")
|
zigbee.onOffRefresh() + zigbee.electricMeasurementPowerRefresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
def configure() {
|
def configure() {
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
* License for the specific language governing permissions and limitations
|
* License for the specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
import physicalgraph.zigbee.clusters.iaszone.ZoneStatus
|
||||||
|
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "SmartSense Moisture Sensor",namespace: "smartthings", author: "SmartThings", category: "C2") {
|
definition (name: "SmartSense Moisture Sensor",namespace: "smartthings", author: "SmartThings", category: "C2") {
|
||||||
@@ -22,6 +24,7 @@ metadata {
|
|||||||
capability "Temperature Measurement"
|
capability "Temperature Measurement"
|
||||||
capability "Water Sensor"
|
capability "Water Sensor"
|
||||||
capability "Health Check"
|
capability "Health Check"
|
||||||
|
capability "Sensor"
|
||||||
|
|
||||||
command "enrollResponse"
|
command "enrollResponse"
|
||||||
|
|
||||||
@@ -169,42 +172,9 @@ private Map parseCustomMessage(String description) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Map parseIasMessage(String description) {
|
private Map parseIasMessage(String description) {
|
||||||
List parsedMsg = description.split(' ')
|
ZoneStatus zs = zigbee.parseZoneStatus(description)
|
||||||
String msgCode = parsedMsg[2]
|
|
||||||
|
|
||||||
Map resultMap = [:]
|
return zs.isAlarm1Set() ? getMoistureResult('wet') : getMoistureResult('dry')
|
||||||
switch(msgCode) {
|
|
||||||
case '0x0020': // Closed/No Motion/Dry
|
|
||||||
resultMap = getMoistureResult('dry')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0021': // Open/Motion/Wet
|
|
||||||
resultMap = getMoistureResult('wet')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0022': // Tamper Alarm
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0023': // Battery Alarm
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0024': // Supervision Report
|
|
||||||
log.debug 'dry with tamper alarm'
|
|
||||||
resultMap = getMoistureResult('dry')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0025': // Restore Report
|
|
||||||
log.debug 'water with tamper alarm'
|
|
||||||
resultMap = getMoistureResult('wet')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0026': // Trouble/Failure
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0028': // Test Mode
|
|
||||||
break
|
|
||||||
}
|
|
||||||
return resultMap
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def getTemperature(value) {
|
def getTemperature(value) {
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
* License for the specific language governing permissions and limitations
|
* License for the specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
import physicalgraph.zigbee.clusters.iaszone.ZoneStatus
|
||||||
|
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "SmartSense Motion Sensor", namespace: "smartthings", author: "SmartThings", category: "C2") {
|
definition (name: "SmartSense Motion Sensor", namespace: "smartthings", author: "SmartThings", category: "C2") {
|
||||||
@@ -22,6 +24,7 @@ metadata {
|
|||||||
capability "Temperature Measurement"
|
capability "Temperature Measurement"
|
||||||
capability "Refresh"
|
capability "Refresh"
|
||||||
capability "Health Check"
|
capability "Health Check"
|
||||||
|
capability "Sensor"
|
||||||
|
|
||||||
command "enrollResponse"
|
command "enrollResponse"
|
||||||
|
|
||||||
@@ -182,44 +185,10 @@ private Map parseCustomMessage(String description) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Map parseIasMessage(String description) {
|
private Map parseIasMessage(String description) {
|
||||||
List parsedMsg = description.split(' ')
|
ZoneStatus zs = zigbee.parseZoneStatus(description)
|
||||||
String msgCode = parsedMsg[2]
|
|
||||||
|
|
||||||
Map resultMap = [:]
|
// Some sensor models that use this DTH use alarm1 and some use alarm2 to signify motion
|
||||||
switch(msgCode) {
|
return (zs.isAlarm1Set() || zs.isAlarm2Set()) ? getMotionResult('active') : getMotionResult('inactive')
|
||||||
case '0x0020': // Closed/No Motion/Dry
|
|
||||||
resultMap = getMotionResult('inactive')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0021': // Open/Motion/Wet
|
|
||||||
resultMap = getMotionResult('active')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0022': // Tamper Alarm
|
|
||||||
log.debug 'motion with tamper alarm'
|
|
||||||
resultMap = getMotionResult('active')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0023': // Battery Alarm
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0024': // Supervision Report
|
|
||||||
log.debug 'no motion with tamper alarm'
|
|
||||||
resultMap = getMotionResult('inactive')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0025': // Restore Report
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0026': // Trouble/Failure
|
|
||||||
log.debug 'motion with failure alarm'
|
|
||||||
resultMap = getMotionResult('active')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0028': // Test Mode
|
|
||||||
break
|
|
||||||
}
|
|
||||||
return resultMap
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def getTemperature(value) {
|
def getTemperature(value) {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//DEPRECATED - Using the smartsense-motion-sensor.groovy DTH for this device. Users need to be moved before deleting this DTH
|
//DEPRECATED - Using the smartsense-motion-sensor.groovy DTH for this device. Users need to be moved before deleting this DTH
|
||||||
|
import physicalgraph.zigbee.clusters.iaszone.ZoneStatus
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "SmartSense Motion/Temp Sensor", namespace: "smartthings", author: "SmartThings") {
|
definition (name: "SmartSense Motion/Temp Sensor", namespace: "smartthings", author: "SmartThings") {
|
||||||
@@ -168,44 +169,8 @@ private Map parseCustomMessage(String description) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Map parseIasMessage(String description) {
|
private Map parseIasMessage(String description) {
|
||||||
List parsedMsg = description.split(' ')
|
ZoneStatus zs = zigbee.parseZoneStatus(description)
|
||||||
String msgCode = parsedMsg[2]
|
return zs.isAlarm1Set() ? getMotionResult('active') : getMotionResult('inactive')
|
||||||
|
|
||||||
Map resultMap = [:]
|
|
||||||
switch(msgCode) {
|
|
||||||
case '0x0020': // Closed/No Motion/Dry
|
|
||||||
resultMap = getMotionResult('inactive')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0021': // Open/Motion/Wet
|
|
||||||
resultMap = getMotionResult('active')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0022': // Tamper Alarm
|
|
||||||
log.debug 'motion with tamper alarm'
|
|
||||||
resultMap = getMotionResult('active')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0023': // Battery Alarm
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0024': // Supervision Report
|
|
||||||
log.debug 'no motion with tamper alarm'
|
|
||||||
resultMap = getMotionResult('inactive')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0025': // Restore Report
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0026': // Trouble/Failure
|
|
||||||
log.debug 'motion with failure alarm'
|
|
||||||
resultMap = getMotionResult('active')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0028': // Test Mode
|
|
||||||
break
|
|
||||||
}
|
|
||||||
return resultMap
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def getTemperature(value) {
|
def getTemperature(value) {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
* License for the specific language governing permissions and limitations
|
* License for the specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
import physicalgraph.zigbee.clusters.iaszone.ZoneStatus
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "SmartSense Multi Sensor", namespace: "smartthings", author: "SmartThings", category: "C2") {
|
definition (name: "SmartSense Multi Sensor", namespace: "smartthings", author: "SmartThings", category: "C2") {
|
||||||
@@ -224,47 +225,13 @@ private Map parseCustomMessage(String description) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Map parseIasMessage(String description) {
|
private Map parseIasMessage(String description) {
|
||||||
List parsedMsg = description.split(' ')
|
ZoneStatus zs = zigbee.parseZoneStatus(description)
|
||||||
String msgCode = parsedMsg[2]
|
|
||||||
|
|
||||||
Map resultMap = [:]
|
Map resultMap = [:]
|
||||||
switch(msgCode) {
|
|
||||||
case '0x0020': // Closed/No Motion/Dry
|
|
||||||
if (garageSensor != "Yes"){
|
|
||||||
resultMap = getContactResult('closed')
|
|
||||||
}
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0021': // Open/Motion/Wet
|
if(garageSensor != "Yes") {
|
||||||
if (garageSensor != "Yes"){
|
resultMap = zs.isAlarm1Set() ? getContactResult('open') : getContactResult('closed')
|
||||||
resultMap = getContactResult('open')
|
|
||||||
}
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0022': // Tamper Alarm
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0023': // Battery Alarm
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0024': // Supervision Report
|
|
||||||
if (garageSensor != "Yes"){
|
|
||||||
resultMap = getContactResult('closed')
|
|
||||||
}
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0025': // Restore Report
|
|
||||||
if (garageSensor != "Yes"){
|
|
||||||
resultMap = getContactResult('open')
|
|
||||||
}
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0026': // Trouble/Failure
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0028': // Test Mode
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return resultMap
|
return resultMap
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
//DEPRECATED - Using the smartsense-multi-sensor.groovy DTH for this device. Users need to be moved before deleting this DTH
|
//DEPRECATED - Using the smartsense-multi-sensor.groovy DTH for this device. Users need to be moved before deleting this DTH
|
||||||
|
import physicalgraph.zigbee.clusters.iaszone.ZoneStatus
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "SmartSense Open/Closed Accelerometer Sensor", namespace: "smartthings", author: "SmartThings", category: "C2") {
|
definition (name: "SmartSense Open/Closed Accelerometer Sensor", namespace: "smartthings", author: "SmartThings", category: "C2") {
|
||||||
@@ -24,6 +25,7 @@
|
|||||||
capability "Refresh"
|
capability "Refresh"
|
||||||
capability "Temperature Measurement"
|
capability "Temperature Measurement"
|
||||||
capability "Health Check"
|
capability "Health Check"
|
||||||
|
capability "Sensor"
|
||||||
|
|
||||||
command "enrollResponse"
|
command "enrollResponse"
|
||||||
}
|
}
|
||||||
@@ -171,40 +173,9 @@ private Map parseCustomMessage(String description) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Map parseIasMessage(String description) {
|
private Map parseIasMessage(String description) {
|
||||||
List parsedMsg = description.split(' ')
|
ZoneStatus zs = zigbee.parseZoneStatus(description)
|
||||||
String msgCode = parsedMsg[2]
|
|
||||||
|
|
||||||
Map resultMap = [:]
|
return zs.isAlarm1Set() ? getContactResult('open') : getContactResult('closed')
|
||||||
switch(msgCode) {
|
|
||||||
case '0x0020': // Closed/No Motion/Dry
|
|
||||||
resultMap = getContactResult('closed')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0021': // Open/Motion/Wet
|
|
||||||
resultMap = getContactResult('open')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0022': // Tamper Alarm
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0023': // Battery Alarm
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0024': // Supervision Report
|
|
||||||
resultMap = getContactResult('closed')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0025': // Restore Report
|
|
||||||
resultMap = getContactResult('open')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0026': // Trouble/Failure
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0028': // Test Mode
|
|
||||||
break
|
|
||||||
}
|
|
||||||
return resultMap
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def getTemperature(value) {
|
def getTemperature(value) {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
* for the specific language governing permissions and limitations under the License.
|
* for the specific language governing permissions and limitations under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
import physicalgraph.zigbee.clusters.iaszone.ZoneStatus
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "SmartSense Open/Closed Sensor", namespace: "smartthings", author: "SmartThings", category: "C2") {
|
definition (name: "SmartSense Open/Closed Sensor", namespace: "smartthings", author: "SmartThings", category: "C2") {
|
||||||
@@ -167,40 +168,8 @@ private Map parseCustomMessage(String description) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Map parseIasMessage(String description) {
|
private Map parseIasMessage(String description) {
|
||||||
List parsedMsg = description.split(' ')
|
ZoneStatus zs = zigbee.parseZoneStatus(description)
|
||||||
String msgCode = parsedMsg[2]
|
return zs.isAlarm1Set() ? getContactResult('open') : getContactResult('closed')
|
||||||
|
|
||||||
Map resultMap = [:]
|
|
||||||
switch(msgCode) {
|
|
||||||
case '0x0020': // Closed/No Motion/Dry
|
|
||||||
resultMap = getContactResult('closed')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0021': // Open/Motion/Wet
|
|
||||||
resultMap = getContactResult('open')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0022': // Tamper Alarm
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0023': // Battery Alarm
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0024': // Supervision Report
|
|
||||||
resultMap = getContactResult('closed')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0025': // Restore Report
|
|
||||||
resultMap = getContactResult('open')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0026': // Trouble/Failure
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0028': // Test Mode
|
|
||||||
break
|
|
||||||
}
|
|
||||||
return resultMap
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def getTemperature(value) {
|
def getTemperature(value) {
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ metadata {
|
|||||||
capability "Temperature Measurement"
|
capability "Temperature Measurement"
|
||||||
capability "Relative Humidity Measurement"
|
capability "Relative Humidity Measurement"
|
||||||
capability "Health Check"
|
capability "Health Check"
|
||||||
|
capability "Sensor"
|
||||||
|
|
||||||
fingerprint endpointId: "01", inClusters: "0001,0003,0020,0402,0B05,FC45", outClusters: "0019,0003"
|
fingerprint endpointId: "01", inClusters: "0001,0003,0020,0402,0B05,FC45", outClusters: "0019,0003"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
metadata {
|
metadata {
|
||||||
definition (name: "Simulated Alarm", namespace: "smartthings/testing", author: "SmartThings") {
|
definition (name: "Simulated Alarm", namespace: "smartthings/testing", author: "SmartThings") {
|
||||||
capability "Alarm"
|
capability "Alarm"
|
||||||
|
capability "Sensor"
|
||||||
|
capability "Actuator"
|
||||||
}
|
}
|
||||||
|
|
||||||
simulator {
|
simulator {
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
metadata {
|
metadata {
|
||||||
definition (name: "Simulated Color Control", namespace: "smartthings/testing", author: "SmartThings") {
|
definition (name: "Simulated Color Control", namespace: "smartthings/testing", author: "SmartThings") {
|
||||||
capability "Color Control"
|
capability "Color Control"
|
||||||
|
capability "Sensor"
|
||||||
|
capability "Actuator"
|
||||||
}
|
}
|
||||||
|
|
||||||
simulator {
|
simulator {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ metadata {
|
|||||||
// Automatically generated. Make future change here.
|
// Automatically generated. Make future change here.
|
||||||
definition (name: "Simulated Contact Sensor", namespace: "smartthings/testing", author: "bob") {
|
definition (name: "Simulated Contact Sensor", namespace: "smartthings/testing", author: "bob") {
|
||||||
capability "Contact Sensor"
|
capability "Contact Sensor"
|
||||||
|
capability "Sensor"
|
||||||
|
|
||||||
command "open"
|
command "open"
|
||||||
command "close"
|
command "close"
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ metadata {
|
|||||||
// Automatically generated. Make future change here.
|
// Automatically generated. Make future change here.
|
||||||
definition (name: "Simulated Lock", namespace: "smartthings/testing", author: "bob") {
|
definition (name: "Simulated Lock", namespace: "smartthings/testing", author: "bob") {
|
||||||
capability "Lock"
|
capability "Lock"
|
||||||
|
capability "Sensor"
|
||||||
|
capability "Actuator"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Simulated lock
|
// Simulated lock
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ metadata {
|
|||||||
// Automatically generated. Make future change here.
|
// Automatically generated. Make future change here.
|
||||||
definition (name: "Simulated Motion Sensor", namespace: "smartthings/testing", author: "bob") {
|
definition (name: "Simulated Motion Sensor", namespace: "smartthings/testing", author: "bob") {
|
||||||
capability "Motion Sensor"
|
capability "Motion Sensor"
|
||||||
|
capability "Sensor"
|
||||||
|
|
||||||
command "active"
|
command "active"
|
||||||
command "inactive"
|
command "inactive"
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ metadata {
|
|||||||
// Automatically generated. Make future change here.
|
// Automatically generated. Make future change here.
|
||||||
definition (name: "Simulated Presence Sensor", namespace: "smartthings/testing", author: "bob") {
|
definition (name: "Simulated Presence Sensor", namespace: "smartthings/testing", author: "bob") {
|
||||||
capability "Presence Sensor"
|
capability "Presence Sensor"
|
||||||
|
capability "Sensor"
|
||||||
|
|
||||||
command "arrived"
|
command "arrived"
|
||||||
command "departed"
|
command "departed"
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ metadata {
|
|||||||
definition (name: "Simulated Switch", namespace: "smartthings/testing", author: "bob") {
|
definition (name: "Simulated Switch", namespace: "smartthings/testing", author: "bob") {
|
||||||
capability "Switch"
|
capability "Switch"
|
||||||
capability "Relay Switch"
|
capability "Relay Switch"
|
||||||
|
capability "Sensor"
|
||||||
|
capability "Actuator"
|
||||||
|
|
||||||
command "onPhysical"
|
command "onPhysical"
|
||||||
command "offPhysical"
|
command "offPhysical"
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ metadata {
|
|||||||
definition (name: "Simulated Temperature Sensor", namespace: "smartthings/testing", author: "SmartThings") {
|
definition (name: "Simulated Temperature Sensor", namespace: "smartthings/testing", author: "SmartThings") {
|
||||||
capability "Temperature Measurement"
|
capability "Temperature Measurement"
|
||||||
capability "Switch Level"
|
capability "Switch Level"
|
||||||
|
capability "Sensor"
|
||||||
|
|
||||||
command "up"
|
command "up"
|
||||||
command "down"
|
command "down"
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ metadata {
|
|||||||
definition (name: "Simulated Thermostat", namespace: "smartthings/testing", author: "SmartThings") {
|
definition (name: "Simulated Thermostat", namespace: "smartthings/testing", author: "SmartThings") {
|
||||||
capability "Thermostat"
|
capability "Thermostat"
|
||||||
capability "Relative Humidity Measurement"
|
capability "Relative Humidity Measurement"
|
||||||
|
capability "Sensor"
|
||||||
|
capability "Actuator"
|
||||||
|
|
||||||
command "tempUp"
|
command "tempUp"
|
||||||
command "tempDown"
|
command "tempDown"
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ metadata {
|
|||||||
// Automatically generated. Make future change here.
|
// Automatically generated. Make future change here.
|
||||||
definition (name: "Simulated Water Sensor", namespace: "smartthings/testing", author: "SmartThings") {
|
definition (name: "Simulated Water Sensor", namespace: "smartthings/testing", author: "SmartThings") {
|
||||||
capability "Water Sensor"
|
capability "Water Sensor"
|
||||||
|
capability "Sensor"
|
||||||
|
|
||||||
command "wet"
|
command "wet"
|
||||||
command "dry"
|
command "dry"
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
* for the specific language governing permissions and limitations under the License.
|
* for the specific language governing permissions and limitations under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
import physicalgraph.zigbee.clusters.iaszone.ZoneStatus
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "Tyco Door/Window Sensor", namespace: "smartthings", author: "SmartThings") {
|
definition (name: "Tyco Door/Window Sensor", namespace: "smartthings", author: "SmartThings") {
|
||||||
@@ -161,40 +162,9 @@ private Map parseCustomMessage(String description) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Map parseIasMessage(String description) {
|
private Map parseIasMessage(String description) {
|
||||||
List parsedMsg = description.split(' ')
|
ZoneStatus zs = zigbee.parseZoneStatus(description)
|
||||||
String msgCode = parsedMsg[2]
|
|
||||||
|
|
||||||
Map resultMap = [:]
|
return zs.isAlarm1Set() ? getContactResult('open') : getContactResult('closed')
|
||||||
switch(msgCode) {
|
|
||||||
case '0x0020': // Closed/No Motion/Dry
|
|
||||||
resultMap = getContactResult('closed')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0021': // Open/Motion/Wet
|
|
||||||
resultMap = getContactResult('open')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0022': // Tamper Alarm
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0023': // Battery Alarm
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0024': // Supervision Report
|
|
||||||
resultMap = getContactResult('closed')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0025': // Restore Report
|
|
||||||
resultMap = getContactResult('open')
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0026': // Trouble/Failure
|
|
||||||
break
|
|
||||||
|
|
||||||
case '0x0028': // Test Mode
|
|
||||||
break
|
|
||||||
}
|
|
||||||
return resultMap
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def getTemperature(value) {
|
def getTemperature(value) {
|
||||||
|
|||||||
Reference in New Issue
Block a user