Simplified Zwave Lock Manager is now KeyMaster

I tried to make the install simple. Glad it was fast. Did you find this from my Reddit post?

I think so. I have one lock for now but will have two locks soon, so I’d love multi lock support too :slight_smile:

Nice work! I’m still new to Home Assistant.

How do I configure notifications? I’d like to have a notification that fires whenever a PIN code is entered that tells me which code was entered. I’m assuming you do this with automations, but I’m not sure.

I’m getting closer. I have the automation triggering when the keypad is unlocked. However, I’m not sure how to configure the data template to pass the name of the code that unlocked. Any ideas?

Here’s what I have right now that correctly sends a notification with the title of “Test” and the body of “Test Message”:

- id: 'front_door_unlock'
  alias: Unlock Front Door Notify
  trigger:
    - platform: state
      entity_id: lock.front_door_lock
      to: 'unlocked'
      from: 'locked'
  condition:
    - condition: template
      value_template: '{{ states.lock.front_door_lock.attributes.notification == "Keypad Unlock"}}'
  action:
    - service: notify.notifier
      data_template:
        title: >
          Test
        message: >
           Test Message

I have been using ptdalen’s lock manager but never got the setting and deleting of codes working properly. I have just installed this simplified one and made changes to the entities in the config files. I installed the plug-ins via HACS and added the necessary lines to the resource area of lovelace (RAW config).

The code tab seems to load everything except the fold-entity-row cards and gives me an error:
Custom element doesn’t exist: fold-entity-row

I just installed the plug-ins but checked the versions anyhow and they match.
I cleared my browser’s cache (desktop and mobile) but still get the doesn’t exist message.

What else can I do to get this working properly? Anything obvious that I might have overlooked?

This lock manager looks very promising and I’d really like to get it working.

Edit: I’ve disabled the Day of Week restrictions for now as it’s not really something I’ll need on a day to day basis. Thanks for creating this!

If you follow the instructions of the first post, you shouldn’t have to create any automations for your notifications. They are already included. The important part is to create the UI by using the lovelace file that’s attached.

When you have the UI running, you should have 6 “codes” by default. Once you add a PIN and use the enabled slider that PIN will get added to your lock. If the status reads Connected that PIN should control the lock. If the Notifications slider is on, you will get a message whenever that PIN is used.

I just noticed that I forgot to include a script in my package!!! In lock_manager_common.yaml (and maybe other places) script.conditional_notify is called in several places. Below is an example where it’s used. Why did I create conditional_notify? Because I wanted to attach an input_boolean to determine if the notification should be sent. This way I didn’t have to use a condition template which is a pain in the neck. So if you look at the “action” below, it always calls conditional_notify and passes in the “condition” boolean. The script itself will only send a notification if the boolean is true.

    - alias: Front Door Sensor Close
      trigger:
        entity_id: binary_sensor.vision_security_zd2105us_5_recessed_door_window_sensor_access_control_frontdoor
        platform: state
        to: 'off'
      action:
        - service: script.conditional_notify
          data_template:
            boolean: input_boolean.dooraccess_notifications
            title: "Front Door"    
            message: "Closed"

And here is the missing script. Notice that it uses a condition to check if the passed in boolean is true? I use notify.notify which is configured to send me iOS notifications. You should modify this to send the notifications that you prefer. Since this is the only place that sends a notification, you only need to make one change. Encapsulation principle, kinda sorta. Technically you should pass in the service, but I wanted to make this easy for the non-programmer.

conditional_notify:
  sequence:
    - condition: template
      value_template: "{{(states(boolean) == 'on')}}"
    - service: notify.notify
      data_template:   
        title: "{{title}}"
        message: "{{message}}"

I’m using the HACS integration from the Community Store. You might want to try installing the plugins I am using which are:

  • Lovelace Auto Entities
  • Lovelace Card Mod
  • Lovelace Card Tools
  • Lovelace Fold Entity Row
  • Monster Card

And at the top of my lovelace code I have the following resources:

