Simplified Zwave Lock Manager is now KeyMaster

So it matches now, or do I need to still clean it up?

Yes, it matches now.

I spent a bunch of time getting this setup and made a few tweaks, thought I’d share so you can incorporate what you want. Note that I use nodered, so some of this may be because I had 0 homeassistant automations going into this. Thanks so much for putting this together! it’s great!

Outside our control; is schlage working on the code clearing issue? It’s really irritating. Especially since it won’t let you set the same code for multiple users…I was going to work around that by setting inactive codes to my default family code.

Anyways…things I changed:

  1. I commented out binary_sensor.allow_automation conditions. Those don’t exist in my HA instance afaik?

  2. I added date_time sensor. These are used and undocumented. I’d suggest adding that to the documentation, took me awhile to figure out what wasn’t working.

  3. input_boolean.lock_notifications is currently used to deliver all unlock/lock notifications. This means if I just want notifications when a temporary code is used, I have to also get manual/lock unlock notifications.

I added two new input booleans and used them as follows.

manual_lock_notifications - Used to configure whether or not to get manual lock notifications separately from general lock notifications. The new automation for lock notifications is:

    - alias: Lock Notifications
      trigger:
        platform: state
        entity_id: sensor.frontdoor_statusreport
      condition:
        #- condition: state
        #  entity_id: 'binary_sensor.allow_automation'
        #  state: 'on' 
        - condition: template
          value_template: >-
            {% set report = states.sensor.frontdoor_statusreport.state %}
            {% set a = report.split(';') %}
            {% if ((a|length) != 3 or (a[2] == "0")) and ((a[0] != "21") and ((a[0] != "22"))) %} 
              {{ true }}
            {% else %}
              {{ false }}
            {% endif %}
      action:
        - service: script.conditional_notify
          data_template:
            boolean: input_boolean.lock_notifications
            title: "Sensor Status Report"
            message: >-
              {% set report = states.sensor.frontdoor_statusreport.state %}
              {% set a = report.split(';') %}
              {% set msg = "ID:" + a[0] + " MSG:" + a[1] %}
              {% if (a|length) == 3 %}
              {%   set msg = msg + " SLOT:" + a[2] %}
              {% endif %}
              {{ a[1] }}

The manual lock notification is:

- alias: Manual Lock Notifications
      trigger:
        platform: state
        entity_id: sensor.frontdoor_statusreport
      condition:
        #- condition: state
        #  entity_id: 'binary_sensor.allow_automation'
        #  state: 'on' 
        - condition: template
          value_template: >-
            {% set report = states.sensor.frontdoor_statusreport.state %}
            {% set a = report.split(';') %}
            {% if (a|length) != 3 and ((a[0] == "21") or ((a[0] == "22"))) %} 
              {{ true }}
            {% else %}
              {{ false }}
            {% endif %}
      action:
        - service: script.conditional_notify
          data_template:
            boolean: input_boolean.manual_lock_notifications
            title: "Sensor Status Report"
            message: >-
              {% set report = states.sensor.frontdoor_statusreport.state %}
              {% set a = report.split(';') %}
              {% set msg = "ID:" + a[0] + " MSG:" + a[1] %}
              {% if (a|length) == 3 %}
              {%   set msg = msg + " SLOT:" + a[2] %}
              {% endif %}
              {{ a[1] }}

code_lock_notifications - Initializes (and stays true). Per code settings control whether the automation triggers to send the notification in the first place. This is just a change to the boolean in the data template of the automation to input_boolean.code_lock_notifications.

You might want to restore that and create the sensor. I use it to disable annoying messages when the system boots up. I’ll have to publish the related boot code though for it to make sense.

Any chance of getting that boot code? I’d love to not have all of the annoying pop ups on start up.

Use these scripts and automations to wait until Zwave objects are finished loading, along with the input boolean as a condition so automations won’t run until Zwave initialization is finished.

# condition example
condition:
    - condition: state
      entity_id: 'binary_sensor.allow_automation'
      state: 'on' 

Create this automation:

- alias: homeassistant start-up
  initial_state: true
  trigger:
    platform: homeassistant
    event: start
  action:
    - service: script.turn_on
      entity_id: script.customstartup

And this script. (And create the input boolean). Then add the input boolean to every automation as a condition. This will prevent those automations from running until you set this input boolean to true.

