KeyMaster Z-Wave lock manager and scheduler

I attempted to search for this issue, but haven’t had much luck. Everything is working as its supposed to, except I am unable to get notifications for the user code unlocking. All of the other notifications are working (“Manual lock operation”, Keypad unlock operation", etc). However, when I use one of the connected user codes to unlock the door, I’m not getting anything.

I am running Zwave JS. I have the option to add either access_control_lock_state or access_control_keypad to the Alarm Type/Access Control setting, but no matter which I choose, it doesn’t affect whether I receive the user code notifications.

Please let me know if anyone has any thoughts. Thanks!

Have you added a customized notification script?

I have. Mine looks like this:

manual_notify:
  sequence:
    - condition: template
      value_template: >-
        {% set title_len = title|length %}
        {% set message_len = message|length %}
        {% if (title_len != 0 or message_len != 0) %}
          true
        {% else %}
          false
        {% endif %}
    - service: notify.mobile_app_myname
      data_template:   
        title: "{{title}}"
        message: "{{message}}"

drivewaydoor_manual_notify:
  mode: parallel
  sequence:
    - service: script.manual_notify
      data_template:
        title: "{{ title }}"
        message: "{{ message }}"

And I get notifications from Keymaster, just not for user codes.

that service call Script.manual_notify or notify.mobile_app_myname didn’t exist on my install in that name. I changed it and user notifications started working. I just used the standard notify.notify for all the entries in the packages/keymaster/frontdoor/frontdoor_keymaster_common.yaml file

The manual notify script that you are supposed to create is named <door_lock_name>_manual_notify It is expected to not exist at first. Keymaster calls that script if it exists or not.

So, for instance, I have two different locks setup.

The Keymaster name for one is: Front Door the other is Office Door so, to get notifications for both doors I created two different scripts:

front_door_manual_notify and office_door_manual_notify

Was this directed at my issue? If so, thanks.

Perhaps my issue is related to where to put that script and how/where it needs to be referenced. So, the name of my script should be “<door_lock_name>_manual_notify.yaml”? And where should it be stored?

Thanks!

harihoudini, would you mind sharing the exact code you use there and where you keep it? I feel like I missed something there. Thanks!

the code is in the file that Keymaster auto generates when it is installed. It’s in packages/keymaster/frontdoor/frontdoor_keymaster_common.yaml. It may be slightly different for you depending on what options you put when installing it. Here is the portion from that file relating to user notifications.

  • alias: 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') }}"
    

    action:

    - service: notify.notify
    
      data_template:
    
        title: frontdoor
    
        message: "{{ trigger.event.data.action_text }} ({{ trigger.event.data.code_slot_name }})"

From here in the thread

Use this button: Open your Home Assistant instance and show your scripts. to get to your scripts area and then:

Select Add Script

Set the name to be <lockname>_manual_notify (replace <lockname> with the name of your keymaster lock definition (spaces are converted to ‘_’)
Set the mode to Parallel

Add your notification configuration in the sequence. You must have at least one action defined to be able to save the script.

Excellent. Thanks Andrew and Hari.

Wondering if I can get some help - just move a BE649ZP from old zwave and ptdalen’s Lock Manager suite over to zwavejs and KeyMaster.

So far so good - just missing one piece I used to use a lot - the Front Door Report sensor that said which user last unlocked door, if it was manually unlocked, locked by HA etc.

I can’t see anything in the zwavejs web front end that suggest that information is present - does anybody know if I should be able to see it there? I’ve had a good look through the categories below and not been able to see anything relevant. Just trying to narrow down what I’m missing at this stage - anyone know if this info still present from zwavejs for this device?

image

Okay some mysteries solved:

  1. My lock wasn’t properly paired - I need to re-interview it
  2. I don’t think the front door report is available out of the box - I should have RTFM
  3. I cobbled something similar together as follows (new input_text required which gets updated in the automation, and then a sensor template to read from that):
alias: 'System: update front door status'
description: ''
trigger:
  - platform: event
    event_type: keymaster_lock_state_changed
    event_data:
      lockname: front_door
  - platform: state
    entity_id: lock.lock_front_door_lock
    to: locked
    for: '00:00:15'
  - platform: state
    entity_id: lock.lock_front_door_lock
    to: unlocked
    for: '00:00:15'
    attribute: friendly_name
condition:
  - condition: template
    value_template: '   {{ trigger.to_state is not defined or ((as_timestamp(now()) -  as_timestamp(states.sensor.front_door_report.last_changed)) > 15) }}'
action:
  - service: input_text.set_value
    target:
      entity_id: input_text.front_door_report
    data:
      value: >
        {% if trigger.to_state is defined %}
          {% if trigger.to_state.state == "locked" %}
        HA locked 
          {% else %}
        HA unlocked
          {% endif %}
        {% else  %} {{ trigger.event.data.action_text }}{% if 
        trigger.event.data.code_slot > 0   %}  ({{
        trigger.event.data.code_slot_name }}){% endif %} {% endif %} 
mode: single

It’s not nearly as rich as that in the old LockManager but a start I guess. The finickity bit on HA Locked and Unlocked I cribbed from there as was surprised that HA lock / unlock events doesn’t result in any notification, we just have to infer it.

Interested if anyone has anything similar. Thanks!

I missed this as well. Fixed my Lovelace Entity not available: input_XXX errors.

very true, would have been pretty easy to rip much of the dashboard away. I wasn’t sure how the app would function if I took out all the helpers also and I wanted those gone as well. in the end I just made a very simple dashboard with Name, Code, and a toggle for Enabled with a few automations to run the zwave commands for them. super light-weight and only uses the core components + zwave-js.

coming from SmartThings, HASS has been a bit of a learning curve. a little bit off-putting that there’s no built-in code for managing basic things like locks and smoke detectors. in the end it’s been education creating those myself and the power and flexibility come at a usability cost, still sometimes miss ST and WebCore for simplicity.

Any chance child locks are supposed to be working now? I’m still having issues.

I created an issue over on GitHub since I couldn’t find a current one and there’s been a new version release since you made this comment. Thanks!

Not yet. I don’t have a child lock to work with. I might get motivated if we can get a couple of people with child locks to help test it.

Thanks for the update. I’m happy to help test if you want to work on it at some point.

Threw together a quick video on this if anyone is interested. https://youtu.be/_NjVbQBaOjQ

2 Likes

Thanks Chris, very helpful.

I’ve read through this thread for about 30 minutes but can’t find the explanation for my issue.

I have 3 locks total. Every time I try and add a new one it overwrites my existing. I tried making different directories within KeyMaster but still, get the same issue.

Can anyone point me to the documentation that explains this?