Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ def both() {
on()
}

def chime() {
on()
}

def ping() {
def cmds = [
encap(zwave.basicV1.basicGet())
Expand Down Expand Up @@ -201,26 +205,30 @@ def zwaveEvent(physicalgraph.zwave.commands.notificationv3.NotificationReport cm
switch (cmd.event) {
case 0x09: //TAMPER
sendEvent(name: "tamper", value: "detected")
runIn(10, "clearTamper")
sendEvent(name: "alarm", value: "both")
runIn(2, "clearTamperAndAlarm")
break
case 0x01: //ON
if (state.lastTriggeredSound == 1) {
createEvent([name: "alarm", value: "both"])
createEvent([name: "chime", value: "chime"])
sendEvent(name: "chime", value: "chime")
sendEvent(name: "alarm", value: "both")
} else {
setActiveSound(state.lastTriggeredSound)
}
break
case 0x00: //OFF
resetActiveSound()
createEvent([name: "tamper", value: "clear"])
sendEvent(name: "tamper", value: "clear")
sendEvent(name: "alarm", value: "off")
sendEvent(name: "chime", value: "off")
break
}
}
}

def clearTamper() {
def clearTamperAndAlarm() {
sendEvent(name: "tamper", value: "clear")
sendEvent(name: "alarm", value: "off")
}

def setOnChild(deviceDni) {
Expand Down Expand Up @@ -252,7 +260,7 @@ def resetActiveSound() {
def setActiveSound(soundId) {
String childDni = "${device.deviceNetworkId}:${soundId}"
def child = childDevices.find { it.deviceNetworkId == childDni }
child?.sendEvent(name: "chime", value: "on")
child?.sendEvent(name: "chime", value: "chime")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! :)

child?.sendEvent(name: "alarm", value: "both")
}

Expand Down