customstartup:
    - service: input_boolean.turn_off
      data:
        entity_id: 'input_boolean.allow_automation_execution'
    - service: automation.turn_on
      entity_id: automation.Zwave_loaded_Start_System
    - service: timer.cancel
      entity_id:
        # list all of your timers that you don’t want running here
        - timer.frontdoor
        - timer.fireplace
    - service: script.turn_on
      entity_id: script.XXXX #run other stuff here

And this automation:

- alias: Zwave_loaded_Start_System
  initial_state: true
  trigger:
    - platform: event
      event_type: zwave.network_ready
    - platform: event
      event_type: zwave.network_complete
    - platform: event
      event_type: zwave.network_complete_some_dead
  action:
    - service: script.turn_on
      entity_id: script.system_cleanup

and this script:

system_cleanup:
  sequence:
    - service: homekit.start
    # add whatever stuff you want to run here
    - service: input_boolean.turn_on # enable automations again
      data:
        entity_id: 'input_boolean.allow_automation_execution'
2 Likes

This worked great! Thank you so much for posting this.

I understand that this was originally made for a specific schlage model, but is there any reason why it wouldn’t work for generic zwave locks? I have a yale lock I’m trying to manage with this but I’m having issues with trying to add a code.

Do different zwave locks have different alarm_type_general_actions that could cause it not to work for your implementation?

Thanks

I don’t think it will work for generic locks. @ptdalen wrote the code that I based this project on, and at the heart of it is code specific to the Schlage lock.

Although it should work for most brands of Schlage zwave. My Schlage lock died a month ago and Schlage sent me a new one free of charge. When I added the new lock into the system, I was amazed that code worked without one change. In fact the PINS I had already specified for the lock automatically got added to the locks. The only keypad programming I did was the zwave include.

The same code works on my Kwikset Zwave locks :slight_smile:

I must be doing something wrong but I’m so new to HomeAssistant I’m not sure how to debug it.

@firstof9 Did you do anything particular or had any pain points you could share to help me? :smiley:

Only thing you have to do is rename your lock(s).

Interesting. If you look in my code and find the frontdoor_statusreport sensor, you’ll see how it reads codes sent from the lock. I find it odd that companies would use the same codes. But if they’re using a standard then they should be compatible. Good to know Kwikset works though.

One thing I wish they would get right is the ability to delete a PIN, instead of just overwriting a slot with a random number. @ptdalen, is that still an issue? I’m thinking of changing my code so that when I want to delete a PIN, that I issue a “delete all codes” command and then issuing a call to examine every PIN that should be active and then change the state from enabled to disabled to enable again in order to re-add the PIN. I’m not a fan of having random PINS that will open my locks just living in the lock.

2 Likes

Great stuff. Anyone got it working with ID Lock? Does it work without Lovelace?

1 Like

UPDATE RELEASED

Just to be clear, since it’s not mentioned in this thread at all… Is forking to the updated OZW version a prerequisite to using this integration?

I’m using the standard HA release, so probably not.

I went through the setup mentioned in the Readme, but all I get is an empty tab after adding the code to lovelace. No cards or anything. Is there any other plugins besides the two mentioned that need to be added?

And just to confirm I’m doing the lovelace code right, there was no resources section so I added it after using HACS to install those two plugins.

##ui-lovelace.yaml 
title: Home
resources:
  - type: module
    url: /community_plugin/lovelace-card-tools/card-tools.js
  - type: module
    url: /community_plugin/lovelace-auto-entities/auto-entities.js
views:
  ....(Bunch of stuff on main tab, displays fine)
