Unsure How to Trigger Rule for Z-Wave Lock

I’d like to have an alert sent when my door lock is opened with the keypad. Part of the payload from the lock is the user ID for the code that was entered but I’m unsure how to translate that information into a rule trigger. Here is the verbose output from the log with user ID #3 unlocking the door:

[Node 031] [REQ] [ApplicationCommand]
                                  └─[Security2CCMessageEncapsulation]
                                    │ sequence number: 48
                                    │ security class:  S2_AccessControl
                                    └─[SupervisionCCGet]
                                      │ session id:      24
                                      │ request updates: false
                                      └─[NotificationCCReport]
                                          V1 alarm type:       19
                                          V1 alarm level:      3
                                          notification type:   Access Control
                                          notification status: 255
                                          notification event:  Keypad unlock operation
                                          event parameters:
                                            userId: 0x03

are you interested in learning how to send the notification or do you just need it done?

Keymaster does this out of the box - you just edit the message what you want it to say. BUT even if you don’t want to actually RUN keymaster - you could install it and see it’s scripts and how it works. :slight_smile:

Downside to keymaster is it installs a TON of extra entities - so ifd you dont want to use it permanently you could look at the scripts in thier git repo: FutureTense/keymaster: Home Assistant integration for managing Z-Wave enabled locks (github.com)

Thanks for the suggestion, I’ll give it a look!

I was hoping there was something in the existing framework to just trigger on a notification alert; parse the payload into a switch case; and send a pushbullet or push message saying “Front door unlocked by ____”.

1 Like

Thats what Keymaster was built to do because the code handling isnt builtin to HA.

I run it for all my zwave locks and currently keep 3 Schlage’s in sync at home with it.

I have a task on my list today to edit the manual thumb unlock for the garage because my wife hates the way the message looks.

Im editing the message -not trying to figure out how to send a message.

Ah, I see! Okay, I’ll give Keymaster a look and come back after I’ve had a chance to digest.

2 Likes

Yes you can do this natively in home assistant. I captured my logs and they are exactly like yours.

2023-11-18T20:29:11.926Z DRIVER « [Node 025] [REQ] [BridgeApplicationCommand]
                                  │ RSSI: -49 dBm
                                  └─[Security2CCMessageEncapsulation]
                                    │ sequence number: 177
                                    │ security class:  S2_AccessControl
                                    └─[NotificationCCReport]
                                        V1 alarm type:       19
                                        V1 alarm level:      3
                                        notification type:   Access Control
                                        notification status: 255
                                        notification event:  Keypad lock operation
                                        event parameters:
                                          userId: 0x03

Here is what my trigger looks like in YAML. Just change or delete the node id then copy and paste and you’re all set.

platform: event
event_type: zwave_js_notification
event_data:
  domain: zwave_js
  node_id: 25
  command_class: 113
  command_class_name: Notification
  label: Access Control
  type: 6
  event: 5
  event_label: Keypad lock operation
  parameters:
    userId: 3

This is almost exactly what I was expecting, thank you! However, it’s not worked for me out of the box. I’ve noticed that your log entry is from a “Keypad lock operation” where I’m trying to capture an unlock event. Additionally, I’m not sure how to check things such as the command class, type, and event numbers you’ve assigned. I upped my logging level to “Silly” and don’t see these fields as part of the packet. Should those change for an unlock vs a lock operation?

Edit:
Did some digging in the Z-Wave command class reference and found that “event” is for the last event ID. I took what was provided by @cornellrwilliams, updated the Node and User IDs, and removed the event line - great success! Thank you for the direction (although I have to admit I would have never found the command_class and type values from the logs)!
For reference, here is the full trigger YAML:

trigger:
  - platform: event
    event_type: zwave_js_notification
    event_data:
      domain: zwave_js
      node_id: 31
      command_class: 113
      command_class_name: Notification
      label: Access Control
      type: 6
      event_label: Keypad unlock operation
      parameters:
        userId: 4
    id: [Name 1] Unlock
  - platform: event
    event_type: zwave_js_notification
    event_data:
      domain: zwave_js
      node_id: 31
      command_class: 113
      command_class_name: Notification
      label: Access Control
      type: 6
      event_label: Keypad unlock operation
      parameters:
        userId: 3
    id: [Name 2] Unlock
1 Like

So there are (2) places I get my information for my Z-Wave Automations. The first place is Z-Wave JS UI dashboard. Above every parameter there is a list of values that correspond to the following:
Node Id - Command Class ID - Endpoint - Property - Property Key.
The large text next to the idle button is your value and you would input this in the to or from field. I use these values when I want to do a value change on a Z-Wave JS Value Trigger.

Motion Detected

The other place I get my information from is the events viewer which is found in the developer tools. I use this when I cant trigger the automation using the other method. I use this with the event trigger.

Ah, interesting! I switched from the JS UI for reasons I don’t recall but at least I know where I can go if I run into this again. Thanks for the pointer!