KeyMaster Z-Wave lock manager and scheduler

Ok, thanks

ZWaveJS is supposed to emit the events as zwave_js_notification events for alarm_level and alarm_type which keymaster consumes and then re-emits based on the configuration and input fields.

@kagetaro99, Sorry I got distracted with some other things, not sure if you ever got tried this or got it working. But just got back to this today. The example automation from FutureTense works perfectly.

Just one thing to save you some time though that frustrated me for a bit. I have not yet created a ā€œscriptā€ for turning the alarm off. (Probably makes sense to do so, I just havenā€™t done it yet). So I replaced the script in @FutureTense example and used the call service - ā€˜alarm_control_panel.alarm_disarmā€™. Remember if you go that route, when doing so - you have to fill out the ā€œoptional codeā€ section, so that your code to disarm gets passed by the Automation. Otherwise the automation will ā€œfire,ā€ but nothing will actually happen.

Also, @FutureTense am just learning Home Assistant and .yaml. So, if I want to do this for multiple slots - can I just add additional numbers after ā€˜trigger.event.data.code_slotā€™? Or do I need a new ā€œconditionā€ for each new slot or finally, will I need a new automation for each slot that I want to use?

@FutureTense thank you for this project and for your continued help and good luck to you @kagetaro99

I successfully installed keymaster without errors but nfortunately I am unable to write pin codes to either of my Kwikset 910 locks beyond the initial write. To fix the issue, I am planning on FULLY uninstalling keymaster, factory RESETTING both locks, rePAIRing the locks, and reinstalling keymaster.

I want to make sure I cleared everything before starting the reinstall and would appreciate any tips. So far I have:

  • Removed both locks from the integrations
  • Uninstalled Keymaster in HACS
  • Manually removed entities in automations.

Is there anything else I need to do? Thanks for any help you might be able to provide!

My installation of Keymaster is mostly working. But the UI seems to get stuck on ā€œAddingā€ when I try to enable a PIN. Z-Wave JS logs show the PIN being written successfully, but the Keymaster UI just shows ā€œAddingā€ beside PIN status. It never gets to the connected state.

zwave_js logs show the code being updated, user PINs redacted by me (And I can verify the new code works, and the old one no longer does)

2021-12-06T19:23:29.127Z DRIVER Ā« [REQ] [SendDataBridge]
                                    callback id:     57
                                    transmit status: OK
2021-12-06T19:23:29.130Z CNTRLR   [Node 004] [~] [User Code] userCode[2]: "XXXXXX" => "XXXXXX"        [Endpoint 0]
2021-12-06T19:23:29.131Z CNTRLR   [Node 004] Scheduled poll canceled because value was updated
2021-12-06T19:23:30.055Z SERIAL Ā« 0x010b00a800010402984000bb38                                        (13 bytes)
2021-12-06T19:23:30.056Z SERIAL Ā» [ACK]                                                                   (0x06)
2021-12-06T19:23:30.059Z DRIVER Ā« [Node 004] [REQ] [BridgeApplicationCommand]
                                  ā””ā”€[SecurityCCNonceGet]
2021-12-06T19:23:30.067Z SERIAL Ā» 0x011600a901040a9880c59edf72dc33c25005000000003ae3                  (24 bytes)
2021-12-06T19:23:30.068Z DRIVER Ā» [Node 004] [REQ] [SendDataBridge]
                                  ā”‚ source node id:   1
                                  ā”‚ transmit options: 0x05
                                  ā”‚ route:            0, 0, 0, 0
                                  ā”‚ callback id:      58
                                  ā””ā”€[SecurityCCNonceReport]
                                      nonce: 0xc59edf72dc33c250
2021-12-06T19:23:30.075Z SERIAL Ā« [ACK]                                                                   (0x06)
2021-12-06T19:23:30.077Z SERIAL Ā« 0x010401a90152                                                       (6 bytes)
2021-12-06T19:23:30.078Z SERIAL Ā» [ACK]                                                                   (0x06)
2021-12-06T19:23:30.079Z DRIVER Ā« [RES] [SendDataBridge]
                                    was sent: true
2021-12-06T19:23:30.096Z SERIAL Ā« 0x011d00a93a00000100bb7f7f7f7f01010300000000020100007f7f7f7f7fb4    (31 bytes)
2021-12-06T19:23:30.097Z SERIAL Ā» [ACK]                                                                   (0x06)
2021-12-06T19:23:30.098Z DRIVER Ā« [REQ] [SendDataBridge]
                                    callback id:     58
                                    transmit status: OK
2021-12-06T19:23:30.114Z SERIAL Ā« 0x012700a80001041e9881782de0650c9cf22731f8ab1978518dacd5e571c55f649 (41 bytes)
                                  1a086ea2f3a00bbd8
2021-12-06T19:23:30.115Z SERIAL Ā» [ACK]                                                                   (0x06)
2021-12-06T19:23:30.117Z CNTRLR   [Node 004] [~] [Notification] notificationMode: "push" [Endpoint 0] [internal]
                                   => "push"
2021-12-06T19:23:30.118Z DRIVER Ā« [Node 004] [REQ] [BridgeApplicationCommand]
                                  ā””ā”€[SecurityCCCommandEncapsulation]
                                    ā”‚ sequenced: false
                                    ā””ā”€[NotificationCCReport]
                                        notification type:   Access Control
                                        notification status: 255
                                        notification event:  New user code added
2021-12-06T19:23:59.166Z SERIAL Ā« 0x010b00a800010402984000be3d                                        (13 bytes)
2021-12-06T19:23:59.167Z SERIAL Ā» [ACK]                                                                   (0x06)

But in Keymaster, this is what I see:

It will just sit on ā€œAddingā€ forever.

