Compare commits
20 Commits
PROD_2017.
...
user186_7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4bba6f267a | ||
|
|
9d6cc16c16 | ||
|
|
16d89e61fd | ||
|
|
341943f342 | ||
|
|
ecd7bf2a82 | ||
|
|
1983484032 | ||
|
|
35b63b3289 | ||
|
|
ee3f125bca | ||
|
|
c93435b14d | ||
|
|
134b108df5 | ||
|
|
b850e772d7 | ||
|
|
0d617ab5a8 | ||
|
|
e8ef2d052f | ||
|
|
001ba48b5c | ||
|
|
1e088b1655 | ||
|
|
3f8c0e92e3 | ||
|
|
6a91660719 | ||
|
|
73d8f4787e | ||
|
|
f82ff2ba03 | ||
|
|
a241804190 |
@@ -24,7 +24,10 @@ metadata {
|
||||
capability "Temperature Measurement"
|
||||
capability "Health Check"
|
||||
|
||||
fingerprint deviceId: "0x0701", inClusters: "0x5E, 0x20, 0x86, 0x72, 0x5A, 0x59, 0x85, 0x73, 0x84, 0x80, 0x71, 0x56, 0x70, 0x31, 0x8E, 0x22, 0x30, 0x9C, 0x98, 0x7A", outClusters: ""
|
||||
fingerprint deviceId: "0x0701", inClusters: "0x5E, 0x20, 0x86, 0x72, 0x5A, 0x59, 0x85, 0x73, 0x84, 0x80, 0x71, 0x56, 0x70, 0x31, 0x8E, 0x22, 0x30, 0x9C, 0x98, 0x7A", outClusters: ""
|
||||
fingerprint mfr:"010F", prod:"0801", model:"2001"
|
||||
fingerprint mfr:"010F", prod:"0801", model:"1001"
|
||||
|
||||
}
|
||||
|
||||
simulator {
|
||||
|
||||
@@ -18,7 +18,6 @@ metadata {
|
||||
capability "Actuator"
|
||||
capability "Switch"
|
||||
capability "Configuration"
|
||||
capability "Polling"
|
||||
capability "Refresh"
|
||||
capability "Sensor"
|
||||
|
||||
@@ -167,10 +166,6 @@ def setLevel(value, duration) {
|
||||
zwave.switchMultilevelV2.switchMultilevelSet(value: value, dimmingDuration: dimmingDuration).format()
|
||||
}
|
||||
|
||||
def poll() {
|
||||
zwave.switchMultilevelV1.switchMultilevelGet().format()
|
||||
}
|
||||
|
||||
def refresh() {
|
||||
zwave.switchMultilevelV1.switchMultilevelGet().format()
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ metadata {
|
||||
capability "Actuator"
|
||||
capability "Switch"
|
||||
capability "Configuration"
|
||||
capability "Polling"
|
||||
capability "Refresh"
|
||||
capability "Sensor"
|
||||
|
||||
@@ -122,13 +121,6 @@ def off() {
|
||||
])
|
||||
}
|
||||
|
||||
def poll() {
|
||||
delayBetween([
|
||||
zwave.switchBinaryV1.switchBinaryGet().format(),
|
||||
zwave.meterV2.meterGet().format()
|
||||
])
|
||||
}
|
||||
|
||||
def refresh() {
|
||||
zwave.switchBinaryV1.switchBinaryGet().format()
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ metadata {
|
||||
capability "Actuator"
|
||||
capability "Indicator"
|
||||
capability "Switch"
|
||||
capability "Polling"
|
||||
capability "Refresh"
|
||||
capability "Sensor"
|
||||
capability "Health Check"
|
||||
@@ -26,7 +25,6 @@ metadata {
|
||||
fingerprint mfr:"0063", prod:"4457", deviceJoinName: "GE In-Wall Smart Dimmer"
|
||||
fingerprint mfr:"0063", prod:"4944", deviceJoinName: "GE In-Wall Smart Dimmer"
|
||||
fingerprint mfr:"0063", prod:"5044", deviceJoinName: "GE Plug-In Smart Dimmer"
|
||||
fingerprint mfr:"0063", prod:"4944", model:"3034", deviceJoinName: "GE In-Wall Smart Fan Control"
|
||||
}
|
||||
|
||||
simulator {
|
||||
@@ -242,10 +240,6 @@ def setLevel(value, duration) {
|
||||
zwave.switchMultilevelV1.switchMultilevelGet().format()], getStatusDelay)
|
||||
}
|
||||
|
||||
def poll() {
|
||||
zwave.switchMultilevelV1.switchMultilevelGet().format()
|
||||
}
|
||||
|
||||
/**
|
||||
* PING is used by Device-Watch in attempt to reach the Device
|
||||
* */
|
||||
|
||||
@@ -124,6 +124,10 @@ metadata {
|
||||
input "holdType", "enum", title: "Hold Type",
|
||||
description: "When changing temperature, use Temporary (Until next transition) or Permanent hold (default)",
|
||||
required: false, options:["Temporary", "Permanent"]
|
||||
input "deadbandSetting", "number", title: "Minimum temperature difference between the desired Heat and Cool " +
|
||||
"temperatures in Auto mode:\nNote! This must be the same as configured on the thermostat",
|
||||
description: "temperature difference °F", defaultValue: 5,
|
||||
required: false
|
||||
}
|
||||
|
||||
}
|
||||
@@ -172,7 +176,7 @@ def generateEvent(Map results) {
|
||||
if (name=="temperature" || name=="heatingSetpoint" || name=="coolingSetpoint" ) {
|
||||
sendValue = getTempInLocalScale(value, "F") // API return temperature values in F
|
||||
event << [value: sendValue, unit: locationScale]
|
||||
} else if (name=="maxCoolingSetpoint" || name=="minCoolingSetpoint" || name=="maxHeatingSetpoint" || name=="minHeatingSetpoint") {
|
||||
} else if (name=="maxCoolingSetpoint" || name=="minCoolingSetpoint" || name=="maxHeatingSetpoint" || name=="minHeatingSetpoint") {
|
||||
// Old attributes, keeping for backward compatibility
|
||||
sendValue = getTempInLocalScale(value, "F") // API return temperature values in F
|
||||
event << [value: sendValue, unit: locationScale, displayed: false]
|
||||
@@ -465,7 +469,7 @@ def enforceSetpointLimits(setpoint, data, raise = null) {
|
||||
def maxSetpoint = (setpoint == "heatingSetpoint") ? device.getDataValue("maxHeatingSetpointFahrenheit") : device.getDataValue("maxCoolingSetpointFahrenheit")
|
||||
minSetpoint = minSetpoint ? Double.parseDouble(minSetpoint) : ((setpoint == "heatingSetpoint") ? 45 : 65) // default 45 heat, 65 cool
|
||||
maxSetpoint = maxSetpoint ? Double.parseDouble(maxSetpoint) : ((setpoint == "heatingSetpoint") ? 79 : 92) // default 79 heat, 92 cool
|
||||
def deadband = 5 // °F
|
||||
def deadband = deadbandSetting ? deadbandSetting : 5 // °F
|
||||
def delta = (locationScale == "F") ? 1 : 0.5
|
||||
def targetValue = getTempInDeviceScale(data.targetValue, locationScale)
|
||||
def heatingSetpoint = getTempInDeviceScale(data.heatingSetpoint, locationScale)
|
||||
@@ -475,8 +479,8 @@ def enforceSetpointLimits(setpoint, data, raise = null) {
|
||||
targetValue = maxSetpoint
|
||||
} else if (targetValue < minSetpoint) {
|
||||
targetValue = minSetpoint
|
||||
} else if ((setpoint == "heatingSetpoint" && targetValue == heatingSetpoint) ||
|
||||
(setpoint == "coolingSetpoint" && targetValue == coolingSetpoint)){
|
||||
} else if ((raise != null) && ((setpoint == "heatingSetpoint" && targetValue == heatingSetpoint) ||
|
||||
(setpoint == "coolingSetpoint" && targetValue == coolingSetpoint))) {
|
||||
// Ensure targetValue differes from old. When location scale differs from device,
|
||||
// converting between C -> F -> C may otherwise result in no change.
|
||||
targetValue += raise ? delta : - delta
|
||||
|
||||
@@ -46,15 +46,16 @@
|
||||
capability "Illuminance Measurement"
|
||||
capability "Sensor"
|
||||
capability "Battery"
|
||||
capability "Health Check"
|
||||
capability "Health Check"
|
||||
|
||||
command "resetParams2StDefaults"
|
||||
command "listCurrentParams"
|
||||
command "updateZwaveParam"
|
||||
command "test"
|
||||
command "configure"
|
||||
command "resetParams2StDefaults"
|
||||
command "listCurrentParams"
|
||||
command "updateZwaveParam"
|
||||
command "test"
|
||||
command "configure"
|
||||
|
||||
fingerprint deviceId: "0x2001", inClusters: "0x30,0x84,0x85,0x80,0x8F,0x56,0x72,0x86,0x70,0x8E,0x31,0x9C,0xEF,0x30,0x31,0x9C"
|
||||
fingerprint mfr:"010F", prod:"0800", model:"2001"
|
||||
fingerprint mfr:"010F", prod:"0800", model:"1001"
|
||||
}
|
||||
|
||||
simulator {
|
||||
|
||||
@@ -32,7 +32,7 @@ metadata {
|
||||
fingerprint profileId: "0104", inClusters: "0000,0001,0003,0009,000A,0101,0020", outClusters: "000A,0019", manufacturer: "Yale", model: "YRD210 PB DB", deviceJoinName: "Yale Push Button Deadbolt Lock"
|
||||
fingerprint profileId: "0104", inClusters: "0000,0001,0003,0009,000A,0101,0020", outClusters: "000A,0019", manufacturer: "Yale", model: "YRD220/240 TSDB", deviceJoinName: "Yale Touch Screen Deadbolt Lock"
|
||||
fingerprint profileId: "0104", inClusters: "0000,0001,0003,0009,000A,0101,0020", outClusters: "000A,0019", manufacturer: "Yale", model: "YRL210 PB LL", deviceJoinName: "Yale Push Button Lever Lock"
|
||||
fingerprint profileId: "0104", inClusters: "0000,0001,0003,0009,000A,0101,0020", outClusters: "000A,0019", manufacturer: "Yale", model: "YRD226/246 TSDB", deviceJoinName: "Yale Touch Screen Deadbolt Lock"
|
||||
fingerprint profileId: "0104", inClusters: "0000,0001,0003,0009,000A,0101,0020", outClusters: "000A,0019", manufacturer: "Yale", model: "YRD226/246 TSDB", deviceJoinName: "Yale Assure Lock"
|
||||
fingerprint profileId: "0104", inClusters: "0000,0001,0003,0004,0005,0009,0020,0101,0402,0B05,FDBD", outClusters: "000A,0019", manufacturer: "Kwikset", model: "SMARTCODE_DEADBOLT_5", deviceJoinName: "Kwikset 5-Button Deadbolt"
|
||||
fingerprint profileId: "0104", inClusters: "0000,0001,0003,0004,0005,0009,0020,0101,0402,0B05,FDBD", outClusters: "000A,0019", manufacturer: "Kwikset", model: "SMARTCODE_LEVER_5", deviceJoinName: "Kwikset 5-Button Lever"
|
||||
fingerprint profileId: "0104", inClusters: "0000,0001,0003,0004,0005,0009,0020,0101,0402,0B05,FDBD", outClusters: "000A,0019", manufacturer: "Kwikset", model: "SMARTCODE_DEADBOLT_10", deviceJoinName: "Kwikset 10-Button Deadbolt"
|
||||
|
||||
@@ -38,7 +38,10 @@ metadata {
|
||||
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300, 0B04, FC0F", outClusters: "0019", manufacturer: "OSRAM", model: "Classic A60 TW", deviceJoinName: "OSRAM LIGHTIFY LED Classic A60 Tunable White"
|
||||
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300, 0B04, FC0F", outClusters: "0019", manufacturer: "OSRAM", model: "LIGHTIFY A19 Tunable White", deviceJoinName: "SYLVANIA Smart A19 Tunable White"
|
||||
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300, 0B04, FC0F", outClusters: "0019", manufacturer: "OSRAM", model: "Classic B40 TW - LIGHTIFY", deviceJoinName: "OSRAM LIGHTIFY Classic B40 Tunable White"
|
||||
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300, 0702, 0B05", outClusters: "0019", manufacturer: "sengled", model: "Z01-A19NAE26", deviceJoinName: "Sengled Element plus"
|
||||
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300, 0702, 0B05", outClusters: "0019", manufacturer: "sengled", model: "Z01-A19NAE26", deviceJoinName: "Sengled Element Plus"
|
||||
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300, 0702, 0B05", outClusters: "0019", manufacturer: "sengled", model: "Z01-A191AE26W", deviceJoinName: "Sengled Element Plus"
|
||||
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300, 0702, 0B05", outClusters: "0019", manufacturer: "sengled", model: "Z01-A60EAB22", deviceJoinName: "Sengled Element Plus"
|
||||
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300, 0702, 0B05", outClusters: "0019", manufacturer: "sengled", model: "Z01-A60EAE27", deviceJoinName: "Sengled Element Plus"
|
||||
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300, 0B04, 0B05, FC01, FC08", outClusters: "0003, 0019", manufacturer: "LEDVANCE", model: "A19 TW 10 year", deviceJoinName: "SYLVANIA Smart 10Y A19 TW"
|
||||
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300, 0B04, FC0F", outClusters: "0019", manufacturer: "OSRAM", model: "LIGHTIFY Conv Under Cabinet TW", deviceJoinName: "SYLVANIA Smart Convertible Under Cabinet"
|
||||
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300, 0B04, FC0F", outClusters: "0019", manufacturer: "OSRAM", model: "ColorstripRGBW", deviceJoinName: "SYLVANIA Smart Convertible Under Cabinet"
|
||||
|
||||
@@ -31,6 +31,13 @@ metadata {
|
||||
fingerprint mfr:"001D", prod:"0401", model:"0334", deviceJoinName: "Leviton 600W Incandescent Dimmer"
|
||||
fingerprint mfr:"0111", prod:"8200", model:"0200", deviceJoinName: "Remotec Technology Plug-In Dimmer"
|
||||
fingerprint mfr:"1104", prod:"001D", model:"0501", deviceJoinName: "Leviton 1000W Incandescant Dimmer"
|
||||
fingerprint mfr:"0039", prod:"5044", model:"3033", deviceJoinName: "Honeywell Z-Wave Plug-in Dimmer (Dual Outlet)"
|
||||
fingerprint mfr:"0039", prod:"5044", model:"3038", deviceJoinName: "Honeywell Z-Wave Plug-in Dimmer"
|
||||
fingerprint mfr:"0039", prod:"4944", model:"3038", deviceJoinName: "Honeywell Z-Wave In-Wall Smart Dimmer"
|
||||
fingerprint mfr:"0039", prod:"4944", model:"3130", deviceJoinName: "Honeywell Z-Wave In-Wall Smart Toggle Dimmer"
|
||||
fingerprint mfr:"0063", prod:"4944", model:"3034", deviceJoinName: "GE In-Wall Smart Fan Control"
|
||||
fingerprint mfr:"0063", prod:"4944", model:"3131", deviceJoinName: "GE In-Wall Smart Fan Control"
|
||||
fingerprint mfr:"0039", prod:"4944", model:"3131", deviceJoinName: "Honeywell Z-Wave Plus In-Wall Fan Speed Control"
|
||||
}
|
||||
|
||||
simulator {
|
||||
@@ -81,6 +88,7 @@ metadata {
|
||||
def installed(){
|
||||
// Device-Watch simply pings if no device events received for 32min(checkInterval)
|
||||
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID, offlinePingable: "1"])
|
||||
response(refresh())
|
||||
}
|
||||
|
||||
def updated(){
|
||||
|
||||
@@ -48,7 +48,7 @@ metadata {
|
||||
fingerprint mfr:"0129", prod:"0004", model:"0800", deviceJoinName: "Yale Push Button Deadbolt Door Lock" // YRD110
|
||||
fingerprint mfr:"0129", prod:"0004", model:"0000", deviceJoinName: "Yale Push Button Deadbolt Door Lock" // YRD210
|
||||
fingerprint mfr:"0129", prod:"0001", model:"0000", deviceJoinName: "Yale Push Button Lever Door Lock" // YRD210
|
||||
fingerprint mfr:"0129", prod:"8002", model:"0600", deviceJoinName: "Yale Assure Lock with Bluetooth" //YRD416, YRD426, YRD446
|
||||
fingerprint mfr:"0129", prod:"8002", model:"0600", deviceJoinName: "Yale Assure Lock" //YRD416, YRD426, YRD446
|
||||
fingerprint mfr:"0129", prod:"0007", model:"0001", deviceJoinName: "Yale Keyless Connected Smart Door Lock"
|
||||
fingerprint mfr:"0129", prod:"8004", model:"0600", deviceJoinName: "Yale Assure Lock Push Button Deadbolt" //YRD216
|
||||
// Samsung
|
||||
@@ -320,7 +320,18 @@ def zwaveEvent(DoorLockOperationReport cmd) {
|
||||
result << response(secure(zwave.associationV1.associationGet(groupingIdentifier:1)))
|
||||
}
|
||||
}
|
||||
result ? [createEvent(map), *result] : createEvent(map)
|
||||
if (generatesDoorLockOperationReportBeforeAlarmReport()) {
|
||||
// we're expecting lock events to come after notification events, but for specific yale locks they come out of order
|
||||
runIn(3, "delayLockEvent", [data: [map: map]])
|
||||
return [:]
|
||||
} else {
|
||||
return result ? [createEvent(map), *result] : createEvent(map)
|
||||
}
|
||||
}
|
||||
|
||||
def delayLockEvent(data) {
|
||||
log.debug "Sending cached lock operation: $data.map"
|
||||
sendEvent(data.map)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -387,7 +398,7 @@ private def handleAccessAlarmReport(cmd) {
|
||||
break
|
||||
case 5: // Locked with keypad
|
||||
if (cmd.eventParameter || cmd.alarmLevel) {
|
||||
codeID = cmd.eventParameter[2] ?: cmd.alarmLevel
|
||||
codeID = readCodeSlotId(cmd)
|
||||
codeName = getCodeName(lockCodes, codeID)
|
||||
map.descriptionText = "Locked by \"$codeName\""
|
||||
map.data = [ usedCode: codeID, codeName: codeName, method: "keypad" ]
|
||||
@@ -398,7 +409,7 @@ private def handleAccessAlarmReport(cmd) {
|
||||
break
|
||||
case 6: // Unlocked with keypad
|
||||
if (cmd.eventParameter || cmd.alarmLevel) {
|
||||
codeID = cmd.eventParameter[2] ?: cmd.alarmLevel
|
||||
codeID = readCodeSlotId(cmd)
|
||||
codeName = getCodeName(lockCodes, codeID)
|
||||
map.descriptionText = "Unlocked by \"$codeName\""
|
||||
map.data = [ usedCode: codeID, codeName: codeName, method: "keypad" ]
|
||||
@@ -431,7 +442,7 @@ private def handleAccessAlarmReport(cmd) {
|
||||
break
|
||||
case 0xD: // User code deleted
|
||||
if (cmd.eventParameter || cmd.alarmLevel) {
|
||||
codeID = cmd.eventParameter[2] ?: cmd.alarmLevel
|
||||
codeID = readCodeSlotId(cmd)
|
||||
if (lockCodes[codeID.toString()]) {
|
||||
codeName = getCodeName(lockCodes, codeID)
|
||||
map = [ name: "codeChanged", value: "$codeID deleted", isStateChange: true ]
|
||||
@@ -443,7 +454,7 @@ private def handleAccessAlarmReport(cmd) {
|
||||
break
|
||||
case 0xE: // Master or user code changed/set
|
||||
if (cmd.eventParameter || cmd.alarmLevel) {
|
||||
codeID = cmd.eventParameter[2] ?: cmd.alarmLevel
|
||||
codeID = readCodeSlotId(cmd)
|
||||
if(codeID == 0 && isKwiksetLock()) {
|
||||
//Ignoring this AlarmReport as Kwikset reports codeID 0 when all slots are full and user tries to set another lock code manually
|
||||
//Kwikset locks don't send AlarmReport when Master code is set
|
||||
@@ -464,7 +475,7 @@ private def handleAccessAlarmReport(cmd) {
|
||||
break
|
||||
case 0xF: // Duplicate Pin-code error
|
||||
if (cmd.eventParameter || cmd.alarmLevel) {
|
||||
codeID = cmd.eventParameter[2] ?: cmd.alarmLevel
|
||||
codeID = readCodeSlotId(cmd)
|
||||
clearStateForSlot(codeID)
|
||||
map = [ name: "codeChanged", value: "$codeID failed", descriptionText: "User code is duplicate and not added",
|
||||
isStateChange: true, data: [isCodeDuplicate: true] ]
|
||||
@@ -592,14 +603,14 @@ private def handleAlarmReportUsingAlarmType(cmd) {
|
||||
case 19: // Unlocked with keypad
|
||||
map = [ name: "lock", value: "unlocked" ]
|
||||
if (cmd.alarmLevel != null) {
|
||||
codeID = cmd.alarmLevel
|
||||
codeID = readCodeSlotId(cmd)
|
||||
codeName = getCodeName(lockCodes, codeID)
|
||||
map.descriptionText = "Unlocked by \"$codeName\""
|
||||
map.data = [ usedCode: codeID, codeName: codeName, method: "keypad" ]
|
||||
}
|
||||
break
|
||||
case 18: // Locked with keypad
|
||||
codeID = cmd.alarmLevel
|
||||
codeID = readCodeSlotId(cmd)
|
||||
map = [ name: "lock", value: "locked" ]
|
||||
// Kwikset lock reporting code id as 0 when locked using the lock keypad button
|
||||
if (isKwiksetLock() && codeID == 0) {
|
||||
@@ -646,7 +657,7 @@ private def handleAlarmReportUsingAlarmType(cmd) {
|
||||
result << createEvent(name: "lockCodes", value: util.toJson([:]), displayed: false, descriptionText: "'lockCodes' attribute updated")
|
||||
break
|
||||
case 33: // User code deleted
|
||||
codeID = cmd.alarmLevel
|
||||
codeID = readCodeSlotId(cmd)
|
||||
if (lockCodes[codeID.toString()]) {
|
||||
codeName = getCodeName(lockCodes, codeID)
|
||||
map = [ name: "codeChanged", value: "$codeID deleted", isStateChange: true ]
|
||||
@@ -660,7 +671,7 @@ private def handleAlarmReportUsingAlarmType(cmd) {
|
||||
break
|
||||
case 13:
|
||||
case 112: // Master or user code changed/set
|
||||
codeID = cmd.alarmLevel
|
||||
codeID = readCodeSlotId(cmd)
|
||||
if(codeID == 0 && isKwiksetLock()) {
|
||||
//Ignoring this AlarmReport as Kwikset reports codeID 0 when all slots are full and user tries to set another lock code manually
|
||||
//Kwikset locks don't send AlarmReport when Master code is set
|
||||
@@ -681,7 +692,7 @@ private def handleAlarmReportUsingAlarmType(cmd) {
|
||||
break
|
||||
case 34:
|
||||
case 113: // Duplicate Pin-code error
|
||||
codeID = cmd.alarmLevel
|
||||
codeID = readCodeSlotId(cmd)
|
||||
clearStateForSlot(codeID)
|
||||
map = [ name: "codeChanged", value: "$codeID failed", descriptionText: "User code is duplicate and not added",
|
||||
isStateChange: true, data: [isCodeDuplicate: true] ]
|
||||
@@ -1657,3 +1668,30 @@ def isYaleLock() {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this lock generates door lock operation report before alarm report, false otherwise
|
||||
* @return true if this lock generates door lock operation report before alarm report, false otherwise
|
||||
*/
|
||||
def generatesDoorLockOperationReportBeforeAlarmReport() {
|
||||
//Fix for ICP-2367, ICP-2366
|
||||
if(isYaleLock() && "0007" == zwaveInfo.prod && "0001" == zwaveInfo.model) {
|
||||
//Yale Keyless Connected Smart Door Lock
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic function for reading code Slot ID from AlarmReport command
|
||||
* @param cmd: The AlarmReport command
|
||||
* @return user code slot id
|
||||
*/
|
||||
def readCodeSlotId(physicalgraph.zwave.commands.alarmv2.AlarmReport cmd) {
|
||||
if(cmd.numberOfEventParameters == 1) {
|
||||
return cmd.eventParameter[0]
|
||||
} else if(cmd.numberOfEventParameters >= 3) {
|
||||
return cmd.eventParameter[2]
|
||||
}
|
||||
return cmd.alarmLevel
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ metadata {
|
||||
capability "Actuator"
|
||||
capability "Switch"
|
||||
capability "Power Meter"
|
||||
capability "Polling"
|
||||
capability "Refresh"
|
||||
capability "Configuration"
|
||||
capability "Sensor"
|
||||
@@ -201,14 +200,6 @@ def off() {
|
||||
]
|
||||
}
|
||||
|
||||
def poll() {
|
||||
delayBetween([
|
||||
zwave.switchBinaryV1.switchBinaryGet().format(),
|
||||
zwave.meterV2.meterGet(scale: 0).format(),
|
||||
zwave.meterV2.meterGet(scale: 2).format()
|
||||
])
|
||||
}
|
||||
|
||||
/**
|
||||
* PING is used by Device-Watch in attempt to reach the Device
|
||||
* */
|
||||
|
||||
@@ -31,6 +31,12 @@ metadata {
|
||||
fingerprint mfr:"001D", prod:"1603", model:"0334", deviceJoinName: "Leviton 15A Split Duplex Receptacle"
|
||||
fingerprint mfr:"011A", prod:"0101", model:"0102", deviceJoinName: "Enerwave On/Off Switch"
|
||||
fingerprint mfr:"011A", prod:"0101", model:"0603", deviceJoinName: "Enerwave Duplex Receptacle"
|
||||
fingerprint mfr:"0039", prod:"5052", model:"3038", deviceJoinName: "Honeywell Z-Wave Plug-in Switch"
|
||||
fingerprint mfr:"0039", prod:"5052", model:"3033", deviceJoinName: "Honeywell Z-Wave Plug-in Switch (Dual Outlet)"
|
||||
fingerprint mfr:"0039", prod:"4F50", model:"3032", deviceJoinName: "Honeywell Z-Wave Plug-in Outdoor Smart Switch"
|
||||
fingerprint mfr:"0039", prod:"4952", model:"3036", deviceJoinName: "Honeywell Z-Wave In-Wall Smart Switch"
|
||||
fingerprint mfr:"0039", prod:"4952", model:"3037", deviceJoinName: "Honeywell Z-Wave In-Wall Smart Toggle Switch"
|
||||
fingerprint mfr:"0039", prod:"4952", model:"3133", deviceJoinName: "Honeywell Z-Wave In-Wall Tamper Resistant Duplex Receptacle"
|
||||
}
|
||||
|
||||
// simulator metadata
|
||||
|
||||
@@ -16,7 +16,6 @@ metadata {
|
||||
capability "Actuator"
|
||||
capability "Indicator"
|
||||
capability "Switch"
|
||||
capability "Polling"
|
||||
capability "Refresh"
|
||||
capability "Sensor"
|
||||
capability "Health Check"
|
||||
@@ -177,13 +176,6 @@ def off() {
|
||||
])
|
||||
}
|
||||
|
||||
def poll() {
|
||||
delayBetween([
|
||||
zwave.switchBinaryV1.switchBinaryGet().format(),
|
||||
zwave.manufacturerSpecificV1.manufacturerSpecificGet().format()
|
||||
])
|
||||
}
|
||||
|
||||
/**
|
||||
* PING is used by Device-Watch in attempt to reach the Device
|
||||
**/
|
||||
|
||||
121
smartapps/smartthings/thermostats.src/thermostats.groovy
Normal file
121
smartapps/smartthings/thermostats.src/thermostats.groovy
Normal file
@@ -0,0 +1,121 @@
|
||||
/**
|
||||
* Copyright 2017 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.
|
||||
*
|
||||
* Thermostats
|
||||
*
|
||||
* Author: Juan Pablo Risso
|
||||
* Date: 2017-12-05
|
||||
*
|
||||
*/
|
||||
|
||||
definition(
|
||||
name: "Thermostats",
|
||||
namespace: "smartthings",
|
||||
author: "SmartThings",
|
||||
description: "Receive notifications when anything happens in your home.",
|
||||
category: "SmartSolutions",
|
||||
iconUrl: "https://s3.amazonaws.com/smartapp-icons/SafetyAndSecurity/Cat-SafetyAndSecurity.png",
|
||||
iconX2Url: "https://s3.amazonaws.com/smartapp-icons/SafetyAndSecurity/Cat-SafetyAndSecurity@2x.png",
|
||||
singleInstance: true
|
||||
)
|
||||
|
||||
preferences {
|
||||
section("Choose one or more, when..."){
|
||||
input "smokeDevices", "capability.smokeDetector", title: "Smoke Detected", required: false, multiple: true
|
||||
input "carbonMonoxideDevices", "capability.carbonMonoxideDetector", title: "Carbon Monoxide Detected", required: false, multiple: true
|
||||
}
|
||||
section("Turn off these thermostats"){
|
||||
input "thermostatDevices", "capability.thermostat", title: "Thermostats", required: true, multiple: true
|
||||
}
|
||||
section("Send this message (optional, sends standard status message if not specified)"){
|
||||
input "messageText", "text", title: "Message Text", required: false
|
||||
}
|
||||
section("Via a push notification and/or an SMS message"){
|
||||
input("recipients", "contact", title: "Send notifications to") {
|
||||
input "phone", "phone", title: "Enter a phone number to get SMS", required: false
|
||||
paragraph "If outside the US please make sure to enter the proper country code"
|
||||
input "pushAndPhone", "enum", title: "Notify me via Push Notification", required: false, options: ["Yes", "No"]
|
||||
}
|
||||
}
|
||||
section("Minimum time between messages (optional, defaults to every message)") {
|
||||
input "frequency", "decimal", title: "Minutes", required: false
|
||||
}
|
||||
}
|
||||
|
||||
def installed() {
|
||||
log.debug "Installed with settings: ${settings}"
|
||||
subscribeToEvents()
|
||||
}
|
||||
|
||||
def updated() {
|
||||
log.debug "Updated with settings: ${settings}"
|
||||
unsubscribe()
|
||||
subscribeToEvents()
|
||||
}
|
||||
|
||||
def subscribeToEvents() {
|
||||
subscribe(smokeDevices, "smoke.detected", eventHandler)
|
||||
subscribe(smokeDevices, "smoke.tested", eventHandler)
|
||||
subscribe(smokeDevices, "carbonMonoxide.detected", eventHandler)
|
||||
subscribe(carbonMonoxideDevices, "carbonMonoxide.detected", eventHandler)
|
||||
}
|
||||
|
||||
def eventHandler(evt) {
|
||||
log.debug "Notify got evt ${evt}"
|
||||
// Turn off thermostat
|
||||
thermostatDevices*.setThermostatMode("off")
|
||||
if (frequency) {
|
||||
def lastTime = state[evt.deviceId]
|
||||
if (lastTime == null || now() - lastTime >= frequency * 60000) {
|
||||
sendMessage(evt)
|
||||
}
|
||||
}
|
||||
else {
|
||||
sendMessage(evt)
|
||||
}
|
||||
}
|
||||
|
||||
private sendMessage(evt) {
|
||||
String msg = messageText
|
||||
Map options = [:]
|
||||
|
||||
if (!messageText) {
|
||||
msg = '{{ triggerEvent.descriptionText }}'
|
||||
options = [translatable: true, triggerEvent: evt]
|
||||
}
|
||||
log.debug "$evt.name:$evt.value, pushAndPhone:$pushAndPhone, '$msg'"
|
||||
|
||||
if (location.contactBookEnabled) {
|
||||
sendNotificationToContacts(msg, recipients, options)
|
||||
} else {
|
||||
if (phone) {
|
||||
options.phone = phone
|
||||
if (pushAndPhone != 'No') {
|
||||
log.debug 'Sending push and SMS'
|
||||
options.method = 'both'
|
||||
} else {
|
||||
log.debug 'Sending SMS'
|
||||
options.method = 'phone'
|
||||
}
|
||||
} else if (pushAndPhone != 'No') {
|
||||
log.debug 'Sending push'
|
||||
options.method = 'push'
|
||||
} else {
|
||||
log.debug 'Sending nothing'
|
||||
options.method = 'none'
|
||||
}
|
||||
sendNotification(msg, options)
|
||||
}
|
||||
if (frequency) {
|
||||
state[evt.deviceId] = now()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user