Compare commits

...

1 Commits

Author SHA1 Message Date
Robert Florian
039f11d928 null: Just a test 2018-11-03 21:01:40 -07:00

View File

@@ -22,7 +22,6 @@ metadata {
capability "Sensor"
capability "Battery"
capability "Health Check"
capability "Tamper Alert"
fingerprint mfr: "011F", prod: "0001", model: "0001", deviceJoinName: "Schlage Motion Sensor" // Schlage motion
fingerprint mfr: "014A", prod: "0001", model: "0001", deviceJoinName: "Ecolink Motion Sensor" // Ecolink motion
@@ -32,6 +31,7 @@ metadata {
fingerprint mfr: "011A", prod: "0601", model: "0901", deviceJoinName: "Enerwave Motion Sensor" // Enerwave ZWN-BPC
fingerprint mfr: "0063", prod: "4953", model: "3133", deviceJoinName: "GE Portable Smart Motion Sensor"
fingerprint mfr: "0214", prod: "0003", model: "0002", deviceJoinName: "BeSense Motion Detector"
fingerprint mfr: "1111", prod: "2222", model: "3333", deviceJoinName: "Z Motion"
}
simulator {
@@ -49,20 +49,15 @@ metadata {
valueTile("battery", "device.battery", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
state("battery", label:'${currentValue}% battery', unit:"")
}
valueTile("tamper", "device.tamper", height: 2, width: 2, decoration: "flat") {
state "clear", label: 'tamper clear', backgroundColor: "#ffffff"
state "detected", label: 'tampered', backgroundColor: "#ff0000"
}
main "motion"
details(["motion", "battery", "tamper"])
details(["motion", "battery"])
}
}
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])
sendEvent(name: "tamper", value: "clear", displayed: false)
response(initialPoll())
}
@@ -94,7 +89,6 @@ def sensorValueEvent(value) {
if (value) {
createEvent(name: "motion", value: "active", descriptionText: "$device.displayName detected motion")
} else {
createEvent(name: "tamper", value: "clear")
createEvent(name: "motion", value: "inactive", descriptionText: "$device.displayName motion has stopped")
}
}
@@ -137,8 +131,6 @@ def zwaveEvent(physicalgraph.zwave.commands.notificationv3.NotificationReport cm
} else if (cmd.event == 0x03) {
result << createEvent(name: "tamper", value: "detected", descriptionText: "$device.displayName covering was removed", isStateChange: true)
result << response(zwave.batteryV1.batteryGet())
unschedule(clearTamper, [forceForLocallyExecuting: true])
runIn(10, clearTamper, [forceForLocallyExecuting: true])
} else if (cmd.event == 0x05 || cmd.event == 0x06) {
result << createEvent(descriptionText: "$device.displayName detected glass breakage", isStateChange: true)
}
@@ -152,10 +144,6 @@ def zwaveEvent(physicalgraph.zwave.commands.notificationv3.NotificationReport cm
result
}
def clearTamper() {
sendEvent(name: "tamper", value: "clear")
}
def zwaveEvent(physicalgraph.zwave.commands.wakeupv1.WakeUpNotification cmd)
{
def result = [createEvent(descriptionText: "${device.displayName} woke up", isStateChange: false)]
@@ -289,4 +277,4 @@ private command(physicalgraph.zwave.Command cmd) {
private isEnerwave() {
zwaveInfo?.mfr?.equals("011A") && zwaveInfo?.prod?.equals("0601") && zwaveInfo?.model?.equals("0901")
}
}