resources:
  - type: js
    url: /community_plugin/monster-card/monster-card.js
  - type: module
    url: /community_plugin/weather-card/weather-card.js
  - type: module
    url: /community_plugin/simple-thermostat/simple-thermostat.js
  - type: module
    url: /community_plugin/lovelace-card-mod/card-mod.js
  - type: module
    url: /community_plugin/lovelace-fold-entity-row/fold-entity-row.js
  - type: module
    url: /community_plugin/lovelace-auto-entities/auto-entities.js
  - type: js
    url: /community_plugin/lovelace-card-tools/card-tools.js

Try duplicating that and see if it works. Let me know if you narrow it down. Also, you should look at this this post because there is a missing script in the package. You should just copy it to your script file, modify it so it works with the type of notifications you like.

Thanks for the reply. For whatever reason I can’t get fold-entity-row to work; it doesn’t really matter as I am very pleased with the rest of the package and won’t be dealing much with time restricted access in any case. I modified the notifying service and added a couple of sensors from ptdalen’s package (battery status and last person to unlock w/keypad) to round it off.

Try making your own fold entity row entry in a new Lovelace page. You probably have some other issue as why it’s not working.

Post your code here. I might add that to the package. I’m due for an update and might get to it this weekend.

I might look into the fold-entity-row at a later point in time. For now, here are the template sensors I snagged from ptdalen:

- platform: template
  sensors:

    door_lock_batteries_front_door:
      friendly_name: 'Schlage Battery Level'
      value_template: "{% if states.zwave.lock_front_door_deadbolt %}
          {{ states.zwave.lock_front_door_deadbolt.attributes.battery_level }}
        {% else %}
          unknown
        {% endif %}"
      unit_of_measurement: '%'
      icon_template: >-
        {% set battery_level = states('sensor.door_lock_batteries_front_door')|int('unknown') %}
        {% set battery_round = (battery_level|int / 10)|int * 10 %}
        {% if battery_level == 'unknown' %}
          mdi:battery-unknown
        {% else %}
          {% if battery_round >= 100 %}
            mdi:battery
          {% elif battery_round > 0 %}
            mdi:battery-{{ battery_round }}
          {% else %}
            mdi:battery-alert
          {% endif %}
        {% endif %}
      
    frontdoor_code:
      friendly_name: 'Last Keypad Unlock'
      value_template: >
        {% set number = states('sensor.lock_front_door_deadbolt_alarm_level') %}
        {% set entity_id = 'input_text.frontdoor_name_' + number %}
        {% set user = 'Master' if number == '0' else states(entity_id) %}
        {{ user }}

Thanks. I’ll add this to the package.

1 Like

I’m waiting on my Schlage to come in and was looking for a way to manage it with home assistant. I’m new to this so I wanted to just verify that each yaml is a code slot for each code I want to use? So if I wanted to fill the 30, I would need 30 yaml files?

I’d like to add the clock time to the notification message when the door is locked or unlocked. I’m not sure where to add this string to the notification automation to get that to come across {{states(‘sensor.time_date’)}} in the notification. I’m using the Ariela app for notifications and it doesn’t include the time on the notification by default so I’d like it to come through in the notification text itself.

I know how to do that in regular notification messages, but I’ve never done it then the message is a template.

Any help is appreciated!

I have been able to set this up but the pin is not being transferred to the lock, The status shows connected.

Am I missing something?

Yes, you would need 30. But you can modify the setup script to create 30 slots. You would have to manually modify the Lovelace to add them, but it shouldn’t be difficult.

If it shows “connected” the PIN should be in the lock. See if you can use the services tab in Developer Tools to manually set the pin there. If that doesn’t work there, you will have to solve that problem before this package will work.

Yes I was able to set a code via the lock.set_usercode
Initially the node_id was set to 18 but the actual node_id of the lock is 16. Do I need to change this somewhere in your package?

I am not sure if it makes a difference but I have the Zwave Plus version of this lock, I did rename all of the entities as you laid out in the instructions

1 Like

Sounds like the node id might have changed. Did you delete and then re add the lock? Changing the nodeID is worth a try.

I’m about to publish a new version to fix a bug, but go ahead and experiment as I don’t know when I’m going to publish the update

I haven’t deleted then re added it, do you mean completely removing it from the Zwave panel?

How do I change the nodeID to match what mine is currently set too (16)