# Locks from FutureTense items

  - title: 'garageentry Codes and Configuration'
    path: keypad-garageentry
    icon: 'mdi:lock-smart'
    panel: false
    badges:
      - input_boolean.garageentry_lock_notifications
      - input_boolean.garageentry_dooraccess_notifications
      - input_boolean.garageentry_garageacess_notifications
      - entity: >-
          lock.schlage_allegion_be469zp_connect_smart_deadbolt_locked_garageentry
      - entity: >-
          binary_sensor._access_control_
      - entity: >-
          
    cards:
      - type: vertical-stack
        cards:
          - content: |
              ## Code 1
            type: markdown
          - type: entities
            entities:
              - entity: input_text.garageentry_name_1
              - entity: input_text.garageentry_pin_1
              - entity: input_boolean.enabled_garageentry_1
              - entity: input_boolean.notify_garageentry_1
              - type: divider
              - entity: binary_sensor.active_garageentry_1
              - type: divider
              - type: 'custom:fold-entity-row'
                head:
                  type: section
                  label: Advanced Options
                entities:
                  - entity: input_boolean.reset_advanced_garageentry_1
                  - type: divider
                  - entity: input_boolean.accesslimit_garageentry_1
                  - entity: input_number.accesscount_garageentry_1
                  - type: divider
                  - entity: input_boolean.daterange_garageentry_1
                  - entity: input_datetime.start_date_garageentry_1
                  - entity: input_datetime.end_date_garageentry_1
                  - type: divider
                  - input_boolean.sun_garageentry_1
                  - input_datetime.sun_start_date_garageentry_1
                  - input_datetime.sun_end_date_garageentry_1
                  - type: divider
                  - input_boolean.mon_garageentry_1
                  - input_datetime.mon_start_date_garageentry_1
                  - input_datetime.mon_end_date_garageentry_1
                  - type: divider
                  - input_boolean.tue_garageentry_1
                  - input_datetime.tue_start_date_garageentry_1
                  - input_datetime.tue_end_date_garageentry_1
                  - type: divider
                  - input_boolean.wed_garageentry_1
                  - input_datetime.wed_start_date_garageentry_1
                  - input_datetime.wed_end_date_garageentry_1
                  - type: divider
                  - input_boolean.thu_garageentry_1
                  - input_datetime.thu_start_date_garageentry_1
                  - input_datetime.thu_end_date_garageentry_1
                  - type: divider
                  - input_boolean.fri_garageentry_1
                  - input_datetime.fri_start_date_garageentry_1
                  - input_datetime.fri_end_date_garageentry_1
                  - type: divider
                  - input_boolean.sat_garageentry_1
                  - input_datetime.sat_start_date_garageentry_1
                  - input_datetime.sat_end_date_garageentry_1
      - type: vertical-stack
        cards:
          - content: |
              ## Code 2
            type: markdown
          - type: entities
            entities:
              - entity: input_text.garageentry_name_2
              - entity: input_text.garageentry_pin_2
              - entity: input_boolean.enabled_garageentry_2
              - entity: input_boolean.notify_garageentry_2
              - type: divider
              - entity: binary_sensor.active_garageentry_2
              - type: divider
              - type: 'custom:fold-entity-row'
                head:
                  type: section
                  label: Advanced Options
                entities:
                  - entity: input_boolean.reset_advanced_garageentry_2
                  - type: divider
                  - entity: input_boolean.accesslimit_garageentry_2
                  - entity: input_number.accesscount_garageentry_2
                  - type: divider
                  - entity: input_boolean.daterange_garageentry_2
                  - entity: input_datetime.start_date_garageentry_2
                  - entity: input_datetime.end_date_garageentry_2
                  - type: divider
                  - input_boolean.sun_garageentry_2
                  - input_datetime.sun_start_date_garageentry_2
                  - input_datetime.sun_end_date_garageentry_2
                  - type: divider
                  - input_boolean.mon_garageentry_2
                  - input_datetime.mon_start_date_garageentry_2
                  - input_datetime.mon_end_date_garageentry_2
                  - type: divider
                  - input_boolean.tue_garageentry_2
                  - input_datetime.tue_start_date_garageentry_2
                  - input_datetime.tue_end_date_garageentry_2
                  - type: divider
                  - input_boolean.wed_garageentry_2
                  - input_datetime.wed_start_date_garageentry_2
                  - input_datetime.wed_end_date_garageentry_2
                  - type: divider
                  - input_boolean.thu_garageentry_2
                  - input_datetime.thu_start_date_garageentry_2
                  - input_datetime.thu_end_date_garageentry_2
                  - type: divider
                  - input_boolean.fri_garageentry_2
                  - input_datetime.fri_start_date_garageentry_2
                  - input_datetime.fri_end_date_garageentry_2
                  - type: divider
                  - input_boolean.sat_garageentry_2
                  - input_datetime.sat_start_date_garageentry_2
                  - input_datetime.sat_end_date_garageentry_2
      - type: vertical-stack
        cards:
          - content: |
              ## Code 3
            type: markdown
          - type: entities
            entities:
              - entity: input_text.garageentry_name_3
              - entity: input_text.garageentry_pin_3
              - entity: input_boolean.enabled_garageentry_3
              - entity: input_boolean.notify_garageentry_3
              - type: divider
              - entity: binary_sensor.active_garageentry_3
              - type: divider
              - type: 'custom:fold-entity-row'
                head:
                  type: section
                  label: Advanced Options
                entities:
                  - entity: input_boolean.reset_advanced_garageentry_3
                  - type: divider
                  - entity: input_boolean.accesslimit_garageentry_3
                  - entity: input_number.accesscount_garageentry_3
                  - type: divider
                  - entity: input_boolean.daterange_garageentry_3
                  - entity: input_datetime.start_date_garageentry_3
                  - entity: input_datetime.end_date_garageentry_3
                  - type: divider
                  - input_boolean.sun_garageentry_3
                  - input_datetime.sun_start_date_garageentry_3
                  - input_datetime.sun_end_date_garageentry_3
                  - type: divider
                  - input_boolean.mon_garageentry_3
                  - input_datetime.mon_start_date_garageentry_3
                  - input_datetime.mon_end_date_garageentry_3
                  - type: divider
                  - input_boolean.tue_garageentry_3
                  - input_datetime.tue_start_date_garageentry_3
                  - input_datetime.tue_end_date_garageentry_3
                  - type: divider
                  - input_boolean.wed_garageentry_3
                  - input_datetime.wed_start_date_garageentry_3
                  - input_datetime.wed_end_date_garageentry_3
                  - type: divider
                  - input_boolean.thu_garageentry_3
                  - input_datetime.thu_start_date_garageentry_3
                  - input_datetime.thu_end_date_garageentry_3
                  - type: divider
                  - input_boolean.fri_garageentry_3
                  - input_datetime.fri_start_date_garageentry_3
                  - input_datetime.fri_end_date_garageentry_3
                  - type: divider
                  - input_boolean.sat_garageentry_3
                  - input_datetime.sat_start_date_garageentry_3
                  - input_datetime.sat_end_date_garageentry_3
      - type: vertical-stack
        cards:
          - content: |
              ## Code 4
            type: markdown
          - type: entities
            entities:
              - entity: input_text.garageentry_name_4
              - entity: input_text.garageentry_pin_4
              - entity: input_boolean.enabled_garageentry_4
              - entity: input_boolean.notify_garageentry_4
              - type: divider
              - entity: binary_sensor.active_garageentry_4
              - type: divider
              - type: 'custom:fold-entity-row'
                head:
                  type: section
                  label: Advanced Options
                entities:
                  - entity: input_boolean.reset_advanced_garageentry_4
                  - type: divider
                  - entity: input_boolean.accesslimit_garageentry_4
                  - entity: input_number.accesscount_garageentry_4
                  - type: divider
                  - entity: input_boolean.daterange_garageentry_4
                  - entity: input_datetime.start_date_garageentry_4
                  - entity: input_datetime.end_date_garageentry_4
                  - type: divider
                  - input_boolean.sun_garageentry_4
                  - input_datetime.sun_start_date_garageentry_4
                  - input_datetime.sun_end_date_garageentry_4
                  - type: divider
                  - input_boolean.mon_garageentry_4
                  - input_datetime.mon_start_date_garageentry_4
                  - input_datetime.mon_end_date_garageentry_4
                  - type: divider
                  - input_boolean.tue_garageentry_4
                  - input_datetime.tue_start_date_garageentry_4
                  - input_datetime.tue_end_date_garageentry_4
                  - type: divider
                  - input_boolean.wed_garageentry_4
                  - input_datetime.wed_start_date_garageentry_4
                  - input_datetime.wed_end_date_garageentry_4
                  - type: divider
                  - input_boolean.thu_garageentry_4
                  - input_datetime.thu_start_date_garageentry_4
                  - input_datetime.thu_end_date_garageentry_4
                  - type: divider
                  - input_boolean.fri_garageentry_4
                  - input_datetime.fri_start_date_garageentry_4
                  - input_datetime.fri_end_date_garageentry_4
                  - type: divider
                  - input_boolean.sat_garageentry_4
                  - input_datetime.sat_start_date_garageentry_4
                  - input_datetime.sat_end_date_garageentry_4
      - type: vertical-stack
        cards:
          - content: |
              ## Code 5
            type: markdown
          - type: entities
            entities:
              - entity: input_text.garageentry_name_5
              - entity: input_text.garageentry_pin_5
              - entity: input_boolean.enabled_garageentry_5
              - entity: input_boolean.notify_garageentry_5
              - type: divider
              - entity: binary_sensor.active_garageentry_5
              - type: divider
              - type: 'custom:fold-entity-row'
                head:
                  type: section
                  label: Advanced Options
                entities:
                  - entity: input_boolean.reset_advanced_garageentry_5
                  - type: divider
                  - entity: input_boolean.accesslimit_garageentry_5
                  - entity: input_number.accesscount_garageentry_5
                  - type: divider
                  - entity: input_boolean.daterange_garageentry_5
                  - entity: input_datetime.start_date_garageentry_5
                  - entity: input_datetime.end_date_garageentry_5
                  - type: divider
                  - input_boolean.sun_garageentry_5
                  - input_datetime.sun_start_date_garageentry_5
                  - input_datetime.sun_end_date_garageentry_5
                  - type: divider
                  - input_boolean.mon_garageentry_5
                  - input_datetime.mon_start_date_garageentry_5
                  - input_datetime.mon_end_date_garageentry_5
                  - type: divider
                  - input_boolean.tue_garageentry_5
                  - input_datetime.tue_start_date_garageentry_5
                  - input_datetime.tue_end_date_garageentry_5
                  - type: divider
                  - input_boolean.wed_garageentry_5
                  - input_datetime.wed_start_date_garageentry_5
                  - input_datetime.wed_end_date_garageentry_5
                  - type: divider
                  - input_boolean.thu_garageentry_5
                  - input_datetime.thu_start_date_garageentry_5
                  - input_datetime.thu_end_date_garageentry_5
                  - type: divider
                  - input_boolean.fri_garageentry_5
                  - input_datetime.fri_start_date_garageentry_5
                  - input_datetime.fri_end_date_garageentry_5
                  - type: divider
                  - input_boolean.sat_garageentry_5
                  - input_datetime.sat_start_date_garageentry_5
                  - input_datetime.sat_end_date_garageentry_5
      - type: vertical-stack
        cards:
          - content: |
              ## Code 6
            type: markdown
          - type: entities
            entities:
              - entity: input_text.garageentry_name_6
              - entity: input_text.garageentry_pin_6
              - entity: input_boolean.enabled_garageentry_6
              - entity: input_boolean.notify_garageentry_6
              - type: divider
              - entity: binary_sensor.active_garageentry_6
              - type: divider
              - type: 'custom:fold-entity-row'
                head:
                  type: section
                  label: Advanced Options
                entities:
                  - entity: input_boolean.reset_advanced_garageentry_6
                  - type: divider
                  - entity: input_boolean.accesslimit_garageentry_6
                  - entity: input_number.accesscount_garageentry_6
                  - type: divider
                  - entity: input_boolean.daterange_garageentry_6
                  - entity: input_datetime.start_date_garageentry_6
                  - entity: input_datetime.end_date_garageentry_6
                  - type: divider
                  - input_boolean.sun_garageentry_6
                  - input_datetime.sun_start_date_garageentry_6
                  - input_datetime.sun_end_date_garageentry_6
                  - type: divider
                  - input_boolean.mon_garageentry_6
                  - input_datetime.mon_start_date_garageentry_6
                  - input_datetime.mon_end_date_garageentry_6
                  - type: divider
                  - input_boolean.tue_garageentry_6
                  - input_datetime.tue_start_date_garageentry_6
                  - input_datetime.tue_end_date_garageentry_6
                  - type: divider
                  - input_boolean.wed_garageentry_6
                  - input_datetime.wed_start_date_garageentry_6
                  - input_datetime.wed_end_date_garageentry_6
                  - type: divider
                  - input_boolean.thu_garageentry_6
                  - input_datetime.thu_start_date_garageentry_6
                  - input_datetime.thu_end_date_garageentry_6
                  - type: divider
                  - input_boolean.fri_garageentry_6
                  - input_datetime.fri_start_date_garageentry_6
                  - input_datetime.fri_end_date_garageentry_6
                  - type: divider
                  - input_boolean.sat_garageentry_6
                  - input_datetime.sat_start_date_garageentry_6
                  - input_datetime.sat_end_date_garageentry_6

I’m assuming the yaml is wrong since I do see errors like the below in the logs during a restart:

Failed to set the 'adoptedStyleSheets' property on 'ShadowRoot': Sharing constructed stylesheets in multiple documents is not allowed

Is this working with zwave idlock?

1 Like

Should work with any zwave lock.