Another fairly trivial change to an existing device type: I have a Kwikset lock 912 and 910 - both report when an invalid code is entered. Sounds like an alarm condition to me
Start with the Z Wave Lock template (or the Z Wave Lock Reporting version - works with eitherâŚ)
Add to metadata:
capability "Alarm"
command "reset" // reset tamper state
Add to tiles:
standardTile("tamper", "device.alarm") {
state("secure", label:'secure', icon:"st.locks.lock.locked", backgroundColor:"#ffffff")
state("failed", label:'tampered', action:"reset", icon:"st.alarm.alarm.alarm", backgroundColor:"#53a7c0")
}
Add âtamperâ to detailsâŚ
In this function
def zwaveEvent(physicalgraph.zwave.commands.alarmv2.AlarmReport cmd) {
Look for case 161 - add this to the âelseâ portion
// trip alarm
sendEvent(displayed: true, name: "alarm", value: "failed", descriptionText: "$device.displayName has had a failed code entered")
End of file add:
// for failed code entry
def reset() {
log.debug "reset alarm state"
sendEvent(displayed: true, isStateChange: true, name: "alarm", value: "secure", descriptionText: "$device.displayName reset to non-alarm")
}
This will trip the alarm state for the door lock if someone enters an invalid code. You could do whatever you want with that. The alarm state stays tripped until you reset it by tapping the tamper tile in the device or set the alarm state via an app.
EDIT: Somehow uppercase S slipped into sendEvent()!
Edit2: You need to enter a bad code 3 times - the lock flashes several times and makes a lot of beeping sounds - and fires the alarm event
Edit3: Screenshots on the way