Some things to note, not sure if they make a difference:

  • Iā€™m using two different code lengths: slot 1 uses a 6-digit code, while slot 2 uses a 4-digit code. My lock supports this as per the user manual (Yale Pro SL)
  • Iā€™ve set advanced options for slot 2 so that the code is only active on Mondays between 8AM and 6PM.

Iā€™m running version 0.0.77 of Keymaster, HA core version 2021.11.5, Supervisor 2021.10.8, Home Assistant OS 6.6. Running on an Odroid N2+ with a Zooz 700 ZWave USB stick.

Locks operate normally and reliably over Z Wave when locking/unlocking.

EDIT: Iā€™ve also noticed that my automation to enable/disable the code doesnā€™t work either. The code should have been disabled at 6:00 pm, but it is still active. The UI correctly shows ā€œDisconnected,ā€ but the code still works when I try it on the lock keypad.

I have completely re-set my two Kwikset 910 locks, uninstalled keymaster, repaired and reinstalled. Unfortunately after doing all of that it appears I am having the same experience as @jclarke0000 above.

  • I am able to write the codes with keymaster but the status remains on adding.
  • I am unable to disable any codes with keymaster.
  • I am able to write and clear codes manually using the developer tools services option with zwave_js.set_lock_usercode and zwave_js.clear_lock_usercode
  • I am able to unlock and lock the doors with Home Assistant

I am running the 2021.11.5 version of HA and v0.0.77 of keymaster.

Like @schwieb I can confirm that I can also manually set and clear codes if I call the set_user_code and clear_user_code services via developer tools. This works reliably. Iā€™m only having problems trying to manage the user codes via the UI.

An update for Z-wave JS became available today. I installed the update and it seems to have fixed my issues. I can now manage codes through keymasterā€™s UI properly for both of my locks. Iā€™ll keep an eye on this, as the real test will be next Monday when the scheduled code, currently disabled, should become active.

EDIT I have noticed that the keymaster_lock_state_changed event no longer fires if I lock or unlock the lock over Z-Wave using HAā€™s regular UI (e.g., entity card). The event fires only when a PIN code is used, or when the deadbolt is manually turned by hand. Before the Z-Wave update, the event would fire and the action_text field of the event object read something like ā€œRF unlock operation.ā€

Look at frontdoor_keymaster_common.yaml and find the notification automation.


  - alias: keymaster_frontdoor User Notifications
    id: keymaster_frontdoor User Notifications
    trigger:
      platform: event
      event_type: keymaster_lock_state_changed
      event_data:
        lockname: frontdoor
    condition:
      - condition: template
        value_template: "{{ trigger.event.data.code_slot > 0 }}"
      - condition: template
        value_template: "{{ is_state('input_boolean.notify_frontdoor_' + trigger.event.data.code_slot | string, 'on') }}"
      - condition: state
        entity_id: input_boolean.frontdoor_lock_notifications
        state: "off"
    action:
      - service: script.keymaster_frontdoor_manual_notify
        data_template:
          title: frontdoor
          message: "{{ trigger.event.data.action_text }} ({{ trigger.event.data.code_slot_name }})"

You can copy this to your own automations and replace script.keymaster_frontdoor_manual_notify to disarm your system. You should remove or replace the last two conditions because they might prevent this from firing. I would create a condition that checks to see if trigger.event.data.code_slot is in [1, 2, 4] so that it only disarms when those slots are used. e.g. if slot 3 is the maid and you want to make sure they have to disarm your panel ā€œnormallyā€.

Yeah, I suppose I should remove that. But I left it in because I still use that personally, lol.

Why do you want to use webhooks in the first place?

It depends on how you want to organize things. If I were to add this feature to KeyMaster, Iā€™d add a disarm toggle for each user in the gui. In the example a few posts above, thatā€™s a single automation for all slots. But thereā€™s no reason you couldnā€™t create an automation for each slot. But itā€™s a sloppy approach. I prefer code to be centralized.

You might have noticed there is yaml for each slot, likemfrontdoor_keymaster_1.yaml but there is also frontdoor_keymaster_common.yaml which is used by all slots. I try and keep the slots as small as possible.

Thatā€™s my fail safe procedure. Works every time. Sometimes I reboot the system too.

My locks are now working with the latest zwave-js 1.50! Thanks for pointing that out @jclarke0000

I also appreciate the work of the developers. I know this is a time consuming endeavor to create an maintain.

1 Like

Ok, I must be doing something stupid regarding the notifications because they dont work.

I added this to scripts.yaml

frontdoor_manual_notify:
  mode: parallel
  sequence:
  - service: notify.notify
    data:
      title: '{{ title }}'
      message: '{{ message }}'

I turned on the notifications:
image

I toggled the notification for each code:
image

I also tested the script with developer tools and I get a notification as expected.

What am I missing?

If you look at the lock device in the zwavejs integration do you have any disabled entities?

I had alarmtype and alarmlevel disabled, but I thought I could use the fake sensors instead. I will enable them, redeploy the locks, and try again to see if that might be the problem.

If alarm level reports the code slot you might find it more convenient to just use state change automations on those variables versus trapping the events.

Not sure I follow on how to do that!

Hereā€™s an example (untested)
Hereā€™s a keymaster lock that has many codes but you want to send a notification when either of the first two codes are used. The ā€˜toā€™ portion in the state triggers donā€™t need a ā€˜fromā€™ portion so they will fire every time.

alias: Automation that does something
description: ''
trigger:
  - platform: state
    entity_id: sensor.<door_name>_alarmlevel_2
    to: '1'
  - platform: state
    entity_id: sensor.<door_name>_alarmlevel_2
    to: '2'
condition: []
action:
  - service: notify.notify
    data:
      message: 'some message'
mode: single