mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-21 13:10:51 +00:00
Compare commits
21 Commits
MSA-1875-1
...
MSA-1899-2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae3a01a7f7 | ||
|
|
e5739fd425 | ||
|
|
6448a5bc7c | ||
|
|
1db3765a9c | ||
|
|
e4642e300f | ||
|
|
b4eed54ddd | ||
|
|
b2b03604a7 | ||
|
|
2b05817843 | ||
|
|
1f6a27f381 | ||
|
|
157bc3ef56 | ||
|
|
096f4f767f | ||
|
|
c15a21b8bf | ||
|
|
daefec9d1f | ||
|
|
a28c90e492 | ||
|
|
664b300b37 | ||
|
|
2b6d978d13 | ||
|
|
8197097e1d | ||
|
|
4644362465 | ||
|
|
2c25e293c0 | ||
|
|
36fe6428ab | ||
|
|
7f3a99d889 |
@@ -1,438 +0,0 @@
|
|||||||
/**
|
|
||||||
* Strips by Sensative
|
|
||||||
* Device Handler by Don Caruana
|
|
||||||
*
|
|
||||||
* Date: 2017-2-19
|
|
||||||
* Supported Command Classes per device specs
|
|
||||||
*
|
|
||||||
* Association v2
|
|
||||||
* Association Group Information
|
|
||||||
* Battery
|
|
||||||
* Binary Sensor
|
|
||||||
* Configuration
|
|
||||||
* Device Reset Local
|
|
||||||
* Manufacturer Specific
|
|
||||||
* Notification v4
|
|
||||||
* Powerlevel
|
|
||||||
* Version v2
|
|
||||||
* Wake Up v2
|
|
||||||
* ZWavePlus Info v2
|
|
||||||
*
|
|
||||||
* Parm Size Description Value
|
|
||||||
* 1 1 Type of report to send 1 (Default)-Notification Report, 0-Binary Sensor report, 2-Basic report
|
|
||||||
* 2 1 LED Indication 1 (Default)-On for event (ex. door opened), 0-Off
|
|
||||||
*
|
|
||||||
* This device handler will just override the smartthings default wakeup interval of 4 hours and set to 24 hours (manufacturer default)
|
|
||||||
* and check the battery once a day (no sooner than every 23 hours)
|
|
||||||
*/
|
|
||||||
|
|
||||||
metadata {
|
|
||||||
definition (name: "Strips by Sensative", namespace: "doncaruana/Sensative", author: "Don Caruana, Sensative") {
|
|
||||||
|
|
||||||
capability "Contact Sensor"
|
|
||||||
capability "Configuration"
|
|
||||||
capability "Battery"
|
|
||||||
capability "Sensor"
|
|
||||||
capability "Refresh"
|
|
||||||
attribute "needUpdate", "string"
|
|
||||||
attribute "tamper" , "string"
|
|
||||||
|
|
||||||
fingerprint mfr:"019A", prod:"0003", model:"0003", deviceJoinName:"Strips by Sensative"
|
|
||||||
fingerprint deviceId:"0x0701", inClusters: "0x5E,0x86,0x72,0x30,0x70,0x71,0x5A,0x85,0x59,0x80,0x84,0x73"
|
|
||||||
fingerprint cc: "0x5E,0x86,0x72,0x30,0x70,0x71,0x5A,0x85,0x59,0x80,0x84,0x73", mfr:"019A", prod:"0003", model:"0003", deviceJoinName:"Strips by Sensative"
|
|
||||||
}
|
|
||||||
|
|
||||||
preferences {
|
|
||||||
section ("configuration settings") {
|
|
||||||
input(
|
|
||||||
title : "Changes in Settings marked with * will not take effect until the next device Wake Up."
|
|
||||||
,description : null
|
|
||||||
,type : "paragraph")
|
|
||||||
input "sendType", "enum",
|
|
||||||
title: "* Reporting Type",
|
|
||||||
description: "Notification Report",
|
|
||||||
options:["binary": "Sensor Binary Report", "notification": "Notification Report", "basic": "Basic Report"],
|
|
||||||
defaultValue: "notification",
|
|
||||||
displayDuringSetup: false
|
|
||||||
input "wakeupInterval","enum",
|
|
||||||
title: "* Device Wake Up Interval",
|
|
||||||
description: "24 hours",
|
|
||||||
defaultValue: "86400",
|
|
||||||
required: false,
|
|
||||||
displayDuringSetup: false,
|
|
||||||
options: buildInterval()
|
|
||||||
input "led", "bool",
|
|
||||||
title: "* LED On",
|
|
||||||
defaultValue: true,
|
|
||||||
displayDuringSetup: false
|
|
||||||
input "ignoreWakeup", "bool",
|
|
||||||
title: "Ignore Manual Wake Up",
|
|
||||||
defaultValue: false,
|
|
||||||
displayDuringSetup: false
|
|
||||||
input "invertOutput", "bool",
|
|
||||||
title: "Invert Open/Close Reporting",
|
|
||||||
defaultValue: false,
|
|
||||||
displayDuringSetup: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tiles(scale: 2) {
|
|
||||||
multiAttributeTile(name:"contact", width: 6, height: 4, canChangeIcon: true){
|
|
||||||
tileAttribute ("device.contact", key: "PRIMARY_CONTROL") {
|
|
||||||
attributeState "open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#ffa81e"
|
|
||||||
attributeState "closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#79b821"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
standardTile("tamper", "device.tamper", inactiveLabel: false, width: 4, height: 3) {
|
|
||||||
state "tamper", label:'${currentValue}', action:"refresh.refresh", backgroundColor:"#FFCC7B"
|
|
||||||
}
|
|
||||||
standardTile("configure", "device.needUpdate", inactiveLabel: false, width: 2, height: 2) {
|
|
||||||
state "NO" , label:'Synced', backgroundColor:"#B1D57D"
|
|
||||||
state "YES", label:'Pending changes', backgroundColor:"#FFCC7B"
|
|
||||||
}
|
|
||||||
standardTile("battery", "device.battery", inactiveLabel: false, width: 2, height: 1) {
|
|
||||||
state "battery", label:'Battery: ${currentValue}%'
|
|
||||||
}
|
|
||||||
|
|
||||||
main (["contact"])
|
|
||||||
details(["contact","battery","tamper","configure"])
|
|
||||||
}
|
|
||||||
|
|
||||||
simulator {
|
|
||||||
// messages the device returns in response to commands it receives
|
|
||||||
status "open (basic)" : "command: 9881, payload: 00 20 01 FF"
|
|
||||||
status "closed (basic)" : "command: 9881 payload: 00 20 01 00"
|
|
||||||
status "open (notification)" : "command: 9881, payload: 00 71 05 06 FF 00 FF 06 16 00 00"
|
|
||||||
status "closed (notification)" : "command: 9881, payload: 00 71 05 06 00 00 FF 06 17 00 00"
|
|
||||||
status "wake up" : "command: 9881, payload: 00 84 07"
|
|
||||||
status "battery (100%)" : "command: 9881, payload: 00 80 03 64"
|
|
||||||
status "battery low" : "command: 9881, payload: 00 80 03 FF"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def configure() {
|
|
||||||
def commands = []
|
|
||||||
state.lastupdate = now()
|
|
||||||
sendEvent(name: "tamper", value: "No Tamper", displayed: false)
|
|
||||||
log.debug "Listing all device parameters and defaults since this is a new inclusion"
|
|
||||||
commands << zwave.manufacturerSpecificV1.manufacturerSpecificGet().format()
|
|
||||||
commands << zwave.versionV1.versionGet().format()
|
|
||||||
commands << zwave.batteryV1.batteryGet().format()
|
|
||||||
commands << zwave.configurationV1.configurationGet(parameterNumber: 1).format()
|
|
||||||
commands << zwave.configurationV1.configurationGet(parameterNumber: 2).format()
|
|
||||||
commands << zwave.wakeUpV2.wakeUpIntervalSet(seconds: 86400, nodeid:zwaveHubNodeId).format()
|
|
||||||
commands << zwave.wakeUpV2.wakeUpIntervalGet().format()
|
|
||||||
commands << zwave.wakeUpV2.wakeUpNoMoreInformation().format()
|
|
||||||
delayBetween(commands, 1500)
|
|
||||||
}
|
|
||||||
|
|
||||||
private getCommandClassVersions() {
|
|
||||||
[
|
|
||||||
0x71: 3, // Notification
|
|
||||||
0x5E: 2, // ZwaveplusInfo
|
|
||||||
0x59: 1, // AssociationGrpInfo
|
|
||||||
0x85: 2, // Association
|
|
||||||
0x80: 1, // Battery
|
|
||||||
0x70: 1, // Configuration
|
|
||||||
0x5A: 1, // DeviceResetLocally
|
|
||||||
0x72: 1, // ManufacturerSpecific
|
|
||||||
0x73: 1, // Powerlevel
|
|
||||||
0x84: 2, // WakeUp
|
|
||||||
0x86: 1, // Version
|
|
||||||
0x30: 1, // Binary Sensor
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
// Parse incoming device messages to generate events
|
|
||||||
def parse(String description) {
|
|
||||||
def result = []
|
|
||||||
def cmd
|
|
||||||
if (description.startsWith("Err 106")) {
|
|
||||||
state.sec = 0
|
|
||||||
result = createEvent( name: "secureInclusion", value: "failed", eventType: "ALERT",
|
|
||||||
descriptionText: "This sensor failed to complete the network security key exchange. If you are unable to control it via SmartThings, you must remove it from your network and add it again.")
|
|
||||||
} else if (description.startsWith("Err")) {
|
|
||||||
result = createEvent(descriptionText: "$device.displayName $description", isStateChange: true)
|
|
||||||
} else {
|
|
||||||
cmd = zwave.parse(description, commandClassVersions)
|
|
||||||
if (cmd) {
|
|
||||||
result = zwaveEvent(cmd)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (result instanceof List) {
|
|
||||||
result = result.flatten()
|
|
||||||
}
|
|
||||||
log.debug "Parsed '$description' to $result"
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Triggered when Done button is pushed on Preference Pane
|
|
||||||
*/
|
|
||||||
def updated()
|
|
||||||
{
|
|
||||||
if(now() - state.lastupdate > 3000){
|
|
||||||
def isUpdateNeeded = "NO"
|
|
||||||
if(wakeupInterval != null && state.wakeupInterval != wakeupInterval) {isUpdateNeeded = "YES"}
|
|
||||||
if (sendType != null && sendType != state.sendType) {isUpdateNeeded = "YES"}
|
|
||||||
if (led != null && led != state.led) {isUpdateNeeded = "YES"}
|
|
||||||
state.lastupdate = now()
|
|
||||||
sendEvent(name:"needUpdate", value: isUpdateNeeded, displayed:false, isStateChange: true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Only device parameter changes require a state change
|
|
||||||
*/
|
|
||||||
def update_settings()
|
|
||||||
{
|
|
||||||
def cmds = []
|
|
||||||
def isUpdateNeeded = "NO"
|
|
||||||
if (state.wakeupInterval != wakeupInterval){
|
|
||||||
cmds << zwave.wakeUpV2.wakeUpIntervalSet(seconds: wakeupInterval.toInteger(), nodeid:zwaveHubNodeId).format()
|
|
||||||
cmds << "delay 1000"
|
|
||||||
cmds << zwave.wakeUpV2.wakeUpIntervalGet().format()
|
|
||||||
}
|
|
||||||
if (sendType != state.sendType){
|
|
||||||
cmds << zwave.configurationV1.configurationSet(parameterNumber: 1, size: 1, configurationValue: [sendType == "binary" ? 0 : sendType == "basic" ? 2 : 1]).format()
|
|
||||||
cmds << "delay 1000"
|
|
||||||
cmds << zwave.configurationV1.configurationGet(parameterNumber: 1).format()
|
|
||||||
}
|
|
||||||
if (led != state.led){
|
|
||||||
cmds << zwave.configurationV1.configurationSet(parameterNumber: 2, size: 1, configurationValue: [led == true ? 1 : 0]).format()
|
|
||||||
cmds << "delay 1000"
|
|
||||||
cmds << zwave.configurationV1.configurationGet(parameterNumber: 2).format()
|
|
||||||
}
|
|
||||||
cmds << "delay 1000"
|
|
||||||
sendEvent(name:"needUpdate", value: isUpdateNeeded, displayed:false, isStateChange: true)
|
|
||||||
return cmds
|
|
||||||
}
|
|
||||||
|
|
||||||
def zwaveEvent(physicalgraph.zwave.commands.configurationv1.ConfigurationReport cmd) {
|
|
||||||
def name = ""
|
|
||||||
def value = ""
|
|
||||||
def tmpParm = cmd.parameterNumber
|
|
||||||
|
|
||||||
def reportValue = cmd.configurationValue[0]
|
|
||||||
switch (cmd.parameterNumber) {
|
|
||||||
case 1:
|
|
||||||
name = "sendType"
|
|
||||||
switch (reportValue) {
|
|
||||||
case 0:
|
|
||||||
value = "binary"
|
|
||||||
break
|
|
||||||
case 1:
|
|
||||||
value = "notification"
|
|
||||||
break
|
|
||||||
case 2:
|
|
||||||
value = "basic"
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
break
|
|
||||||
}
|
|
||||||
state.sendType = value
|
|
||||||
log.debug "sendType = $value"
|
|
||||||
break
|
|
||||||
case 2:
|
|
||||||
name = "led"
|
|
||||||
value = reportValue
|
|
||||||
log.debug "led = $value"
|
|
||||||
state.led = reportValue == 1 ? true : false
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
break
|
|
||||||
}
|
|
||||||
sendEvent(name: name, value: value, displayed: true)
|
|
||||||
}
|
|
||||||
|
|
||||||
def zwaveEvent(physicalgraph.zwave.commands.securityv1.SecurityMessageEncapsulation cmd) {
|
|
||||||
def encapsulatedCommand = cmd.encapsulatedCommand(commandClassVersions)
|
|
||||||
log.debug "encapsulated: $encapsulatedCommand"
|
|
||||||
if (encapsulatedCommand) {
|
|
||||||
state.sec = 1
|
|
||||||
return zwaveEvent(encapsulatedCommand)
|
|
||||||
} else {
|
|
||||||
log.warn "Unable to extract encapsulated cmd from $cmd"
|
|
||||||
return [createEvent(descriptionText: cmd.toString())]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def sensorValueEvent(value) {
|
|
||||||
//If the invertOutput parameter is set, logically invert the output value
|
|
||||||
def flip = 0
|
|
||||||
if (state.sendType == "notification"){
|
|
||||||
flip = value ^ 0x1}
|
|
||||||
else{
|
|
||||||
flip = value ^ 0xFF}
|
|
||||||
if (invertOutput) {value = flip}
|
|
||||||
if (value) {
|
|
||||||
createEvent(name: "contact", value: "open", descriptionText: "$device.displayName is open")
|
|
||||||
} else {
|
|
||||||
createEvent(name: "contact", value: "closed", descriptionText: "$device.displayName is closed")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicReport cmd) {
|
|
||||||
return sensorValueEvent(cmd.value)
|
|
||||||
}
|
|
||||||
|
|
||||||
def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicSet cmd) {
|
|
||||||
return sensorValueEvent(cmd.value)
|
|
||||||
}
|
|
||||||
|
|
||||||
def zwaveEvent(physicalgraph.zwave.commands.sensorbinaryv1.SensorBinaryReport cmd) {
|
|
||||||
return sensorValueEvent(cmd.sensorValue)
|
|
||||||
}
|
|
||||||
|
|
||||||
def zwaveEvent(physicalgraph.zwave.commands.sensoralarmv1.SensorAlarmReport cmd) {
|
|
||||||
return sensorValueEvent(cmd.sensorState)
|
|
||||||
}
|
|
||||||
|
|
||||||
def zwaveEvent(physicalgraph.zwave.commands.notificationv3.NotificationReport cmd) {
|
|
||||||
def result = []
|
|
||||||
if (cmd.notificationType == 0x06 && cmd.event == 0x16) {
|
|
||||||
result << sensorValueEvent(1)
|
|
||||||
} else if (cmd.notificationType == 0x06 && cmd.event == 0x17) {
|
|
||||||
result << sensorValueEvent(0)
|
|
||||||
} else if (cmd.notificationType == 0x07) {
|
|
||||||
if (cmd.event == 0x00) {
|
|
||||||
if (cmd.eventParametersLength == 0 || cmd.eventParameter[0] != 3) {
|
|
||||||
result << createEvent(descriptionText: "$device.displayName covering replaced", isStateChange: true, displayed: false)
|
|
||||||
} else {
|
|
||||||
result << sensorValueEvent(0)
|
|
||||||
}
|
|
||||||
} else if (cmd.event == 0x01 || cmd.event == 0x02) {
|
|
||||||
result << sensorValueEvent(1)
|
|
||||||
} else if (cmd.event == 0x03) {
|
|
||||||
result << createEvent(descriptionText: "$device.displayName covering was removed", isStateChange: true)
|
|
||||||
if (!device.currentState("ManufacturerCode")) {
|
|
||||||
result << response(secure(zwave.manufacturerSpecificV1.manufacturerSpecificGet()))
|
|
||||||
}
|
|
||||||
} else if (cmd.event == 0x04) {
|
|
||||||
def timeString1 = new Date().format("MMM d", location.timeZone)
|
|
||||||
def timeString2 = new Date().format("hh:mm:ss", location.timeZone)
|
|
||||||
result << createEvent(name: "tamper", value: "Tampered\n${timeString1}\n${timeString2}", descriptionText: "$device.displayName was tampered with at ${timeString1} ${timeString2}", isStateChange: true)
|
|
||||||
if (!ignoreWakeup) {
|
|
||||||
sendEvent(name:"WakeUp", value: "Manual Wakeup", descriptionText: "${device.displayName} woke up", isStateChange: true, displayed: true)
|
|
||||||
result << doWakeup()
|
|
||||||
}
|
|
||||||
} else if (cmd.event == 0x05 || cmd.event == 0x06) {
|
|
||||||
result << createEvent(descriptionText: "$device.displayName detected glass breakage", isStateChange: true)
|
|
||||||
} else {
|
|
||||||
result << createEvent(descriptionText: "$device.displayName event $cmd.event ${cmd.eventParameter.inspect()}", isStateChange: true, displayed: false)
|
|
||||||
}
|
|
||||||
} else if (cmd.notificationType) {
|
|
||||||
result << createEvent(descriptionText: "$device.displayName notification $cmd.notificationType event $cmd.event ${cmd.eventParameter.inspect()}", isStateChange: true, displayed: false)
|
|
||||||
} else {
|
|
||||||
def value = cmd.v1AlarmLevel == 255 ? "active" : cmd.v1AlarmLevel ?: "inactive"
|
|
||||||
result << createEvent(name: "alarm $cmd.v1AlarmType", value: value, isStateChange: true, displayed: false)
|
|
||||||
}
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
def zwaveEvent(physicalgraph.zwave.commands.wakeupv2.WakeUpNotification cmd) {
|
|
||||||
def event = createEvent(name: "WakeUp", value: "Auto Wakeup", descriptionText: "${device.displayName} woke up", isStateChange: true, displayed: true)
|
|
||||||
def cmds = []
|
|
||||||
|
|
||||||
if (!device.currentState("ManufacturerCode")) {
|
|
||||||
cmds << zwave.manufacturerSpecificV1.manufacturerSpecificGet().format()
|
|
||||||
cmds << "delay 2000"
|
|
||||||
}
|
|
||||||
if (!state.lastbat || now() - state.lastbat > 23*60*60*1000) { //check no sooner than once every 23 hours (once a day)
|
|
||||||
log.debug "checking battery"
|
|
||||||
event.descriptionText += ", requesting battery"
|
|
||||||
cmds << zwave.batteryV1.batteryGet().format()
|
|
||||||
cmds << "delay 2000"
|
|
||||||
} else {
|
|
||||||
log.debug "not checking battery, was updated ${(now() - state.lastbat)/60000 as int} min ago"
|
|
||||||
}
|
|
||||||
if (device.currentValue("needUpdate") == "YES") { cmds += update_settings() }
|
|
||||||
cmds << zwave.wakeUpV2.wakeUpNoMoreInformation().format()
|
|
||||||
return [event, response(cmds)]
|
|
||||||
}
|
|
||||||
|
|
||||||
def zwaveEvent(physicalgraph.zwave.commands.batteryv1.BatteryReport cmd) {
|
|
||||||
def map = [ name: "battery", unit: "%" ]
|
|
||||||
if (cmd.batteryLevel == 0xFF) {
|
|
||||||
map.value = 1
|
|
||||||
map.descriptionText = "${device.displayName} has a low battery"
|
|
||||||
map.isStateChange = true
|
|
||||||
} else {
|
|
||||||
map.value = cmd.batteryLevel
|
|
||||||
}
|
|
||||||
def event = createEvent(map)
|
|
||||||
map.isStateChange = true
|
|
||||||
state.lastbat = now()
|
|
||||||
return [event]
|
|
||||||
}
|
|
||||||
|
|
||||||
def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv1.ManufacturerSpecificReport cmd) {
|
|
||||||
def result = []
|
|
||||||
def manufacturerCode = String.format("%04X", cmd.manufacturerId)
|
|
||||||
def productTypeCode = String.format("%04X", cmd.productTypeId)
|
|
||||||
def productCode = String.format("%04X", cmd.productId)
|
|
||||||
def wirelessConfig = "ZWP"
|
|
||||||
|
|
||||||
updateDataValue("Manufacturer", cmd.manufacturerName)
|
|
||||||
updateDataValue("Manufacturer ID", manufacturerCode)
|
|
||||||
updateDataValue("Product Type", productTypeCode)
|
|
||||||
updateDataValue("Product Code", productCode)
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
def zwaveEvent(physicalgraph.zwave.Command cmd) {
|
|
||||||
return [createEvent(descriptionText: "$device.displayName: $cmd", displayed: false)]
|
|
||||||
}
|
|
||||||
|
|
||||||
private secure(physicalgraph.zwave.Command cmd) {
|
|
||||||
if (state.sec == 0) { // default to secure
|
|
||||||
cmd.format()
|
|
||||||
} else {
|
|
||||||
zwave.securityV1.securityMessageEncapsulation().encapsulate(cmd).format()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private secureSequence(commands, delay=200) {
|
|
||||||
delayBetween(commands.collect{ secure(it) }, delay)
|
|
||||||
}
|
|
||||||
|
|
||||||
def buildInterval() {
|
|
||||||
def intervalList = []
|
|
||||||
intervalList << [ "0" : "Disabled" ]
|
|
||||||
intervalList << [ "1800" : "30 minutes" ]
|
|
||||||
intervalList << [ "3600" : "1 hour" ]
|
|
||||||
intervalList << [ "7200" : "2 hours" ]
|
|
||||||
intervalList << [ "10800" : "3 hours" ]
|
|
||||||
intervalList << [ "14400" : "4 hours" ]
|
|
||||||
intervalList << [ "18000" : "5 hours" ]
|
|
||||||
intervalList << [ "21600" : "6 hours" ]
|
|
||||||
intervalList << [ "36000" : "10 hours" ]
|
|
||||||
intervalList << [ "43200" : "12 hours" ]
|
|
||||||
intervalList << [ "86400" : "24 hours" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
def doWakeup() {
|
|
||||||
def cmds = []
|
|
||||||
cmds << "delay 2000"
|
|
||||||
if (device.currentValue("needUpdate") == "YES") { cmds += update_settings() }
|
|
||||||
cmds << zwave.wakeUpV2.wakeUpNoMoreInformation().format()
|
|
||||||
return response(cmds)
|
|
||||||
}
|
|
||||||
|
|
||||||
def refresh() {
|
|
||||||
sendEvent(name: "tamper", value: "No Tamper", displayed: false)
|
|
||||||
}
|
|
||||||
|
|
||||||
def zwaveEvent(physicalgraph.zwave.commands.versionv1.VersionReport cmd) {
|
|
||||||
def appversion = String.format("%02d.%02d", cmd.applicationVersion, cmd.applicationSubVersion)
|
|
||||||
def zprotoversion = String.format("%d.%02d", cmd.zWaveProtocolVersion, cmd.zWaveProtocolSubVersion)
|
|
||||||
updateDataValue("zWave Library", cmd.zWaveLibraryType.toString())
|
|
||||||
updateDataValue("Firmware", appversion)
|
|
||||||
updateDataValue("zWave Version", zprotoversion)
|
|
||||||
sendEvent(name: "Firmware", value: appversion, displayed: true)
|
|
||||||
}
|
|
||||||
|
|
||||||
def zwaveEvent(physicalgraph.zwave.commands.wakeupv2.WakeUpIntervalReport cmd) {
|
|
||||||
state.wakeupInterval = cmd.seconds.toString()
|
|
||||||
sendEvent(name: "wakeupInterval", value: state.wakeupInterval, displayed: true)
|
|
||||||
}
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "Fibaro Door/Window Sensor ZW5 with Temperature", namespace: "fibargroup", author: "Fibar Group S.A.") {
|
definition (name: "Fibaro Door/Window Sensor ZW5 with Temperature", namespace: "fibargroup", author: "Fibar Group S.A.", ocfDeviceType: "x.com.st.d.sensor.contact") {
|
||||||
capability "Battery"
|
capability "Battery"
|
||||||
capability "Contact Sensor"
|
capability "Contact Sensor"
|
||||||
capability "Sensor"
|
capability "Sensor"
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "Fibaro Door/Window Sensor ZW5", namespace: "fibargroup", author: "Fibar Group S.A.") {
|
definition (name: "Fibaro Door/Window Sensor ZW5", namespace: "fibargroup", author: "Fibar Group S.A.", ocfDeviceType: "x.com.st.d.sensor.contact") {
|
||||||
capability "Battery"
|
capability "Battery"
|
||||||
capability "Contact Sensor"
|
capability "Contact Sensor"
|
||||||
capability "Sensor"
|
capability "Sensor"
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "Fibaro Flood Sensor ZW5", namespace: "fibargroup", author: "Fibar Group S.A.") {
|
definition (name: "Fibaro Flood Sensor ZW5", namespace: "fibargroup", author: "Fibar Group S.A.", ocfDeviceType: "x.com.st.d.sensor.moisture") {
|
||||||
capability "Battery"
|
capability "Battery"
|
||||||
capability "Configuration"
|
capability "Configuration"
|
||||||
capability "Sensor"
|
capability "Sensor"
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "Fibaro Motion Sensor ZW5", namespace: "fibargroup", author: "Fibar Group S.A.") {
|
definition (name: "Fibaro Motion Sensor ZW5", namespace: "fibargroup", author: "Fibar Group S.A.", ocfDeviceType: "x.com.st.d.sensor.motion") {
|
||||||
capability "Battery"
|
capability "Battery"
|
||||||
capability "Configuration"
|
capability "Configuration"
|
||||||
capability "Illuminance Measurement"
|
capability "Illuminance Measurement"
|
||||||
|
|||||||
@@ -100,6 +100,11 @@ 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])
|
||||||
|
}
|
||||||
|
|
||||||
def updated(){
|
def updated(){
|
||||||
// Device-Watch simply pings if no device events received for 32min(checkInterval)
|
// 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])
|
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
|
|||||||
@@ -58,6 +58,11 @@ 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])
|
||||||
|
}
|
||||||
|
|
||||||
def updated() {
|
def updated() {
|
||||||
// Device-Watch simply pings if no device events received for 32min(checkInterval)
|
// 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])
|
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "Cree Bulb", namespace: "smartthings", author: "SmartThings") {
|
definition (name: "Cree Bulb", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") {
|
||||||
|
|
||||||
capability "Actuator"
|
capability "Actuator"
|
||||||
capability "Configuration"
|
capability "Configuration"
|
||||||
|
|||||||
@@ -84,6 +84,11 @@ 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])
|
||||||
|
}
|
||||||
|
|
||||||
def updated(){
|
def updated(){
|
||||||
// Device-Watch simply pings if no device events received for 32min(checkInterval)
|
// 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])
|
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
|
|||||||
@@ -85,6 +85,11 @@ def parse(String description) {
|
|||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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])
|
||||||
|
}
|
||||||
|
|
||||||
//send the command to stop polling
|
//send the command to stop polling
|
||||||
def updated() {
|
def updated() {
|
||||||
// Device-Watch simply pings if no device events received for 32min(checkInterval)
|
// Device-Watch simply pings if no device events received for 32min(checkInterval)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "Everspring Flood Sensor", namespace: "smartthings", author: "SmartThings") {
|
definition (name: "Everspring Flood Sensor", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "x.com.st.d.sensor.moisture") {
|
||||||
capability "Water Sensor"
|
capability "Water Sensor"
|
||||||
capability "Configuration"
|
capability "Configuration"
|
||||||
capability "Sensor"
|
capability "Sensor"
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
* @return none
|
* @return none
|
||||||
*/
|
*/
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "Fibaro Motion Sensor", namespace: "smartthings", author: "SmartThings") {
|
definition (name: "Fibaro Motion Sensor", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "x.com.st.d.sensor.motion") {
|
||||||
capability "Motion Sensor"
|
capability "Motion Sensor"
|
||||||
capability "Temperature Measurement"
|
capability "Temperature Measurement"
|
||||||
capability "Acceleration Sensor"
|
capability "Acceleration Sensor"
|
||||||
@@ -436,4 +436,3 @@ def listCurrentParams() {
|
|||||||
|
|
||||||
delayBetween(cmds, 500)
|
delayBetween(cmds, 500)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,11 @@ 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])
|
||||||
|
}
|
||||||
|
|
||||||
def updated(){
|
def updated(){
|
||||||
// Device-Watch simply pings if no device events received for 32min(checkInterval)
|
// 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])
|
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "GE Link Bulb", namespace: "smartthings", author: "SmartThings") {
|
definition (name: "GE Link Bulb", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") {
|
||||||
|
|
||||||
capability "Actuator"
|
capability "Actuator"
|
||||||
capability "Configuration"
|
capability "Configuration"
|
||||||
|
|||||||
@@ -57,10 +57,20 @@ metadata {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void installed() {
|
def initialize() {
|
||||||
sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"LAN\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device.hub.hardwareID}\"}", displayed: false)
|
sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"LAN\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device.hub.hardwareID}\"}", displayed: false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void installed() {
|
||||||
|
log.debug "installed()"
|
||||||
|
initialize()
|
||||||
|
}
|
||||||
|
|
||||||
|
def updated() {
|
||||||
|
log.debug "updated()"
|
||||||
|
initialize()
|
||||||
|
}
|
||||||
|
|
||||||
// parse events into attributes
|
// parse events into attributes
|
||||||
def parse(description) {
|
def parse(description) {
|
||||||
log.debug "parse() - $description"
|
log.debug "parse() - $description"
|
||||||
|
|||||||
@@ -45,10 +45,20 @@ metadata {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void installed() {
|
def initialize() {
|
||||||
sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"LAN\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device.hub.hardwareID}\"}", displayed: false)
|
sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"LAN\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device.hub.hardwareID}\"}", displayed: false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void installed() {
|
||||||
|
log.debug "installed()"
|
||||||
|
initialize()
|
||||||
|
}
|
||||||
|
|
||||||
|
def updated() {
|
||||||
|
log.debug "updated()"
|
||||||
|
initialize()
|
||||||
|
}
|
||||||
|
|
||||||
// parse events into attributes
|
// parse events into attributes
|
||||||
def parse(description) {
|
def parse(description) {
|
||||||
log.debug "Parsing '${description}'"
|
log.debug "Parsing '${description}'"
|
||||||
|
|||||||
@@ -66,10 +66,20 @@ metadata {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void installed() {
|
def initialize() {
|
||||||
sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"LAN\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device.hub.hardwareID}\"}", displayed: false)
|
sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"LAN\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device.hub.hardwareID}\"}", displayed: false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void installed() {
|
||||||
|
log.debug "installed()"
|
||||||
|
initialize()
|
||||||
|
}
|
||||||
|
|
||||||
|
def updated() {
|
||||||
|
log.debug "updated()"
|
||||||
|
initialize()
|
||||||
|
}
|
||||||
|
|
||||||
// parse events into attributes
|
// parse events into attributes
|
||||||
def parse(description) {
|
def parse(description) {
|
||||||
log.debug "parse() - $description"
|
log.debug "parse() - $description"
|
||||||
|
|||||||
@@ -50,10 +50,19 @@ metadata {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void installed() {
|
def initialize() {
|
||||||
sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"LAN\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device.hub.hardwareID}\"}", displayed: false)
|
sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"LAN\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device.hub.hardwareID}\"}", displayed: false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void installed() {
|
||||||
|
log.debug "installed()"
|
||||||
|
initialize()
|
||||||
|
}
|
||||||
|
|
||||||
|
def updated() {
|
||||||
|
initialize()
|
||||||
|
}
|
||||||
|
|
||||||
// parse events into attributes
|
// parse events into attributes
|
||||||
def parse(description) {
|
def parse(description) {
|
||||||
log.debug "parse() - $description"
|
log.debug "parse() - $description"
|
||||||
|
|||||||
@@ -55,10 +55,20 @@ metadata {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void installed() {
|
def initialize() {
|
||||||
sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"LAN\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device.hub.hardwareID}\"}", displayed: false)
|
sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"LAN\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device.hub.hardwareID}\"}", displayed: false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void installed() {
|
||||||
|
log.debug "installed()"
|
||||||
|
initialize()
|
||||||
|
}
|
||||||
|
|
||||||
|
def updated() {
|
||||||
|
log.debug "updated()"
|
||||||
|
initialize()
|
||||||
|
}
|
||||||
|
|
||||||
// parse events into attributes
|
// parse events into attributes
|
||||||
def parse(description) {
|
def parse(description) {
|
||||||
log.debug "parse() - $description"
|
log.debug "parse() - $description"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "LIFX Color Bulb", namespace: "smartthings", author: "LIFX") {
|
definition (name: "LIFX Color Bulb", namespace: "smartthings", author: "LIFX", ocfDeviceType: "oic.d.light") {
|
||||||
capability "Actuator"
|
capability "Actuator"
|
||||||
capability "Color Control"
|
capability "Color Control"
|
||||||
capability "Color Temperature"
|
capability "Color Temperature"
|
||||||
@@ -64,8 +64,18 @@ metadata {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def initialize() {
|
||||||
|
sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"cloud\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device?.hub?.hardwareID}\"}", displayed: false)
|
||||||
|
}
|
||||||
|
|
||||||
void installed() {
|
void installed() {
|
||||||
sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"cloud\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device?.hub?.hardwareID}\"}")
|
log.debug "installed()"
|
||||||
|
initialize()
|
||||||
|
}
|
||||||
|
|
||||||
|
def updated() {
|
||||||
|
log.debug "updated()"
|
||||||
|
initialize()
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle commands
|
// handle commands
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "LIFX White Bulb", namespace: "smartthings", author: "LIFX") {
|
definition (name: "LIFX White Bulb", namespace: "smartthings", author: "LIFX", ocfDeviceType: "oic.d.light") {
|
||||||
capability "Actuator"
|
capability "Actuator"
|
||||||
capability "Color Temperature"
|
capability "Color Temperature"
|
||||||
capability "Switch"
|
capability "Switch"
|
||||||
@@ -55,8 +55,18 @@ metadata {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def initialize() {
|
||||||
|
sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"cloud\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device?.hub?.hardwareID}\"}", displayed: false)
|
||||||
|
}
|
||||||
|
|
||||||
void installed() {
|
void installed() {
|
||||||
sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"cloud\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device?.hub?.hardwareID}\"}")
|
log.debug "installed()"
|
||||||
|
initialize()
|
||||||
|
}
|
||||||
|
|
||||||
|
def updated() {
|
||||||
|
log.debug "updated()"
|
||||||
|
initialize()
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle commands
|
// handle commands
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import groovy.json.JsonOutput
|
||||||
/**
|
/**
|
||||||
* Logitech Harmony Hub
|
* Logitech Harmony Hub
|
||||||
*
|
*
|
||||||
@@ -39,14 +40,18 @@ metadata {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def initialize() {
|
||||||
|
sendEvent(name: "DeviceWatch-Enroll", value: JsonOutput.toJson([protocol: "cloud", scheme:"untracked"]), displayed: false)
|
||||||
|
}
|
||||||
|
|
||||||
def installed() {
|
def installed() {
|
||||||
log.debug "installed()"
|
log.debug "installed()"
|
||||||
sendEvent(name: "DeviceWatch-Enroll", value: JsonOutput.toJson([protocol: "cloud", scheme:"untracked"]), displayed: false)
|
initialize()
|
||||||
}
|
}
|
||||||
|
|
||||||
def updated() {
|
def updated() {
|
||||||
log.debug "updated()"
|
log.debug "updated()"
|
||||||
sendEvent(name: "DeviceWatch-Enroll", value: JsonOutput.toJson([protocol: "cloud", scheme:"untracked"]), displayed: false)
|
initialize()
|
||||||
}
|
}
|
||||||
|
|
||||||
def startActivity(String activityId) {
|
def startActivity(String activityId) {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "Open/Closed Sensor", namespace: "smartthings", author: "SmartThings") {
|
definition (name: "Open/Closed Sensor", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "x.com.st.d.sensor.contact") {
|
||||||
capability "Contact Sensor"
|
capability "Contact Sensor"
|
||||||
capability "Sensor"
|
capability "Sensor"
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "RGBW Light", namespace: "smartthings", author: "SmartThings") {
|
definition (name: "RGBW Light", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") {
|
||||||
capability "Switch Level"
|
capability "Switch Level"
|
||||||
capability "Color Control"
|
capability "Color Control"
|
||||||
capability "Color Temperature"
|
capability "Color Temperature"
|
||||||
|
|||||||
@@ -91,6 +91,11 @@ def parse(String description) {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def installed() {
|
||||||
|
// Device-Watch simply pings if no device events received for 482min(checkInterval)
|
||||||
|
sendEvent(name: "checkInterval", value: 2 * 4 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
|
}
|
||||||
|
|
||||||
def updated() {
|
def updated() {
|
||||||
// Device-Watch simply pings if no device events received for 482min(checkInterval)
|
// Device-Watch simply pings if no device events received for 482min(checkInterval)
|
||||||
sendEvent(name: "checkInterval", value: 2 * 4 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
sendEvent(name: "checkInterval", value: 2 * 4 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
//DEPRECATED - Using the generic DTH for this device. Users need to be moved before deleting this DTH
|
//DEPRECATED - Using the generic DTH for this device. Users need to be moved before deleting this DTH
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "Sylvania Ultra iQ", namespace:"smartthings", author: "SmartThings") {
|
definition (name: "Sylvania Ultra iQ", namespace:"smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") {
|
||||||
capability "Switch Level"
|
capability "Switch Level"
|
||||||
capability "Configuration"
|
capability "Configuration"
|
||||||
capability "Switch"
|
capability "Switch"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
//DEPRECATED - Using the generic DTH for this device. Users need to be moved before deleting this DTH
|
//DEPRECATED - Using the generic DTH for this device. Users need to be moved before deleting this DTH
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "WeMo Bulb", namespace: "smartthings", author: "SmartThings") {
|
definition (name: "WeMo Bulb", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") {
|
||||||
|
|
||||||
capability "Actuator"
|
capability "Actuator"
|
||||||
capability "Configuration"
|
capability "Configuration"
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ metadata {
|
|||||||
command "enrollResponse"
|
command "enrollResponse"
|
||||||
|
|
||||||
fingerprint inClusters: "0000, 0001, 0003, 0020, 0402, 0B05", outClusters: "0003, 0006, 0008, 0019", manufacturer: "OSRAM", model: "LIGHTIFY Dimming Switch", deviceJoinName: "OSRAM LIGHTIFY Dimming Switch"
|
fingerprint inClusters: "0000, 0001, 0003, 0020, 0402, 0B05", outClusters: "0003, 0006, 0008, 0019", manufacturer: "OSRAM", model: "LIGHTIFY Dimming Switch", deviceJoinName: "OSRAM LIGHTIFY Dimming Switch"
|
||||||
|
fingerprint inClusters: "0000, 0001, 0003, 0020, 0402, 0B05", outClusters: "0003, 0006, 0008, 0019", manufacturer: "CentraLite", model: "3130", deviceJoinName: "Centralite Zigbee Smart Switch"
|
||||||
//fingerprint inClusters: "0000, 0001, 0003, 0020, 0500", outClusters: "0003,0019", manufacturer: "CentraLite", model: "3455-L", deviceJoinName: "Iris Care Pendant"
|
//fingerprint inClusters: "0000, 0001, 0003, 0020, 0500", outClusters: "0003,0019", manufacturer: "CentraLite", model: "3455-L", deviceJoinName: "Iris Care Pendant"
|
||||||
fingerprint inClusters: "0000, 0001, 0003, 0007, 0020, 0402, 0B05", outClusters: "0003, 0006, 0019", manufacturer: "CentraLite", model: "3460-L", deviceJoinName: "Iris Smart Button"
|
fingerprint inClusters: "0000, 0001, 0003, 0007, 0020, 0402, 0B05", outClusters: "0003, 0006, 0019", manufacturer: "CentraLite", model: "3460-L", deviceJoinName: "Iris Smart Button"
|
||||||
fingerprint inClusters: "0000, 0001, 0003, 0007, 0020, 0B05", outClusters: "0003, 0006, 0019", manufacturer: "CentraLite", model:"3450-L", deviceJoinName: "Iris KeyFob"
|
fingerprint inClusters: "0000, 0001, 0003, 0007, 0020, 0B05", outClusters: "0003, 0006, 0019", manufacturer: "CentraLite", model:"3450-L", deviceJoinName: "Iris KeyFob"
|
||||||
@@ -251,12 +252,19 @@ def initialize() {
|
|||||||
if ((device.getDataValue("manufacturer") == "OSRAM") && (device.getDataValue("model") == "LIGHTIFY Dimming Switch")) {
|
if ((device.getDataValue("manufacturer") == "OSRAM") && (device.getDataValue("model") == "LIGHTIFY Dimming Switch")) {
|
||||||
sendEvent(name: "numberOfButtons", value: 2)
|
sendEvent(name: "numberOfButtons", value: 2)
|
||||||
}
|
}
|
||||||
else if ((device.getDataValue("manufacturer") == "CentraLite") &&
|
else if (device.getDataValue("manufacturer") == "CentraLite") {
|
||||||
((device.getDataValue("model") == "3455-L") || (device.getDataValue("model") == "3460-L"))) {
|
if (device.getDataValue("model") == "3130") {
|
||||||
sendEvent(name: "numberOfButtons", value: 1)
|
sendEvent(name: "numberOfButtons", value: 2)
|
||||||
}
|
}
|
||||||
else if ((device.getDataValue("manufacturer") == "CentraLite") && (device.getDataValue("model") == "3450-L")) {
|
else if ((device.getDataValue("model") == "3455-L") || (device.getDataValue("model") == "3460-L")) {
|
||||||
sendEvent(name: "numberOfButtons", value: 4)
|
sendEvent(name: "numberOfButtons", value: 1)
|
||||||
|
}
|
||||||
|
else if (device.getDataValue("model") == "3450-L") {
|
||||||
|
sendEvent(name: "numberOfButtons", value: 4)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sendEvent(name: "numberOfButtons", value: 4) //default case. can be changed later.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//default. can be changed
|
//default. can be changed
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "ZigBee Dimmer Power", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.switch") {
|
definition (name: "ZigBee Dimmer Power", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") {
|
||||||
capability "Actuator"
|
capability "Actuator"
|
||||||
capability "Configuration"
|
capability "Configuration"
|
||||||
capability "Refresh"
|
capability "Refresh"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "ZigBee Dimmer", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.switch") {
|
definition (name: "ZigBee Dimmer", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") {
|
||||||
capability "Actuator"
|
capability "Actuator"
|
||||||
capability "Configuration"
|
capability "Configuration"
|
||||||
capability "Refresh"
|
capability "Refresh"
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import groovy.transform.Field
|
|||||||
@Field Boolean hasConfiguredHealthCheck = false
|
@Field Boolean hasConfiguredHealthCheck = false
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "ZLL Dimmer Bulb", namespace: "smartthings", author: "SmartThings") {
|
definition (name: "ZLL Dimmer Bulb", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") {
|
||||||
|
|
||||||
capability "Actuator"
|
capability "Actuator"
|
||||||
capability "Configuration"
|
capability "Configuration"
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
import physicalgraph.zigbee.zcl.DataType
|
import physicalgraph.zigbee.zcl.DataType
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "ZLL RGB Bulb", namespace: "smartthings", author: "SmartThings") {
|
definition (name: "ZLL RGB Bulb", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") {
|
||||||
|
|
||||||
capability "Actuator"
|
capability "Actuator"
|
||||||
capability "Color Control"
|
capability "Color Control"
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
import physicalgraph.zigbee.zcl.DataType
|
import physicalgraph.zigbee.zcl.DataType
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "ZLL RGBW Bulb", namespace: "smartthings", author: "SmartThings") {
|
definition (name: "ZLL RGBW Bulb", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") {
|
||||||
|
|
||||||
capability "Actuator"
|
capability "Actuator"
|
||||||
capability "Color Control"
|
capability "Color Control"
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import groovy.transform.Field
|
|||||||
@Field Boolean hasConfiguredHealthCheck = false
|
@Field Boolean hasConfiguredHealthCheck = false
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "ZLL White Color Temperature Bulb 5000K", namespace: "smartthings", author: "SmartThings") {
|
definition (name: "ZLL White Color Temperature Bulb 5000K", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") {
|
||||||
|
|
||||||
capability "Actuator"
|
capability "Actuator"
|
||||||
capability "Color Temperature"
|
capability "Color Temperature"
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import groovy.transform.Field
|
|||||||
@Field Boolean hasConfiguredHealthCheck = false
|
@Field Boolean hasConfiguredHealthCheck = false
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "ZLL White Color Temperature Bulb", namespace: "smartthings", author: "SmartThings") {
|
definition (name: "ZLL White Color Temperature Bulb", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") {
|
||||||
|
|
||||||
capability "Actuator"
|
capability "Actuator"
|
||||||
capability "Color Temperature"
|
capability "Color Temperature"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "Z-Wave Dimmer Switch Generic", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.switch") {
|
definition (name: "Z-Wave Dimmer Switch Generic", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") {
|
||||||
capability "Switch Level"
|
capability "Switch Level"
|
||||||
capability "Actuator"
|
capability "Actuator"
|
||||||
capability "Health Check"
|
capability "Health Check"
|
||||||
@@ -78,6 +78,11 @@ 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])
|
||||||
|
}
|
||||||
|
|
||||||
def updated(){
|
def updated(){
|
||||||
// Device-Watch simply pings if no device events received for 32min(checkInterval)
|
// 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])
|
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "Z-Wave Door/Window Sensor", namespace: "smartthings", author: "SmartThings") {
|
definition (name: "Z-Wave Door/Window Sensor", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "x.com.st.d.sensor.contact") {
|
||||||
capability "Contact Sensor"
|
capability "Contact Sensor"
|
||||||
capability "Sensor"
|
capability "Sensor"
|
||||||
capability "Battery"
|
capability "Battery"
|
||||||
@@ -79,6 +79,11 @@ def parse(String description) {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def installed() {
|
||||||
|
// Device-Watch simply pings if no device events received for 482min(checkInterval)
|
||||||
|
sendEvent(name: "checkInterval", value: 2 * 4 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
|
}
|
||||||
|
|
||||||
def updated() {
|
def updated() {
|
||||||
// Device-Watch simply pings if no device events received for 482min(checkInterval)
|
// Device-Watch simply pings if no device events received for 482min(checkInterval)
|
||||||
sendEvent(name: "checkInterval", value: 2 * 4 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
sendEvent(name: "checkInterval", value: 2 * 4 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
|
|||||||
@@ -65,6 +65,11 @@ metadata {
|
|||||||
|
|
||||||
import physicalgraph.zwave.commands.barrieroperatorv1.*
|
import physicalgraph.zwave.commands.barrieroperatorv1.*
|
||||||
|
|
||||||
|
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])
|
||||||
|
}
|
||||||
|
|
||||||
def updated(){
|
def updated(){
|
||||||
// Device-Watch simply pings if no device events received for 32min(checkInterval)
|
// 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])
|
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
|
|||||||
@@ -68,6 +68,11 @@ metadata {
|
|||||||
import physicalgraph.zwave.commands.doorlockv1.*
|
import physicalgraph.zwave.commands.doorlockv1.*
|
||||||
import physicalgraph.zwave.commands.usercodev1.*
|
import physicalgraph.zwave.commands.usercodev1.*
|
||||||
|
|
||||||
|
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])
|
||||||
|
}
|
||||||
|
|
||||||
def updated() {
|
def updated() {
|
||||||
// Device-Watch simply pings if no device events received for 32min(checkInterval)
|
// 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])
|
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
|
|||||||
@@ -100,6 +100,11 @@ def parse(String description) {
|
|||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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])
|
||||||
|
}
|
||||||
|
|
||||||
def updated() {
|
def updated() {
|
||||||
// Device-Watch simply pings if no device events received for 32min(checkInterval)
|
// 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])
|
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
|
|||||||
@@ -74,6 +74,11 @@ 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])
|
||||||
|
}
|
||||||
|
|
||||||
def updated() {
|
def updated() {
|
||||||
// Device-Watch simply pings if no device events received for 32min(checkInterval)
|
// 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])
|
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "Z-Wave Motion Sensor", namespace: "smartthings", author: "SmartThings") {
|
definition (name: "Z-Wave Motion Sensor", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "x.com.st.d.sensor.motion") {
|
||||||
capability "Motion Sensor"
|
capability "Motion Sensor"
|
||||||
capability "Sensor"
|
capability "Sensor"
|
||||||
capability "Battery"
|
capability "Battery"
|
||||||
@@ -51,7 +51,12 @@ metadata {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def updated(){
|
def installed() {
|
||||||
|
// Device wakes up every 4 hours, this interval allows us to miss one wakeup notification before marking offline
|
||||||
|
sendEvent(name: "checkInterval", value: 8 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
|
}
|
||||||
|
|
||||||
|
def updated() {
|
||||||
// Device wakes up every 4 hours, this interval allows us to miss one wakeup notification before marking offline
|
// Device wakes up every 4 hours, this interval allows us to miss one wakeup notification before marking offline
|
||||||
sendEvent(name: "checkInterval", value: 8 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
sendEvent(name: "checkInterval", value: 8 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "Z-Wave Plus Door/Window Sensor", namespace: "smartthings", author: "SmartThings") {
|
definition (name: "Z-Wave Plus Door/Window Sensor", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "x.com.st.d.sensor.contact") {
|
||||||
capability "Contact Sensor"
|
capability "Contact Sensor"
|
||||||
capability "Configuration"
|
capability "Configuration"
|
||||||
capability "Battery"
|
capability "Battery"
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
.st-ignore
|
|
||||||
README.md
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
# Z-wave Siren
|
|
||||||
|
|
||||||
Cloud Execution
|
|
||||||
|
|
||||||
Works with:
|
|
||||||
|
|
||||||
* [FortrezZ Siren Strobe Alarm](https://www.smartthings.com/works-with-smartthings/other/fortrezz-water-valve)
|
|
||||||
|
|
||||||
## Table of contents
|
|
||||||
|
|
||||||
* [Capabilities](#capabilities)
|
|
||||||
* [Health](#device-health)
|
|
||||||
* [Troubleshooting](#troubleshooting)
|
|
||||||
|
|
||||||
## Capabilities
|
|
||||||
|
|
||||||
* **Actuator** - represents that a Device has commands
|
|
||||||
* **Alarm** - allows for interacting with devices that serve as alarms
|
|
||||||
* **Battery** - defines device uses a battery
|
|
||||||
* **Health Check** - indicates ability to get device health notifications
|
|
||||||
* **Polling** - represents that poll() can be implemented for the device
|
|
||||||
* **Refresh** - _refresh()_ command for status updates
|
|
||||||
* **Sensor** - detects sensor events
|
|
||||||
* **Switch** - can detect state (possible values: on/off)
|
|
||||||
|
|
||||||
## Device Health
|
|
||||||
|
|
||||||
FortrezZ Siren Strobe Alarm is polled by the hub.
|
|
||||||
As of hubCore version 0.14.38 the hub sends up reports every 15 minutes regardless of whether the state changed.
|
|
||||||
Device-Watch allows 2 check-in misses from device plus some lag time. So Check-in interval = (2*15 + 2)mins = 32 mins.
|
|
||||||
Not to mention after going OFFLINE when the device is plugged back in, it might take a considerable amount of time for
|
|
||||||
the device to appear as ONLINE again. This is because if this listening device does not respond to two poll requests in a row,
|
|
||||||
it is not polled for 5 minutes by the hub. This can delay up the process of being marked ONLINE by quite some time.
|
|
||||||
|
|
||||||
* __32min__ checkInterval
|
|
||||||
|
|
||||||
## Troubleshooting
|
|
||||||
|
|
||||||
If the device doesn't pair when trying from the SmartThings mobile app, it is possible that the device is out of range.
|
|
||||||
Pairing needs to be tried again by placing the device closer to the hub.
|
|
||||||
Instructions related to pairing, resetting and removing the device from SmartThings can be found in the following link:
|
|
||||||
* [FortrezZ Siren Strobe Alarm Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/202294760-FortrezZ-Siren-Strobe-Alarm)
|
|
||||||
@@ -20,7 +20,6 @@ metadata {
|
|||||||
capability "Actuator"
|
capability "Actuator"
|
||||||
capability "Alarm"
|
capability "Alarm"
|
||||||
capability "Battery"
|
capability "Battery"
|
||||||
capability "Health Check"
|
|
||||||
capability "Polling"
|
capability "Polling"
|
||||||
capability "Refresh"
|
capability "Refresh"
|
||||||
capability "Sensor"
|
capability "Sensor"
|
||||||
@@ -28,7 +27,6 @@ metadata {
|
|||||||
|
|
||||||
|
|
||||||
fingerprint inClusters: "0x20,0x25,0x86,0x80,0x85,0x72,0x71"
|
fingerprint inClusters: "0x20,0x25,0x86,0x80,0x85,0x72,0x71"
|
||||||
fingerprint mfr:"0084", prod:"0313", model:"010B", deviceJoinName: "FortrezZ Siren Strobe Alarm"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
simulator {
|
simulator {
|
||||||
@@ -60,11 +58,6 @@ metadata {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def updated(){
|
|
||||||
// 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])
|
|
||||||
}
|
|
||||||
|
|
||||||
def createEvents(physicalgraph.zwave.commands.batteryv1.BatteryReport cmd) {
|
def createEvents(physicalgraph.zwave.commands.batteryv1.BatteryReport cmd) {
|
||||||
def map = [ name: "battery", unit: "%" ]
|
def map = [ name: "battery", unit: "%" ]
|
||||||
if (cmd.batteryLevel == 0xFF) {
|
if (cmd.batteryLevel == 0xFF) {
|
||||||
@@ -126,13 +119,6 @@ def both() {
|
|||||||
on()
|
on()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* PING is used by Device-Watch in attempt to reach the Device
|
|
||||||
* */
|
|
||||||
def ping() {
|
|
||||||
refresh()
|
|
||||||
}
|
|
||||||
|
|
||||||
def refresh() {
|
def refresh() {
|
||||||
log.debug "sending battery refresh command"
|
log.debug "sending battery refresh command"
|
||||||
zwave.batteryV1.batteryGet().format()
|
zwave.batteryV1.batteryGet().format()
|
||||||
|
|||||||
@@ -53,7 +53,12 @@ metadata {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def updated(){
|
def installed() {
|
||||||
|
// Device checks in every hour, this interval allows us to miss one check-in notification before marking offline
|
||||||
|
sendEvent(name: "checkInterval", value: 2 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
|
}
|
||||||
|
|
||||||
|
def updated() {
|
||||||
// Device checks in every hour, this interval allows us to miss one check-in notification before marking offline
|
// Device checks in every hour, this interval allows us to miss one check-in notification before marking offline
|
||||||
sendEvent(name: "checkInterval", value: 2 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
sendEvent(name: "checkInterval", value: 2 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,6 +61,11 @@ metadata {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def installed(){
|
||||||
|
// Device-Watch simply pings if no device events received for checkInterval duration of 32min = 2 * 15min + 2min lag time
|
||||||
|
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
|
}
|
||||||
|
|
||||||
def updated(){
|
def updated(){
|
||||||
// Device-Watch simply pings if no device events received for checkInterval duration of 32min = 2 * 15min + 2min lag time
|
// Device-Watch simply pings if no device events received for checkInterval duration of 32min = 2 * 15min + 2min lag time
|
||||||
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
|
|||||||
@@ -65,6 +65,11 @@ 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])
|
||||||
|
}
|
||||||
|
|
||||||
def updated(){
|
def updated(){
|
||||||
// Device-Watch simply pings if no device events received for 32min(checkInterval)
|
// 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])
|
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
|
|||||||
@@ -124,6 +124,11 @@ 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])
|
||||||
|
}
|
||||||
|
|
||||||
def updated(){
|
def updated(){
|
||||||
// Device-Watch simply pings if no device events received for 32min(checkInterval)
|
// 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])
|
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
* Date: 2013-03-07
|
* Date: 2013-03-07
|
||||||
*/
|
*/
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "Z-Wave Virtual Momentary Contact Switch", namespace: "smartthings", author: "SmartThings") {
|
definition (name: "Z-Wave Virtual Momentary Contact Switch", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "x.com.st.d.sensor.contact") {
|
||||||
capability "Actuator"
|
capability "Actuator"
|
||||||
capability "Switch"
|
capability "Switch"
|
||||||
capability "Refresh"
|
capability "Refresh"
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "Z-Wave Water Sensor", namespace: "smartthings", author: "SmartThings") {
|
definition (name: "Z-Wave Water Sensor", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "x.com.st.d.sensor.moisture") {
|
||||||
capability "Water Sensor"
|
capability "Water Sensor"
|
||||||
capability "Sensor"
|
capability "Sensor"
|
||||||
capability "Battery"
|
capability "Battery"
|
||||||
|
|||||||
@@ -0,0 +1,568 @@
|
|||||||
|
/* TraneXL624.device.groovy
|
||||||
|
*
|
||||||
|
* Variation of the stock SmartThings "Zwave-Thermostat" & Better-Thermostat by todd@wackford.net
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Original Modified Code:
|
||||||
|
* twack@wackware.net
|
||||||
|
* 20140209
|
||||||
|
*
|
||||||
|
* Modified to add Humidity & Clock Set
|
||||||
|
* Justin Waymire
|
||||||
|
* justin@waymirenet.com
|
||||||
|
* 04-01-15
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
metadata {
|
||||||
|
// Automatically generated. Make future change here.
|
||||||
|
definition (name: "Trane XL624 Thermostat", author: "justin@waymirenet.com") {
|
||||||
|
capability "Relative Humidity Measurement"
|
||||||
|
capability "Temperature Measurement"
|
||||||
|
capability "Refresh"
|
||||||
|
capability "Thermostat"
|
||||||
|
capability "Configuration"
|
||||||
|
capability "Polling"
|
||||||
|
|
||||||
|
command "heatLevelUp"
|
||||||
|
command "heatLevelDown"
|
||||||
|
command "coolLevelUp"
|
||||||
|
command "coolLevelDown"
|
||||||
|
command "switchMode"
|
||||||
|
command "switchFanMode"
|
||||||
|
}
|
||||||
|
|
||||||
|
// simulator metadata
|
||||||
|
simulator {
|
||||||
|
status "off" : "command: 4003, payload: 00"
|
||||||
|
status "heat" : "command: 4003, payload: 01"
|
||||||
|
status "cool" : "command: 4003, payload: 02"
|
||||||
|
status "auto" : "command: 4003, payload: 03"
|
||||||
|
status "emergencyHeat" : "command: 4003, payload: 04"
|
||||||
|
|
||||||
|
status "fanAuto" : "command: 4403, payload: 00"
|
||||||
|
status "fanOn" : "command: 4403, payload: 01"
|
||||||
|
status "fanCirculate" : "command: 4403, payload: 06"
|
||||||
|
|
||||||
|
status "heat 60" : "command: 4303, payload: 01 01 3C"
|
||||||
|
status "heat 68" : "command: 4303, payload: 01 01 44"
|
||||||
|
status "heat 72" : "command: 4303, payload: 01 01 48"
|
||||||
|
|
||||||
|
status "cool 72" : "command: 4303, payload: 02 01 48"
|
||||||
|
status "cool 76" : "command: 4303, payload: 02 01 4C"
|
||||||
|
status "cool 80" : "command: 4303, payload: 02 01 50"
|
||||||
|
|
||||||
|
status "temp 58" : "command: 3105, payload: 01 22 02 44"
|
||||||
|
status "temp 62" : "command: 3105, payload: 01 22 02 6C"
|
||||||
|
status "temp 70" : "command: 3105, payload: 01 22 02 BC"
|
||||||
|
status "temp 74" : "command: 3105, payload: 01 22 02 E4"
|
||||||
|
status "temp 78" : "command: 3105, payload: 01 22 03 0C"
|
||||||
|
status "temp 82" : "command: 3105, payload: 01 22 03 34"
|
||||||
|
|
||||||
|
status "idle" : "command: 4203, payload: 00"
|
||||||
|
status "heating" : "command: 4203, payload: 01"
|
||||||
|
status "cooling" : "command: 4203, payload: 02"
|
||||||
|
status "fan only" : "command: 4203, payload: 03"
|
||||||
|
status "pending heat" : "command: 4203, payload: 04"
|
||||||
|
status "pending cool" : "command: 4203, payload: 05"
|
||||||
|
status "vent economizer": "command: 4203, payload: 06"
|
||||||
|
|
||||||
|
// reply messages
|
||||||
|
reply "2502": "command: 2503, payload: FF"
|
||||||
|
}
|
||||||
|
|
||||||
|
tiles {
|
||||||
|
valueTile("temperature", "device.temperature", width: 2, height: 2) {
|
||||||
|
state("temperature", label:'${currentValue}°', unit:'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("humidity", "device.humidity", inactiveLabel: false, decoration: "flat") {
|
||||||
|
state "humidity", label:'Humidity ${currentValue}%', backgroundColor:"#ffffff"
|
||||||
|
}
|
||||||
|
standardTile("mode", "device.thermostatMode", inactiveLabel: false, decoration: "flat") {
|
||||||
|
state "off", label:'', action:"switchMode", icon:"st.thermostat.heating-cooling-off"
|
||||||
|
state "heat", label:'', action:"switchMode", icon:"st.thermostat.heat"
|
||||||
|
state "emergencyHeat", label:'', action:"switchMode", icon:"st.thermostat.emergency-heat"
|
||||||
|
state "cool", label:'', action:"switchMode", icon:"st.thermostat.cool"
|
||||||
|
state "auto", label:'', action:"switchMode", icon:"st.thermostat.auto"
|
||||||
|
}
|
||||||
|
standardTile("fanMode", "device.thermostatFanMode", inactiveLabel: false, decoration: "flat") {
|
||||||
|
state "fanAuto", label:'', action:"switchFanMode", icon:"st.thermostat.fan-auto"
|
||||||
|
state "fanOn", label:'', action:"switchFanMode", icon:"st.thermostat.fan-on"
|
||||||
|
state "fanCirculate", label:' ', action:"switchFanMode", icon:"st.thermostat.fan-circulate"
|
||||||
|
}
|
||||||
|
valueTile("heatingSetpoint", "device.heatingSetpoint", inactiveLabel: false, decoration: "flat") {
|
||||||
|
state "heat", label:'${currentValue}° heat', unit:"F", backgroundColor:"#ffffff"
|
||||||
|
}
|
||||||
|
valueTile("coolingSetpoint", "device.coolingSetpoint", inactiveLabel: false, decoration: "flat") {
|
||||||
|
state "cool", label:'${currentValue}° cool', unit:"F", backgroundColor:"#ffffff"
|
||||||
|
}
|
||||||
|
standardTile("refresh", "device.thermostatMode", inactiveLabel: false, decoration: "flat") {
|
||||||
|
state "default", action:"polling.poll", icon:"st.secondary.refresh"
|
||||||
|
}
|
||||||
|
standardTile("configure", "device.configure", inactiveLabel: false, decoration: "flat") {
|
||||||
|
state "configure", label:' ', action:"configuration.configure", icon:"st.secondary.configure"
|
||||||
|
}
|
||||||
|
standardTile("heatLevelUp", "device.heatingSetpoint", canChangeIcon: false, inactiveLabel: false, decoration: "flat") {
|
||||||
|
state "heatLevelUp", label:' ', action:"heatLevelUp", icon:"st.thermostat.thermostat-up"
|
||||||
|
}
|
||||||
|
standardTile("heatLevelDown", "device.heatingSetpoint", canChangeIcon: false, inactiveLabel: false, decoration: "flat") {
|
||||||
|
state "heatLevelDown", label:' ', action:"heatLevelDown", icon:"st.thermostat.thermostat-down"
|
||||||
|
}
|
||||||
|
standardTile("coolLevelUp", "device.heatingSetpoint", canChangeIcon: false, inactiveLabel: false, decoration: "flat") {
|
||||||
|
state "coolLevelUp", label:' ', action:"coolLevelUp", icon:"st.thermostat.thermostat-up"
|
||||||
|
}
|
||||||
|
standardTile("coolLevelDown", "device.heatingSetpoint", canChangeIcon: false, inactiveLabel: false, decoration: "flat") {
|
||||||
|
state "coolLevelDown", label:' ', action:"coolLevelDown", icon:"st.thermostat.thermostat-down"
|
||||||
|
}
|
||||||
|
|
||||||
|
main (["temperature", "humidity"])
|
||||||
|
details(["temperature", "humidity", "mode", "heatLevelDown", "heatingSetpoint", "heatLevelUp", "coolLevelDown", "coolingSetpoint", "coolLevelUp", "refresh", "configure"])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def coolLevelUp(){
|
||||||
|
int nextLevel = device.currentValue("coolingSetpoint") + 1
|
||||||
|
|
||||||
|
if( nextLevel > 99){
|
||||||
|
nextLevel = 99
|
||||||
|
}
|
||||||
|
log.debug "Setting cool set point up to: ${nextLevel}"
|
||||||
|
setCoolingSetpoint(nextLevel)
|
||||||
|
}
|
||||||
|
|
||||||
|
def coolLevelDown(){
|
||||||
|
int nextLevel = device.currentValue("coolingSetpoint") - 1
|
||||||
|
|
||||||
|
if( nextLevel < 50){
|
||||||
|
nextLevel = 50
|
||||||
|
}
|
||||||
|
log.debug "Setting cool set point down to: ${nextLevel}"
|
||||||
|
setCoolingSetpoint(nextLevel)
|
||||||
|
}
|
||||||
|
|
||||||
|
def heatLevelUp(){
|
||||||
|
int nextLevel = device.currentValue("heatingSetpoint") + 1
|
||||||
|
|
||||||
|
if( nextLevel > 90){
|
||||||
|
nextLevel = 90
|
||||||
|
}
|
||||||
|
log.debug "Setting heat set point up to: ${nextLevel}"
|
||||||
|
setHeatingSetpoint(nextLevel)
|
||||||
|
}
|
||||||
|
|
||||||
|
def heatLevelDown(){
|
||||||
|
int nextLevel = device.currentValue("heatingSetpoint") - 1
|
||||||
|
|
||||||
|
if( nextLevel < 40){
|
||||||
|
nextLevel = 40
|
||||||
|
}
|
||||||
|
log.debug "Setting heat set point down to: ${nextLevel}"
|
||||||
|
setHeatingSetpoint(nextLevel)
|
||||||
|
}
|
||||||
|
|
||||||
|
def parse(String description)
|
||||||
|
{
|
||||||
|
def map = createEvent(zwaveEvent(zwave.parse(description, [0x42:1, 0x43:2, 0x31: 3])))
|
||||||
|
if (!map) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
def result = [map]
|
||||||
|
if (map.isStateChange && map.name in ["heatingSetpoint","coolingSetpoint","thermostatMode"]) {
|
||||||
|
def map2 = [
|
||||||
|
name: "thermostatSetpoint",
|
||||||
|
unit: "F"
|
||||||
|
]
|
||||||
|
if (map.name == "thermostatMode") {
|
||||||
|
updateState("lastTriedMode", map.value)
|
||||||
|
if (map.value == "cool") {
|
||||||
|
map2.value = device.latestValue("coolingSetpoint")
|
||||||
|
log.info "THERMOSTAT, latest cooling setpoint = ${map2.value}"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
map2.value = device.latestValue("heatingSetpoint")
|
||||||
|
log.info "THERMOSTAT, latest heating setpoint = ${map2.value}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
def mode = device.latestValue("thermostatMode")
|
||||||
|
log.info "THERMOSTAT, latest mode = ${mode}"
|
||||||
|
if ((map.name == "heatingSetpoint" && mode == "heat") || (map.name == "coolingSetpoint" && mode == "cool")) {
|
||||||
|
map2.value = map.value
|
||||||
|
map2.unit = map.unit
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (map2.value != null) {
|
||||||
|
log.debug "THERMOSTAT, adding setpoint event: $map"
|
||||||
|
result << createEvent(map2)
|
||||||
|
}
|
||||||
|
} else if (map.name == "thermostatFanMode" && map.isStateChange) {
|
||||||
|
updateState("lastTriedFanMode", map.value)
|
||||||
|
}
|
||||||
|
log.debug "Parse returned $result"
|
||||||
|
result
|
||||||
|
}
|
||||||
|
|
||||||
|
// Event Generation
|
||||||
|
def zwaveEvent(physicalgraph.zwave.commands.thermostatsetpointv2.ThermostatSetpointReport cmd)
|
||||||
|
{
|
||||||
|
def map = [:]
|
||||||
|
map.value = cmd.scaledValue.toString()
|
||||||
|
map.unit = cmd.scale == 1 ? "F" : "C"
|
||||||
|
map.displayed = false
|
||||||
|
switch (cmd.setpointType) {
|
||||||
|
case 1:
|
||||||
|
map.name = "heatingSetpoint"
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
map.name = "coolingSetpoint"
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return [:]
|
||||||
|
}
|
||||||
|
// So we can respond with same format
|
||||||
|
state.size = cmd.size
|
||||||
|
state.scale = cmd.scale
|
||||||
|
state.precision = cmd.precision
|
||||||
|
map
|
||||||
|
}
|
||||||
|
|
||||||
|
def zwaveEvent(physicalgraph.zwave.commands.sensormultilevelv3.SensorMultilevelReport cmd)
|
||||||
|
{
|
||||||
|
def map = [:]
|
||||||
|
switch (cmd.sensorType) {
|
||||||
|
case 1:
|
||||||
|
// temperature
|
||||||
|
map.value = cmd.scaledSensorValue.toString()
|
||||||
|
map.unit = cmd.scale == 1 ? "F" : "C"
|
||||||
|
map.name = "temperature"
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
// humidity
|
||||||
|
map.value = cmd.scaledSensorValue.toInteger().toString()
|
||||||
|
map.unit = "%"
|
||||||
|
map.name = "humidity"
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
map
|
||||||
|
}
|
||||||
|
|
||||||
|
def zwaveEvent(physicalgraph.zwave.commands.thermostatoperatingstatev1.ThermostatOperatingStateReport cmd)
|
||||||
|
{
|
||||||
|
def map = [:]
|
||||||
|
switch (cmd.operatingState) {
|
||||||
|
case physicalgraph.zwave.commands.thermostatoperatingstatev1.ThermostatOperatingStateReport.OPERATING_STATE_IDLE:
|
||||||
|
map.value = "idle"
|
||||||
|
break
|
||||||
|
case physicalgraph.zwave.commands.thermostatoperatingstatev1.ThermostatOperatingStateReport.OPERATING_STATE_HEATING:
|
||||||
|
map.value = "heating"
|
||||||
|
break
|
||||||
|
case physicalgraph.zwave.commands.thermostatoperatingstatev1.ThermostatOperatingStateReport.OPERATING_STATE_COOLING:
|
||||||
|
map.value = "cooling"
|
||||||
|
break
|
||||||
|
case physicalgraph.zwave.commands.thermostatoperatingstatev1.ThermostatOperatingStateReport.OPERATING_STATE_FAN_ONLY:
|
||||||
|
map.value = "fan only"
|
||||||
|
break
|
||||||
|
case physicalgraph.zwave.commands.thermostatoperatingstatev1.ThermostatOperatingStateReport.OPERATING_STATE_PENDING_HEAT:
|
||||||
|
map.value = "pending heat"
|
||||||
|
break
|
||||||
|
case physicalgraph.zwave.commands.thermostatoperatingstatev1.ThermostatOperatingStateReport.OPERATING_STATE_PENDING_COOL:
|
||||||
|
map.value = "pending cool"
|
||||||
|
break
|
||||||
|
case physicalgraph.zwave.commands.thermostatoperatingstatev1.ThermostatOperatingStateReport.OPERATING_STATE_VENT_ECONOMIZER:
|
||||||
|
map.value = "vent economizer"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
map.name = "thermostatOperatingState"
|
||||||
|
map
|
||||||
|
}
|
||||||
|
|
||||||
|
def zwaveEvent(physicalgraph.zwave.commands.thermostatmodev2.ThermostatModeReport cmd) {
|
||||||
|
def map = [:]
|
||||||
|
switch (cmd.mode) {
|
||||||
|
case physicalgraph.zwave.commands.thermostatmodev2.ThermostatModeReport.MODE_OFF:
|
||||||
|
map.value = "off"
|
||||||
|
break
|
||||||
|
case physicalgraph.zwave.commands.thermostatmodev2.ThermostatModeReport.MODE_HEAT:
|
||||||
|
map.value = "heat"
|
||||||
|
break
|
||||||
|
case physicalgraph.zwave.commands.thermostatmodev2.ThermostatModeReport.MODE_AUXILIARY_HEAT:
|
||||||
|
map.value = "emergencyHeat"
|
||||||
|
break
|
||||||
|
case physicalgraph.zwave.commands.thermostatmodev2.ThermostatModeReport.MODE_COOL:
|
||||||
|
map.value = "cool"
|
||||||
|
break
|
||||||
|
case physicalgraph.zwave.commands.thermostatmodev2.ThermostatModeReport.MODE_AUTO:
|
||||||
|
map.value = "auto"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
map.name = "thermostatMode"
|
||||||
|
map
|
||||||
|
}
|
||||||
|
|
||||||
|
def zwaveEvent(physicalgraph.zwave.commands.thermostatfanmodev3.ThermostatFanModeReport cmd) {
|
||||||
|
def map = [:]
|
||||||
|
switch (cmd.fanMode) {
|
||||||
|
case physicalgraph.zwave.commands.thermostatfanmodev3.ThermostatFanModeReport.FAN_MODE_AUTO_LOW:
|
||||||
|
map.value = "fanAuto"
|
||||||
|
break
|
||||||
|
case physicalgraph.zwave.commands.thermostatfanmodev3.ThermostatFanModeReport.FAN_MODE_LOW:
|
||||||
|
map.value = "fanOn"
|
||||||
|
break
|
||||||
|
case physicalgraph.zwave.commands.thermostatfanmodev3.ThermostatFanModeReport.FAN_MODE_CIRCULATION:
|
||||||
|
map.value = "fanCirculate"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
map.name = "thermostatFanMode"
|
||||||
|
map.displayed = false
|
||||||
|
map
|
||||||
|
}
|
||||||
|
|
||||||
|
def zwaveEvent(physicalgraph.zwave.commands.thermostatmodev2.ThermostatModeSupportedReport cmd) {
|
||||||
|
def supportedModes = ""
|
||||||
|
if(cmd.off) { supportedModes += "off " }
|
||||||
|
if(cmd.heat) { supportedModes += "heat " }
|
||||||
|
if(cmd.auxiliaryemergencyHeat) { supportedModes += "emergencyHeat " }
|
||||||
|
if(cmd.cool) { supportedModes += "cool " }
|
||||||
|
if(cmd.auto) { supportedModes += "auto " }
|
||||||
|
|
||||||
|
updateState("supportedModes", supportedModes)
|
||||||
|
}
|
||||||
|
|
||||||
|
def zwaveEvent(physicalgraph.zwave.commands.thermostatfanmodev3.ThermostatFanModeSupportedReport cmd) {
|
||||||
|
def supportedFanModes = ""
|
||||||
|
if(cmd.auto) { supportedFanModes += "fanAuto " }
|
||||||
|
if(cmd.low) { supportedFanModes += "fanOn " }
|
||||||
|
if(cmd.circulation) { supportedFanModes += "fanCirculate " }
|
||||||
|
|
||||||
|
updateState("supportedFanModes", supportedFanModes)
|
||||||
|
}
|
||||||
|
|
||||||
|
def updateState(String name, String value) {
|
||||||
|
state[name] = value
|
||||||
|
device.updateDataValue(name, value)
|
||||||
|
}
|
||||||
|
|
||||||
|
def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicReport cmd) {
|
||||||
|
log.debug "Zwave event received: $cmd"
|
||||||
|
}
|
||||||
|
|
||||||
|
def zwaveEvent(physicalgraph.zwave.Command cmd) {
|
||||||
|
log.warn "Unexpected zwave command $cmd"
|
||||||
|
}
|
||||||
|
|
||||||
|
// Command Implementations
|
||||||
|
def poll() {
|
||||||
|
delayBetween([
|
||||||
|
zwave.sensorMultilevelV3.sensorMultilevelGet().format(), // current temperature
|
||||||
|
zwave.thermostatSetpointV1.thermostatSetpointGet(setpointType: 1).format(),
|
||||||
|
zwave.thermostatSetpointV1.thermostatSetpointGet(setpointType: 2).format(),
|
||||||
|
zwave.thermostatModeV2.thermostatModeGet().format(),
|
||||||
|
zwave.thermostatFanModeV3.thermostatFanModeGet().format(),
|
||||||
|
zwave.thermostatOperatingStateV1.thermostatOperatingStateGet().format(),
|
||||||
|
setClock()
|
||||||
|
], 2300)
|
||||||
|
}
|
||||||
|
|
||||||
|
private setClock() { //once a day
|
||||||
|
def nowTime = new Date().time
|
||||||
|
def ageInMinutes = state.lastClockSet ? (nowTime - state.lastClockSet)/60000 : 1440
|
||||||
|
log.debug "Clock set age: ${ageInMinutes} minutes"
|
||||||
|
if (ageInMinutes >= 1440) {
|
||||||
|
log.debug "Setting clock"
|
||||||
|
state.lastClockSet = nowTime
|
||||||
|
def nowCal = Calendar.getInstance(TimeZone.getTimeZone("America/Chicago"));
|
||||||
|
zwave.clockV1.clockSet(hour: nowCal.get(Calendar.HOUR_OF_DAY), minute: nowCal.get(Calendar.MINUTE), weekday: nowCal.get(Calendar.DAY_OF_WEEK)).format()
|
||||||
|
} else "delay 87"
|
||||||
|
}
|
||||||
|
|
||||||
|
def setHeatingSetpoint(degreesF) {
|
||||||
|
setHeatingSetpoint(degreesF.toDouble())
|
||||||
|
}
|
||||||
|
|
||||||
|
def setHeatingSetpoint(Double degreesF) {
|
||||||
|
def p = (state.precision == null) ? 1 : state.precision
|
||||||
|
delayBetween([
|
||||||
|
zwave.thermostatSetpointV1.thermostatSetpointSet(setpointType: 1, scale: 1, precision: p, scaledValue: degreesF).format(),
|
||||||
|
zwave.thermostatSetpointV1.thermostatSetpointGet(setpointType: 1).format()
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
def setCoolingSetpoint(degreesF) {
|
||||||
|
setCoolingSetpoint(degreesF.toDouble())
|
||||||
|
}
|
||||||
|
|
||||||
|
def setCoolingSetpoint(Double degreesF) {
|
||||||
|
def p = (state.precision == null) ? 1 : state.precision
|
||||||
|
delayBetween([
|
||||||
|
zwave.thermostatSetpointV1.thermostatSetpointSet(setpointType: 2, scale: 1, precision: p, scaledValue: degreesF).format(),
|
||||||
|
zwave.thermostatSetpointV1.thermostatSetpointGet(setpointType: 2).format()
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
def configure() {
|
||||||
|
delayBetween([
|
||||||
|
zwave.thermostatModeV2.thermostatModeSupportedGet().format(),
|
||||||
|
zwave.thermostatFanModeV3.thermostatFanModeSupportedGet().format(),
|
||||||
|
zwave.associationV1.associationSet(groupingIdentifier:1, nodeId:[zwaveHubNodeId]).format()
|
||||||
|
], 2300)
|
||||||
|
}
|
||||||
|
|
||||||
|
def modes() {
|
||||||
|
["off", "auto", "emergencyHeat", "heat", "cool"]
|
||||||
|
}
|
||||||
|
|
||||||
|
def switchMode() {
|
||||||
|
def currentMode = device.currentState("thermostatMode")?.value
|
||||||
|
def lastTriedMode = getDataByName("lastTriedMode") ?: currentMode ?: "off"
|
||||||
|
def supportedModes = getDataByName("supportedModes")
|
||||||
|
def modeOrder = modes()
|
||||||
|
def next = { modeOrder[modeOrder.indexOf(it) + 1] ?: modeOrder[0] }
|
||||||
|
def nextMode = next(lastTriedMode)
|
||||||
|
if (supportedModes?.contains(currentMode)) {
|
||||||
|
while (!supportedModes.contains(nextMode) && nextMode != "off") {
|
||||||
|
nextMode = next(nextMode)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log.debug "Switching to mode: ${nextMode}"
|
||||||
|
switchToMode(nextMode)
|
||||||
|
}
|
||||||
|
|
||||||
|
def switchToMode(nextMode) {
|
||||||
|
def supportedModes = getDataByName("supportedModes")
|
||||||
|
if(supportedModes && !supportedModes.contains(nextMode)) log.warn "thermostat mode '$nextMode' is not supported"
|
||||||
|
if (nextMode in modes()) {
|
||||||
|
updateState("lastTriedMode", nextMode)
|
||||||
|
return "$nextMode"()
|
||||||
|
} else {
|
||||||
|
log.debug("no mode method '$nextMode'")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def switchFanMode() {
|
||||||
|
def currentMode = device.currentState("thermostatFanMode")?.value
|
||||||
|
def lastTriedMode = getDataByName("lastTriedFanMode") ?: currentMode ?: "off"
|
||||||
|
def supportedModes = getDataByName("supportedFanModes") ?: "fanAuto fanOn"
|
||||||
|
def modeOrder = ["fanAuto", "fanCirculate", "fanOn"]
|
||||||
|
def next = { modeOrder[modeOrder.indexOf(it) + 1] ?: modeOrder[0] }
|
||||||
|
def nextMode = next(lastTriedMode)
|
||||||
|
while (!supportedModes?.contains(nextMode) && nextMode != "fanAuto") {
|
||||||
|
nextMode = next(nextMode)
|
||||||
|
}
|
||||||
|
switchToFanMode(nextMode)
|
||||||
|
}
|
||||||
|
|
||||||
|
def switchToFanMode(nextMode) {
|
||||||
|
def supportedFanModes = getDataByName("supportedFanModes")
|
||||||
|
if(supportedFanModes && !supportedFanModes.contains(nextMode)) log.warn "thermostat mode '$nextMode' is not supported"
|
||||||
|
|
||||||
|
def returnCommand
|
||||||
|
if (nextMode == "fanAuto") {
|
||||||
|
returnCommand = fanAuto()
|
||||||
|
} else if (nextMode == "fanOn") {
|
||||||
|
returnCommand = fanOn()
|
||||||
|
} else if (nextMode == "fanCirculate") {
|
||||||
|
returnCommand = fanCirculate()
|
||||||
|
} else {
|
||||||
|
log.debug("no fan mode '$nextMode'")
|
||||||
|
}
|
||||||
|
if(returnCommand) updateState("lastTriedFanMode", nextMode)
|
||||||
|
returnCommand
|
||||||
|
}
|
||||||
|
|
||||||
|
def getDataByName(String name) {
|
||||||
|
state[name] ?: device.getDataValue(name)
|
||||||
|
}
|
||||||
|
|
||||||
|
def getModeMap() { [
|
||||||
|
"off": 0,
|
||||||
|
"heat": 1,
|
||||||
|
"cool": 2,
|
||||||
|
"emergency heat": 4
|
||||||
|
]}
|
||||||
|
|
||||||
|
def setThermostatMode(String value) {
|
||||||
|
delayBetween([
|
||||||
|
zwave.thermostatModeV2.thermostatModeSet(mode: modeMap[value]).format(),
|
||||||
|
zwave.thermostatModeV2.thermostatModeGet().format()
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
def getFanModeMap() { [
|
||||||
|
"auto": 0,
|
||||||
|
"on": 1,
|
||||||
|
"circulate": 6
|
||||||
|
]}
|
||||||
|
|
||||||
|
def setThermostatFanMode(String value) {
|
||||||
|
delayBetween([
|
||||||
|
zwave.thermostatFanModeV3.thermostatFanModeSet(fanMode: fanModeMap[value]).format(),
|
||||||
|
zwave.thermostatFanModeV3.thermostatFanModeGet().format()
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
def off() {
|
||||||
|
delayBetween([
|
||||||
|
zwave.thermostatModeV2.thermostatModeSet(mode: 0).format(),
|
||||||
|
zwave.thermostatModeV2.thermostatModeGet().format()
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
def heat() {
|
||||||
|
delayBetween([
|
||||||
|
zwave.thermostatModeV2.thermostatModeSet(mode: 1).format(),
|
||||||
|
zwave.thermostatModeV2.thermostatModeGet().format()
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
def emergencyHeat() {
|
||||||
|
delayBetween([
|
||||||
|
zwave.thermostatModeV2.thermostatModeSet(mode: 4).format(),
|
||||||
|
zwave.thermostatModeV2.thermostatModeGet().format()
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
def cool() {
|
||||||
|
delayBetween([
|
||||||
|
zwave.thermostatModeV2.thermostatModeSet(mode: 2).format(),
|
||||||
|
zwave.thermostatModeV2.thermostatModeGet().format()
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
def auto() {
|
||||||
|
delayBetween([
|
||||||
|
zwave.thermostatModeV2.thermostatModeSet(mode: 3).format(),
|
||||||
|
zwave.thermostatModeV2.thermostatModeGet().format()
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
def fanOn() {
|
||||||
|
delayBetween([
|
||||||
|
zwave.thermostatFanModeV3.thermostatFanModeSet(fanMode: 1).format(),
|
||||||
|
zwave.thermostatFanModeV3.thermostatFanModeGet().format()
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
def fanAuto() {
|
||||||
|
delayBetween([
|
||||||
|
zwave.thermostatFanModeV3.thermostatFanModeSet(fanMode: 0).format(),
|
||||||
|
zwave.thermostatFanModeV3.thermostatFanModeGet().format()
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
def fanCirculate() {
|
||||||
|
delayBetween([
|
||||||
|
zwave.thermostatFanModeV3.thermostatFanModeSet(fanMode: 6).format(),
|
||||||
|
zwave.thermostatFanModeV3.thermostatFanModeGet().format()
|
||||||
|
])
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user