mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-19 13:20:53 +00:00
Compare commits
5 Commits
PROD_2017.
...
MSA-2023-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
535fc112de | ||
|
|
a844e85c47 | ||
|
|
60f6e9c02c | ||
|
|
8aceef9be4 | ||
|
|
a1f39849ed |
@@ -26,9 +26,7 @@ metadata {
|
|||||||
capability "Polling"
|
capability "Polling"
|
||||||
capability "Refresh"
|
capability "Refresh"
|
||||||
capability "Health Check"
|
capability "Health Check"
|
||||||
|
fingerprint manufacturer: "015D", prod: "0221", model: "251C"
|
||||||
fingerprint manufacturer: "015D", prod: "0221", model: "251C", deviceJoinName: "Show Home 2-Channel Smart Plug"
|
|
||||||
fingerprint manufacturer: "0312", prod: "B221", model: "251C", deviceJoinName: "Inovelli 2-Channel Smart Plug"
|
|
||||||
}
|
}
|
||||||
simulator {}
|
simulator {}
|
||||||
preferences {}
|
preferences {}
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ metadata {
|
|||||||
capability "Battery"
|
capability "Battery"
|
||||||
capability "Health Check"
|
capability "Health Check"
|
||||||
|
|
||||||
|
command "configureAfterSecure"
|
||||||
|
|
||||||
fingerprint deviceId: "0x0701", inClusters: "0x5E,0x86,0x72,0x59,0x85,0x73,0x71,0x84,0x80,0x30,0x31,0x70,0x98,0x7A", outClusters:"0x5A"
|
fingerprint deviceId: "0x0701", inClusters: "0x5E,0x86,0x72,0x59,0x85,0x73,0x71,0x84,0x80,0x30,0x31,0x70,0x98,0x7A", outClusters:"0x5A"
|
||||||
fingerprint mfr:"0086", prod:"0102", model:"004A", deviceJoinName: "Aeon Labs MultiSensor (Gen 5)"
|
fingerprint mfr:"0086", prod:"0102", model:"004A", deviceJoinName: "Aeon Labs MultiSensor (Gen 5)"
|
||||||
}
|
}
|
||||||
@@ -89,12 +91,12 @@ metadata {
|
|||||||
valueTile("battery", "device.battery", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
|
valueTile("battery", "device.battery", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
|
||||||
state "battery", label:'${currentValue}% battery', unit:""
|
state "battery", label:'${currentValue}% battery', unit:""
|
||||||
}
|
}
|
||||||
standardTile("configure", "device.configure", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
|
standardTile("configureAfterSecure", "device.configure", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
|
||||||
state "configure", label:'', action:"configure", icon:"st.secondary.configure"
|
state "configure", label:'', action:"configureAfterSecure", icon:"st.secondary.configure"
|
||||||
}
|
}
|
||||||
|
|
||||||
main(["motion", "temperature", "humidity", "illuminance"])
|
main(["motion", "temperature", "humidity", "illuminance"])
|
||||||
details(["motion", "temperature", "humidity", "illuminance", "battery", "configure"])
|
details(["motion", "temperature", "humidity", "illuminance", "battery", "configureAfterSecure"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,8 +131,8 @@ def zwaveEvent(physicalgraph.zwave.commands.wakeupv1.WakeUpNotification cmd)
|
|||||||
|
|
||||||
if (!isConfigured()) {
|
if (!isConfigured()) {
|
||||||
// we're still in the process of configuring a newly joined device
|
// we're still in the process of configuring a newly joined device
|
||||||
log.debug("not sending wakeUpNoMoreInformation yet: late configure")
|
log.debug("not sending wakeUpNoMoreInformation yet")
|
||||||
result += response(configure())
|
result += response(configureAfterSecure())
|
||||||
} else {
|
} else {
|
||||||
result += response(zwave.wakeUpV1.wakeUpNoMoreInformation())
|
result += response(zwave.wakeUpV1.wakeUpNoMoreInformation())
|
||||||
}
|
}
|
||||||
@@ -148,6 +150,11 @@ def zwaveEvent(physicalgraph.zwave.commands.securityv1.SecurityMessageEncapsulat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def zwaveEvent(physicalgraph.zwave.commands.securityv1.SecurityCommandsSupportedReport cmd) {
|
||||||
|
// log.debug "Received SecurityCommandsSupportedReport"
|
||||||
|
response(configureAfterSecure())
|
||||||
|
}
|
||||||
|
|
||||||
def zwaveEvent(physicalgraph.zwave.commands.batteryv1.BatteryReport cmd) {
|
def zwaveEvent(physicalgraph.zwave.commands.batteryv1.BatteryReport cmd) {
|
||||||
def map = [ name: "battery", unit: "%" ]
|
def map = [ name: "battery", unit: "%" ]
|
||||||
if (cmd.batteryLevel == 0xFF) {
|
if (cmd.batteryLevel == 0xFF) {
|
||||||
@@ -219,6 +226,36 @@ def zwaveEvent(physicalgraph.zwave.Command cmd) {
|
|||||||
createEvent(descriptionText: cmd.toString(), isStateChange: false)
|
createEvent(descriptionText: cmd.toString(), isStateChange: false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def configureAfterSecure() {
|
||||||
|
// log.debug "configureAfterSecure()"
|
||||||
|
|
||||||
|
def request = [
|
||||||
|
// send temperature, humidity, and illuminance every 8 minutes
|
||||||
|
zwave.configurationV1.configurationSet(parameterNumber: 101, size: 4, scaledConfigurationValue: 128|64|32),
|
||||||
|
zwave.configurationV1.configurationSet(parameterNumber: 111, size: 4, scaledConfigurationValue: 8*60),
|
||||||
|
|
||||||
|
// send battery every 20 hours
|
||||||
|
zwave.configurationV1.configurationSet(parameterNumber: 102, size: 4, scaledConfigurationValue: 1),
|
||||||
|
zwave.configurationV1.configurationSet(parameterNumber: 112, size: 4, scaledConfigurationValue: 20*60*60),
|
||||||
|
|
||||||
|
// send no-motion report 60 seconds after motion stops
|
||||||
|
zwave.configurationV1.configurationSet(parameterNumber: 3, size: 2, scaledConfigurationValue: 60),
|
||||||
|
|
||||||
|
// send binary sensor report instead of basic set for motion
|
||||||
|
zwave.configurationV1.configurationSet(parameterNumber: 5, size: 1, scaledConfigurationValue: 2),
|
||||||
|
|
||||||
|
// disable notification-style motion events
|
||||||
|
zwave.notificationV3.notificationSet(notificationType: 7, notificationStatus: 0),
|
||||||
|
|
||||||
|
zwave.batteryV1.batteryGet(),
|
||||||
|
zwave.sensorBinaryV2.sensorBinaryGet(sensorType:0x0C)
|
||||||
|
]
|
||||||
|
|
||||||
|
setConfigured()
|
||||||
|
|
||||||
|
secureSequence(request) + ["delay 20000", zwave.wakeUpV1.wakeUpNoMoreInformation().format()]
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PING is used by Device-Watch in attempt to reach the Device
|
* PING is used by Device-Watch in attempt to reach the Device
|
||||||
* */
|
* */
|
||||||
@@ -228,36 +265,7 @@ def ping() {
|
|||||||
|
|
||||||
def configure() {
|
def configure() {
|
||||||
// log.debug "configure()"
|
// log.debug "configure()"
|
||||||
def request = []
|
//["delay 30000"] + secure(zwave.securityV1.securityCommandsSupportedGet())
|
||||||
// send temperature, humidity, and illuminance every 8 minutes
|
|
||||||
request << zwave.configurationV1.configurationSet(parameterNumber: 101, size: 4, scaledConfigurationValue: 128|64|32)
|
|
||||||
request << zwave.configurationV1.configurationSet(parameterNumber: 111, size: 4, scaledConfigurationValue: 8*60)
|
|
||||||
|
|
||||||
// send battery every 20 hours
|
|
||||||
request << zwave.configurationV1.configurationSet(parameterNumber: 102, size: 4, scaledConfigurationValue: 1)
|
|
||||||
request << zwave.configurationV1.configurationSet(parameterNumber: 112, size: 4, scaledConfigurationValue: 20*60*60)
|
|
||||||
|
|
||||||
// send no-motion report 60 seconds after motion stops
|
|
||||||
request << zwave.configurationV1.configurationSet(parameterNumber: 3, size: 2, scaledConfigurationValue: 60)
|
|
||||||
|
|
||||||
// send binary sensor report instead of basic set for motion
|
|
||||||
request << zwave.configurationV1.configurationSet(parameterNumber: 5, size: 1, scaledConfigurationValue: 2)
|
|
||||||
|
|
||||||
// Turn on the Multisensor Gen5 PIR sensor
|
|
||||||
request << zwave.configurationV1.configurationSet(parameterNumber: 4, size: 1, scaledConfigurationValue: 1)
|
|
||||||
|
|
||||||
// disable notification-style motion events
|
|
||||||
request << zwave.notificationV3.notificationSet(notificationType: 7, notificationStatus: 0)
|
|
||||||
|
|
||||||
request << zwave.batteryV1.batteryGet()
|
|
||||||
request << zwave.sensorBinaryV2.sensorBinaryGet(sensorType: 0x0C) //motion
|
|
||||||
request << zwave.sensorMultilevelV5.sensorMultilevelGet(sensorType: 0x01) //temperature
|
|
||||||
request << zwave.sensorMultilevelV5.sensorMultilevelGet(sensorType: 0x03) //illuminance
|
|
||||||
request << zwave.sensorMultilevelV5.sensorMultilevelGet(sensorType: 0x05) //humidity
|
|
||||||
|
|
||||||
setConfigured()
|
|
||||||
|
|
||||||
secureSequence(request) + ["delay 20000", zwave.wakeUpV1.wakeUpNoMoreInformation().format()]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private setConfigured() {
|
private setConfigured() {
|
||||||
|
|||||||
@@ -108,11 +108,20 @@ def updated(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def getCommandClassVersions() {
|
||||||
|
[
|
||||||
|
0x20: 1, // Basic
|
||||||
|
0x26: 1, // SwitchMultilevel
|
||||||
|
0x56: 1, // Crc16Encap
|
||||||
|
0x70: 1, // Configuration
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
def parse(String description) {
|
def parse(String description) {
|
||||||
def result = null
|
def result = null
|
||||||
if (description != "updated") {
|
if (description != "updated") {
|
||||||
log.debug "parse() >> zwave.parse($description)"
|
log.debug "parse() >> zwave.parse($description)"
|
||||||
def cmd = zwave.parse(description, [0x20: 1, 0x26: 1, 0x70: 1])
|
def cmd = zwave.parse(description, commandClassVersions)
|
||||||
if (cmd) {
|
if (cmd) {
|
||||||
result = zwaveEvent(cmd)
|
result = zwaveEvent(cmd)
|
||||||
}
|
}
|
||||||
@@ -179,6 +188,16 @@ def zwaveEvent(physicalgraph.zwave.commands.switchmultilevelv1.SwitchMultilevelS
|
|||||||
[createEvent(name:"switch", value:"on"), response(zwave.switchMultilevelV1.switchMultilevelGet().format())]
|
[createEvent(name:"switch", value:"on"), response(zwave.switchMultilevelV1.switchMultilevelGet().format())]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def zwaveEvent(physicalgraph.zwave.commands.crc16encapv1.Crc16Encap cmd) {
|
||||||
|
def versions = commandClassVersions
|
||||||
|
def version = versions[cmd.commandClass as Integer]
|
||||||
|
def ccObj = version ? zwave.commandClass(cmd.commandClass, version) : zwave.commandClass(cmd.commandClass)
|
||||||
|
def encapsulatedCommand = ccObj?.command(cmd.command)?.parse(cmd.data)
|
||||||
|
if (encapsulatedCommand) {
|
||||||
|
zwaveEvent(encapsulatedCommand)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def zwaveEvent(physicalgraph.zwave.Command cmd) {
|
def zwaveEvent(physicalgraph.zwave.Command cmd) {
|
||||||
// Handles all Z-Wave commands we aren't interested in
|
// Handles all Z-Wave commands we aren't interested in
|
||||||
[:]
|
[:]
|
||||||
|
|||||||
@@ -103,12 +103,12 @@ def parse(String description) {
|
|||||||
|
|
||||||
if (zigbeeMap?.clusterInt == COLOR_CONTROL_CLUSTER) {
|
if (zigbeeMap?.clusterInt == COLOR_CONTROL_CLUSTER) {
|
||||||
if(zigbeeMap.attrInt == ATTRIBUTE_HUE){ //Hue Attribute
|
if(zigbeeMap.attrInt == ATTRIBUTE_HUE){ //Hue Attribute
|
||||||
state.hueValue = Math.round(zigbee.convertHexToInt(zigbeeMap.value) / 0xfe * 100)
|
def hueValue = Math.round(zigbee.convertHexToInt(zigbeeMap.value) / 0xfe * 100)
|
||||||
runIn(5, updateColor, [overwrite: true])
|
sendEvent(name: "hue", value: hueValue, descriptionText: "Color has changed")
|
||||||
}
|
}
|
||||||
else if(zigbeeMap.attrInt == ATTRIBUTE_SATURATION){ //Saturation Attribute
|
else if(zigbeeMap.attrInt == ATTRIBUTE_SATURATION){ //Saturation Attribute
|
||||||
state.saturationValue = Math.round(zigbee.convertHexToInt(zigbeeMap.value) / 0xfe * 100)
|
def saturationValue = Math.round(zigbee.convertHexToInt(zigbeeMap.value) / 0xfe * 100)
|
||||||
runIn(5, updateColor, [overwrite: true])
|
sendEvent(name: "saturation", value: saturationValue, descriptionText: "Color has changed", displayed: false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (cluster && cluster.clusterId == 0x0006 && cluster.command == 0x07) {
|
else if (cluster && cluster.clusterId == 0x0006 && cluster.command == 0x07) {
|
||||||
@@ -127,11 +127,6 @@ def parse(String description) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def updateColor() {
|
|
||||||
sendEvent(name: "hue", value: state.hueValue, descriptionText: "Color has changed")
|
|
||||||
sendEvent(name: "saturation", value: state.saturationValue, descriptionText: "Color has changed", displayed: false)
|
|
||||||
}
|
|
||||||
|
|
||||||
def on() {
|
def on() {
|
||||||
zigbee.on()
|
zigbee.on()
|
||||||
}
|
}
|
||||||
@@ -209,9 +204,9 @@ def setColor(value){
|
|||||||
log.trace "setColor($value)"
|
log.trace "setColor($value)"
|
||||||
zigbee.on() +
|
zigbee.on() +
|
||||||
zigbee.command(COLOR_CONTROL_CLUSTER, MOVE_TO_HUE_AND_SATURATION_COMMAND,
|
zigbee.command(COLOR_CONTROL_CLUSTER, MOVE_TO_HUE_AND_SATURATION_COMMAND,
|
||||||
getScaledHue(value.hue), getScaledSaturation(value.saturation), "0000") +
|
getScaledHue(value.hue), getScaledSaturation(value.saturation), "0000") +
|
||||||
zigbee.readAttribute(COLOR_CONTROL_CLUSTER, ATTRIBUTE_SATURATION) +
|
zigbee.readAttribute(COLOR_CONTROL_CLUSTER, ATTRIBUTE_HUE) +
|
||||||
zigbee.readAttribute(COLOR_CONTROL_CLUSTER, ATTRIBUTE_HUE)
|
zigbee.readAttribute(COLOR_CONTROL_CLUSTER, ATTRIBUTE_SATURATION)
|
||||||
}
|
}
|
||||||
|
|
||||||
def setHue(value) {
|
def setHue(value) {
|
||||||
|
|||||||
@@ -88,11 +88,20 @@ def updated(){
|
|||||||
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])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def getCommandClassVersions() {
|
||||||
|
[
|
||||||
|
0x20: 1, // Basic
|
||||||
|
0x26: 1, // SwitchMultilevel
|
||||||
|
0x56: 1, // Crc16Encap
|
||||||
|
0x70: 1, // Configuration
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
def parse(String description) {
|
def parse(String description) {
|
||||||
def result = null
|
def result = null
|
||||||
if (description != "updated") {
|
if (description != "updated") {
|
||||||
log.debug "parse() >> zwave.parse($description)"
|
log.debug "parse() >> zwave.parse($description)"
|
||||||
def cmd = zwave.parse(description, [0x20: 1, 0x26: 1, 0x70: 1])
|
def cmd = zwave.parse(description, commandClassVersions)
|
||||||
if (cmd) {
|
if (cmd) {
|
||||||
result = zwaveEvent(cmd)
|
result = zwaveEvent(cmd)
|
||||||
}
|
}
|
||||||
@@ -159,6 +168,16 @@ def zwaveEvent(physicalgraph.zwave.commands.switchmultilevelv1.SwitchMultilevelS
|
|||||||
[createEvent(name:"switch", value:"on"), response(zwave.switchMultilevelV1.switchMultilevelGet().format())]
|
[createEvent(name:"switch", value:"on"), response(zwave.switchMultilevelV1.switchMultilevelGet().format())]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def zwaveEvent(physicalgraph.zwave.commands.crc16encapv1.Crc16Encap cmd) {
|
||||||
|
def versions = commandClassVersions
|
||||||
|
def version = versions[cmd.commandClass as Integer]
|
||||||
|
def ccObj = version ? zwave.commandClass(cmd.commandClass, version) : zwave.commandClass(cmd.commandClass)
|
||||||
|
def encapsulatedCommand = ccObj?.command(cmd.command)?.parse(cmd.data)
|
||||||
|
if (encapsulatedCommand) {
|
||||||
|
zwaveEvent(encapsulatedCommand)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def zwaveEvent(physicalgraph.zwave.Command cmd) {
|
def zwaveEvent(physicalgraph.zwave.Command cmd) {
|
||||||
// Handles all Z-Wave commands we aren't interested in
|
// Handles all Z-Wave commands we aren't interested in
|
||||||
[:]
|
[:]
|
||||||
|
|||||||
@@ -85,11 +85,21 @@ metadata {
|
|||||||
details(["switch", "power", "energy", "levelSliderControl", "refresh", "reset"])
|
details(["switch", "power", "energy", "levelSliderControl", "refresh", "reset"])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def getCommandClassVersions() {
|
||||||
|
[
|
||||||
|
0x20: 1, // Basic
|
||||||
|
0x26: 3, // SwitchMultilevel
|
||||||
|
0x56: 1, // Crc16Encap
|
||||||
|
0x70: 1, // Configuration
|
||||||
|
0x32: 3, // Meter
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
// parse events into attributes
|
// parse events into attributes
|
||||||
def parse(String description) {
|
def parse(String description) {
|
||||||
def result = null
|
def result = null
|
||||||
if (description != "updated") {
|
if (description != "updated") {
|
||||||
def cmd = zwave.parse(description, [0x20: 1, 0x26: 3, 0x70: 1, 0x32:3])
|
def cmd = zwave.parse(description, commandClassVersions)
|
||||||
if (cmd) {
|
if (cmd) {
|
||||||
result = zwaveEvent(cmd)
|
result = zwaveEvent(cmd)
|
||||||
log.debug("'$description' parsed to $result")
|
log.debug("'$description' parsed to $result")
|
||||||
@@ -124,6 +134,21 @@ def zwaveEvent(physicalgraph.zwave.commands.switchmultilevelv3.SwitchMultilevelR
|
|||||||
dimmerEvents(cmd)
|
dimmerEvents(cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def zwaveEvent(physicalgraph.zwave.commands.crc16encapv1.Crc16Encap cmd) {
|
||||||
|
def versions = commandClassVersions
|
||||||
|
def version = versions[cmd.commandClass as Integer]
|
||||||
|
def ccObj = version ? zwave.commandClass(cmd.commandClass, version) : zwave.commandClass(cmd.commandClass)
|
||||||
|
def encapsulatedCommand = ccObj?.command(cmd.command)?.parse(cmd.data)
|
||||||
|
if (encapsulatedCommand) {
|
||||||
|
zwaveEvent(encapsulatedCommand)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def zwaveEvent(physicalgraph.zwave.Command cmd) {
|
||||||
|
// Handles all Z-Wave commands we aren't interested in
|
||||||
|
[:]
|
||||||
|
}
|
||||||
|
|
||||||
def dimmerEvents(physicalgraph.zwave.Command cmd) {
|
def dimmerEvents(physicalgraph.zwave.Command cmd) {
|
||||||
def result = []
|
def result = []
|
||||||
def value = (cmd.value ? "on" : "off")
|
def value = (cmd.value ? "on" : "off")
|
||||||
|
|||||||
@@ -89,10 +89,19 @@ def updated() {
|
|||||||
} catch (e) { log.debug e }
|
} catch (e) { log.debug e }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def getCommandClassVersions() {
|
||||||
|
[
|
||||||
|
0x20: 1, // Basic
|
||||||
|
0x32: 1, // SwitchMultilevel
|
||||||
|
0x56: 1, // Crc16Encap
|
||||||
|
0x72: 2, // ManufacturerSpecific
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
def parse(String description) {
|
def parse(String description) {
|
||||||
def result = null
|
def result = null
|
||||||
if(description == "updated") return
|
if(description == "updated") return
|
||||||
def cmd = zwave.parse(description, [0x20: 1, 0x32: 1, 0x72: 2])
|
def cmd = zwave.parse(description, commandClassVersions)
|
||||||
if (cmd) {
|
if (cmd) {
|
||||||
result = zwaveEvent(cmd)
|
result = zwaveEvent(cmd)
|
||||||
}
|
}
|
||||||
@@ -157,6 +166,16 @@ def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.ManufacturerS
|
|||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def zwaveEvent(physicalgraph.zwave.commands.crc16encapv1.Crc16Encap cmd) {
|
||||||
|
def versions = commandClassVersions
|
||||||
|
def version = versions[cmd.commandClass as Integer]
|
||||||
|
def ccObj = version ? zwave.commandClass(cmd.commandClass, version) : zwave.commandClass(cmd.commandClass)
|
||||||
|
def encapsulatedCommand = ccObj?.command(cmd.command)?.parse(cmd.data)
|
||||||
|
if (encapsulatedCommand) {
|
||||||
|
zwaveEvent(encapsulatedCommand)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def zwaveEvent(physicalgraph.zwave.Command cmd) {
|
def zwaveEvent(physicalgraph.zwave.Command cmd) {
|
||||||
log.debug "$device.displayName: Unhandled: $cmd"
|
log.debug "$device.displayName: Unhandled: $cmd"
|
||||||
[:]
|
[:]
|
||||||
|
|||||||
@@ -71,9 +71,17 @@ def updated(){
|
|||||||
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])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def getCommandClassVersions() {
|
||||||
|
[
|
||||||
|
0x20: 1, // Basic
|
||||||
|
0x56: 1, // Crc16Encap
|
||||||
|
0x70: 1, // Configuration
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
def parse(String description) {
|
def parse(String description) {
|
||||||
def result = null
|
def result = null
|
||||||
def cmd = zwave.parse(description, [0x20: 1, 0x70: 1])
|
def cmd = zwave.parse(description, commandClassVersions)
|
||||||
if (cmd) {
|
if (cmd) {
|
||||||
result = createEvent(zwaveEvent(cmd))
|
result = createEvent(zwaveEvent(cmd))
|
||||||
}
|
}
|
||||||
@@ -120,6 +128,15 @@ def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.ManufacturerS
|
|||||||
createEvent([descriptionText: "$device.displayName MSR: $msr", isStateChange: false])
|
createEvent([descriptionText: "$device.displayName MSR: $msr", isStateChange: false])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def zwaveEvent(physicalgraph.zwave.commands.crc16encapv1.Crc16Encap cmd) {
|
||||||
|
def versions = commandClassVersions
|
||||||
|
def version = versions[cmd.commandClass as Integer]
|
||||||
|
def ccObj = version ? zwave.commandClass(cmd.commandClass, version) : zwave.commandClass(cmd.commandClass)
|
||||||
|
def encapsulatedCommand = ccObj?.command(cmd.command)?.parse(cmd.data)
|
||||||
|
if (encapsulatedCommand) {
|
||||||
|
zwaveEvent(encapsulatedCommand)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def zwaveEvent(physicalgraph.zwave.Command cmd) {
|
def zwaveEvent(physicalgraph.zwave.Command cmd) {
|
||||||
// Handles all Z-Wave commands we aren't interested in
|
// Handles all Z-Wave commands we aren't interested in
|
||||||
|
|||||||
@@ -89,9 +89,17 @@ def updated(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def getCommandClassVersions() {
|
||||||
|
[
|
||||||
|
0x20: 1, // Basic
|
||||||
|
0x56: 1, // Crc16Encap
|
||||||
|
0x70: 1, // Configuration
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
def parse(String description) {
|
def parse(String description) {
|
||||||
def result = null
|
def result = null
|
||||||
def cmd = zwave.parse(description, [0x20: 1, 0x70: 1])
|
def cmd = zwave.parse(description, commandClassVersions)
|
||||||
if (cmd) {
|
if (cmd) {
|
||||||
result = createEvent(zwaveEvent(cmd))
|
result = createEvent(zwaveEvent(cmd))
|
||||||
}
|
}
|
||||||
@@ -138,6 +146,16 @@ def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.ManufacturerS
|
|||||||
createEvent([descriptionText: "$device.displayName MSR: $msr", isStateChange: false])
|
createEvent([descriptionText: "$device.displayName MSR: $msr", isStateChange: false])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def zwaveEvent(physicalgraph.zwave.commands.crc16encapv1.Crc16Encap cmd) {
|
||||||
|
def versions = commandClassVersions
|
||||||
|
def version = versions[cmd.commandClass as Integer]
|
||||||
|
def ccObj = version ? zwave.commandClass(cmd.commandClass, version) : zwave.commandClass(cmd.commandClass)
|
||||||
|
def encapsulatedCommand = ccObj?.command(cmd.command)?.parse(cmd.data)
|
||||||
|
if (encapsulatedCommand) {
|
||||||
|
zwaveEvent(encapsulatedCommand)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
def zwaveEvent(physicalgraph.zwave.Command cmd) {
|
def zwaveEvent(physicalgraph.zwave.Command cmd) {
|
||||||
// Handles all Z-Wave commands we aren't interested in
|
// Handles all Z-Wave commands we aren't interested in
|
||||||
|
|||||||
Reference in New Issue
Block a user