Zwave Lock Manager (Updated)

Once I removed and readded, I’ve had good success with the lock. No longer having any problems.

Just wiped my (very small/simple) Hass.io docker install after a long period of not updating and re-installed as HomeAssistant OS. I was worried about getting your door lock code setup properly but everything worked flawlessly. Thank you so much for your hard work not only on the code but also on the documentation / installation instructions. Makes noobs like me feel really smart. Two things I wanted to mention…

I needed to install " card-tools" via HACS after seeing the red error card “Can’t find card-tools. […]” in the lovelace dashboard but it was very straight forward.

I have 16 “Turn keypad (#1-16) on” and 16 “Turn keypad (#1-16) off” entity badges that were auto added to my default Overview screen. The UI is telling me they are part of the “Keypad Scheduled code start (Front Door)” automation however it says This entity ("sensor.keypad_1_temp_lock_turn_on") does not have a unique ID, therefore its settings cannot be managed from the UI.

That anything to be worried about? No errors in the YAML; is it possible I deleted something by accident? Thanks again @ptdalen you the real hero.

PS loved browsing through your code on GitHub but would really love some videos highlighting all your hard work in action. Don’t know if that exists anywhere. Happy New Year!

Just came across this and very intrigued about playing around with it. Hopefully someone can answer one quick question since I haven’t had a chance to really dive in and see how the functionality of this is all put together.

The lock codes that are entered within the yaml package: Are they also stored within the lock itself or do they just live within the HA entities? My concern is if HA goes down from a power outage, are the codes stored in this scripting still going to generate the lock(s) to open?

Your codes are stored in the lock.

Is it possible to retrieve the existing codes from the locks in HA or would we effectively need to start over and enter the codes in HA again?

Depends on your lock.

I have the Schlage BE469.

I don’t believe that lock allows you to read the code slots.

Ok, thank you.

I’m having some strange behavior from the Notify_Front_Door_Lock automation and trying to figure out how I can trouble shoot. I think it’s coming from 2 lines in the front_door_report sensor which I can’t quite figure out how they work.

PROBLEM:
I’m getting duplicate notifications about 6 minutes apart when the door is unlocked with a code. When the door is first unlocked I get the correct notification with accurate front_door_report information.

After 5 minutes of the door being closed I have an automation which locks the deadbolt and I can see the front_door_report sensor correctly changing to “HA lock” but after 33 seconds it changes back to the original report showing who unlocked the door with the code which (I think) then re-triggers the notify automation.

Any ideas on what I should be looking for / where I might find the problem? Thanks.

Looking in the Logbook I see the following:
Notify on Unlock (Front Door) has been triggered by sensor.front_door_report via template
9:00:00 AM - 1 hour ago
Front Door Report changed to Keypad Unlock with Code 3 (ASegel)
9:00:00 AM - 1 hour ago
Front Door Report changed to HA Lock by Front Door auto lock
8:59:27 AM - 1 hour ago
Front Door was locked by Front Door auto lock
8:59:27 AM - 1 hour ago
Front Door auto lock has been triggered by state of binary_sensor.front_door_open_sensor
8:59:24 AM - 1 hour ago
Time changed to 08:59
8:59:00 AM - 1 hour ago
Notify on Unlock (Front Door) has been triggered by sensor.front_door_report via template
8:54:17 AM - 1 hour ago
Front Door was unlocked
8:54:17 AM - 1 hour ago

One strange finding is that at 8:54:17 I see front_door_report changing states in the History but not the logbook. Not sure why.

Notify Automation:

  - alias: Notify on Unlock (Front Door)
    initial_state: true
    trigger:
    - platform: template
      value_template: "{{ states.sensor.front_door_report.state.lower().startswith('keypad unlock') }}"
    condition:
      - condition: state
        entity_id: 'input_boolean.allow_zwave_automation_execution'
        state: 'on'  
    action:
    - delay:
        seconds: 1
# This will set a a friendly name of whoever unlocked the door to input_text.front_door_code, use in other automations if you wish
    - service: input_text.set_value
      data_template:
        entity_id: input_text.front_door_code
        value: >
          {% set number = states('sensor.front_door_deadbolt_alarm_level') %}
          {% set entity_id = 'input_text.door_keypad_' + number + '_name' %}
          {% set user = 'Master' if number == '0' else states(entity_id) %}
          {{ user }}
    - condition: template
      value_template: >-
        {% set code_used = states('sensor.front_door_deadbolt_alarm_level') %}
        {% set notify_input_object_id = 'code_' ~ code_used ~ '_notify' %}
        {{ states['input_boolean'][notify_input_object_id].state == 'on' }}
    - service: notify.mobile_app_garrett_iphone11
      data_template:
        title: "Front Door Unlocked"
        message: >-
           by {{ states.input_text.front_door_code.state }} at {{ as_timestamp (now()) | timestamp_custom('%I:%M %p') }} 

front_door_report sensor: (only the 2 lines in question)

 {% set alarm_type_value = '24' if (as_timestamp(now())-as_timestamp(states.lock.front_door.last_changed)) < 15 and (as_timestamp(now())-as_timestamp(states.sensor.front_door_deadbolt_alarm_type.last_changed)) > 15  and (states.lock.front_door.state) == 'locked' else alarm_type_value %}
 {% set alarm_type_value = '25' if (as_timestamp(now())-as_timestamp(states.lock.front_door.last_changed)) < 15 and (as_timestamp(now())-as_timestamp(states.sensor.front_door_deadbolt_alarm_type.last_changed)) > 15  and (states.lock.front_door.state) == 'unlocked' else alarm_type_value %}
          

front_door_report sensor: (all lines)

sensor:
  - platform: template
    sensors:
      front_door_report:
        friendly_name: 'Front Door Report'
        value_template: >
          {% set number = states('sensor.front_door_deadbolt_alarm_level') %}
          {% set alarm_type_value = states('sensor.front_door_deadbolt_alarm_type') %}
          {% set entity_id = 'input_text.door_keypad_' + number + '_name' %}
          {% set user = 'Master' if number == '0' else states(entity_id) %}
          {% set alarm_type_value = '24' if (as_timestamp(now())-as_timestamp(states.lock.front_door.last_changed)) < 15 and (as_timestamp(now())-as_timestamp(states.sensor.front_door_deadbolt_alarm_type.last_changed)) > 15  and (states.lock.front_door.state) == 'locked' else alarm_type_value %}
          {% set alarm_type_value = '25' if (as_timestamp(now())-as_timestamp(states.lock.front_door.last_changed)) < 15 and (as_timestamp(now())-as_timestamp(states.sensor.front_door_deadbolt_alarm_type.last_changed)) > 15  and (states.lock.front_door.state) == 'unlocked' else alarm_type_value %}
          {% set alarm_type_general_actions = {
            '0':'No Status Reported',          
            '9':'Jammed',
            '17':'Jammed',
            '21':'Manual Lock',
            '22':'Manual Unlock',
            '23':'Jammed',
            '24':'HA Lock',
            '25':'HA Unlock',
            '26':'Jammed',
            '27':'Auto Lock',
            '32':'All Codes Deleted',
            '161':'Bad Code Entered',
            '167':'Battery Low',
            '168':'Battery Critical',
            '169':'Battery Too Low To Operate Lock' } %}
          {% set alarm_type_lock_actions = {
            '18':'Keypad Lock',
            '19':'Keypad Unlock',
            '162':'Lock Code Attempt Outside of Schedule' } %}
          {% set alarm_type_code_actions = {
            '33':'Code Deleted',
            '112':'Code Changed',
            '113':'Duplicate Code' } %}
          {% if alarm_type_value in alarm_type_code_actions %}
            {{ alarm_type_code_actions[alarm_type_value] }} (Code {{ number}})
          {% elif alarm_type_value in alarm_type_lock_actions and number == '0' %}
            {{ alarm_type_lock_actions[alarm_type_value] }} with Schlage Button
          {% elif alarm_type_value in alarm_type_lock_actions  %}
            {{ alarm_type_lock_actions[alarm_type_value] }} with Code {{ number }} ({{ user }})
          {% elif alarm_type_value in alarm_type_general_actions %}
            {{ alarm_type_general_actions[alarm_type_value] }}
          {% else %}
            Unknown Alarm Type Value {{ states('sensor.front_door_deadbolt_alarm_type') }}
          {% endif %}

auto_lock automation:

- id: '1609386460351'
  alias: Front Door auto lock
  description: ''
  trigger:
  - platform: state
    entity_id: binary_sensor.front_door_open_sensor
    to: 'off'
    for: 00:05:00
  condition:
  - condition: device
    device_id: b7c9d09c2276e372b9da7db339f76443
    domain: lock
    entity_id: lock.front_door
    type: is_unlocked
  action:
  - service: lock.lock
    data: {}
    entity_id: lock.front_door
  mode: single

I’m having two issues with implementing… and keep in mind, I’m brand-new to this:

  1. I don’t know why input_boolean.allow_zwave_automation_execution is preventing this from running. My OZW network is running & healthy.
  2. I renamed both of my two Kwikset 914 locks when I added them. I don’t know why one is recognized and the other isn’t… and I don’t know what to rename the references in the dashboard to get the 2nd lock to work. I deleted the third one in the raw editor.

Any ideas?

Is there a way to roll this install back? I’ve removed the *.yaml files from the packages folder and deleted the Lovelace dashboard… but the timer, text, input select, etc. entities still remain. It doesn’t appear to be possible to remove them via the UI.

Thanks!

Restart HA core. It won’t delete them until it re-initializes the helpers.

1 Like

Thanks. I did a reboot of the RPi and they remained… so I just went through and manually deleted them one-by-one.

1 Like

sorry if this is mentioned somewhere else, but does this work with Zwave JS now that it is available in add-ons?

I liked this one much better, as I have many locks and User-based is more efficient than Lock-based.

If a user want to change a code, your’s is a single change - Key master I have to change in every lock…

Unless there is a method to use Keymaster I’m unaware of.

The parent/child lock setup syncs codes across locks.

I was wondering the same. I was hoping I would just have to rename the entities to match but entities belonging to the devices completely changed after migrating to Z-Wave JS. The enabled entities when I switched were binary sensors. There were some disabled sensor entities that I enabled and renamed to match the old package (along with updating from zwave to zwave_js in the package and lovelace) but I couldn’t get it to work.

I love this lock package and it is the main reason I bought additional locks for all doors. I restored a previous snapshot for now but I really hope there is a way to get it to work with Z-Wave JS.

I have the parent/child setup, but not sure that fits my (highly unique) use case. I have 5 bedrooms with only 4 kids living at home ATM.

My youngest is on the ASD, so we have locks on most doors to keep him safe and out of older kids’ rooms and unable to elope easily. Son is a fucking ninja, so automation has developed into a must-have vs neat-to-have.

I loved the Lock Manager on Hubitat, where I only managed Users/Codes, and clicked which locks to assign them to. That way, older/adult children, therapists, maids, etc have access to every lock, younger ones have access to their own and required ones, etc.

Anyway to get similar functionality with this awesome app?