KeyMaster Z-Wave lock manager and scheduler

Did you ever talk to the folks working on the OZW beta? I’m curious about their opinion on the feasibility of actually deleting a PIN.

I have an issue open regarding usercodes here:

That helped me. Thank you very much for your help. Just one follow up, is there any global setting to avoid all new input / sensor showing up in homekit?

You’d need to setup a filter exclude for homekit.

Example:

homekit:
- filter:
    exclude_domains:
      - input_boolean
      - input_text
... 

Reference: Here

What @firstof9 said… personally I exclude everything from Apple and Google by default. The rare times I want things there, I manually include them.

1 Like

So it appears I’m not getting any notifications when the door is unlocked. I have the notification Boolean enabled. Do we need to modify the package a little to get notifications? When running the manual notification script in the UI, I get this:

Failed to call service script/frontdoor_manual_notify. Unable to find service notify/my_devices

Any help would be greatly appreciated.

Did you read the thread? Sounds like maybe something that’s been discussed.

1 Like

Yes you’ll want to modify line 118 (or around there) the line stating something similar to:

  frontdoor_manual_notify:
    sequence:
      - service_template: >-
          {% if states.input_select.notify_select.state != "" %}
            notify.{{ states.input_select.notify_select.state }}
          {% else %}
            notify.notify
          {% endif %}
        data_template:
          title: "{{title}}"
          message: "{{message}}"

Your’s will look different as I’ve modified mine, but you’ll want to change the service: notify.my_devices to whatever notification you’re using.

Thanks. Sorry, I must have missed the part where it was discussed. I was contemplating modifying something but didn’t want to screw it up if a service was missing.

I have a few ideas banging around in my head if the coding can be done in Home Assistant the way I’m thinking, it’d make the setup of this package much easier. :slight_smile:

no worries. Just check out that discussion and let us know how it goes.

Hi there, i decided to finally dive into this now that i a rewrote my entire lovelace and have moved everything except my schlage lock off of my old vera.

i’ve read the original thread for this, the readme and skimmed this new update thread.

after excluding my lock from vera, doing a factory reset, and adding it as a secure node, i see the lock fine and can add codes, clear codes, etc from the HA services developer tools.

after following the github readme exactly, i downloaded the package, did the ini setup, ran the setup.sh, and copied the lovelace data into a home in my lovelace setup.

all looks good, i get no errors on HA restarts, i can see the configs in lovelace, however, any changes i make to my Codes in lovelace, do nothing. no notifications. the only thing that seems to happen is when i check the enabled box, the status changes to connected. however, i can see that by watching the zwave live logs, nothing is being pushed to the lock.

i did add the additional input booleans and binary sensors as suggested in the readme as well as the HA automations for the custom startup and system cleanup scripts.

i took a look at the frontdoor_lock_manager_common.yaml and the automation for setting and updating the user code seems correct.

- service: lock.set_usercode
  data_template:
    node_id: >- 
      {{states.lock.schlage_allegion_be469_touchscreen_deadbolt_locked_frontdoor.attributes.node_id}}
    code_slot: >-
      {% set object_id = trigger.to_state.object_id %}
      {% set index = object_id.rfind('_') + 1 %}
      {% set code_slot = object_id[index:] %}
      {{ code_slot  }}
    usercode: >-
      {% set object_id = trigger.to_state.object_id %}
      {% set index = object_id.rfind('_') + 1 %}
      {% set code_slot = object_id[index:] %}    
      {% set codetext = 'frontdoor_pin_' + code_slot | string %}
      {% set code = states['input_text'][codetext].state %}
      {{ code | string }}

i’m not sure what is working
i didn’t see anywhere in the readme, but am i supposed to copy out the lock_manager_1.yaml etc to a different folder? i dont with my other packages and they still load fine on system start. and i would think this is fine, because all of the sensors that are created from the common and user code yamls show in my developer tools states view.

[EDIT] as a note i am running 0.111.4
OK, my binary sensor templates for system ready and allow automations were missing the second {} brackets.

still not getting any notifications though.

ok. so i read up a little more, and removed the initial: on from the days of the week as @firstof9 reported and changed the notification script to use my specific notifications.

after making those changes in tandem with fixing my binary sensors templates to fix my typos, all seems to be working now!

seems like my zwave starts slower now that the lock is directly in HA, but not a big deal. maybe an extra minute or 2 max.

TYVM for the hard work put into this. there’s no way i would have been able to do this on my own from scratch, especially the backend.

time to work on sprucing my lovelace config to see if i can design a way to load faster.

not sure if it’ll work, but i’m wondering if i limit the view to have just button cards for each user code, and only load the rest for that user code in a browser mod popup when tapped to see how that will affect performance. i’ll work on it and report back

1 Like

That is an interesting idea, on our front door we have 9 codes so that pages loads slow. I was thinking of multiple ways to speed things up. These are just some ideas, that would work for me but not sure about others:

  1. Allow a lock mirror setting. Since I have 3 smart locks, I was thinking what if for backdoor and garage I could set them as Mirror Front door. Then the automation to update the front door would mirror to the other x locks.

  2. Only supporting the advanced features on a few lock slots, so maybe only have the pop out detail for slots 7, 8, 9. I actually only use those settings on 2 code slots, maybe 3.

Both of these would limit the total custom fields that are being used in HA. Which would be a huge unclutter from my entity database :slight_smile:

1 Like

the entity database doesn’t seem to be an issue to me. i block many of the frivolous entities from being recorded. the main thing is the page load time on the front end. and before i added the lock manager yesterday, with the most recent updates to 0.111.4, the frontend has been super snappy. the big thing is loading all of those entities. i’ve done well to limit my views and only load what is necessary.

i’m not positive, but it seems like the more info popup information only loads when clicked/tapped. at least it does on the regular more info (when you click, that is when it queries the history engine to populate the recent state history). i’m going to work on this a little today and will let everyone know if it made a difference.

for other parts of my UI i’ve migrated a lot of stuff that used to be preloaded (and clutter the UI) like my server monitoring info (cpu,ram, disk use, etc). i changed to now just have button cards with a connected/disconnected state, and when i tap i get a browser mod-popup with bar-cards and entity list of the health in realtime. looks good and keeps the main page decluttered.

Wow. my assumptions were correct. reducing my ‘lock-manager’ view to just have button cards with browser-mod popups drastically sped up my loading on my phone. before it would take at least 10 seconds to load the view that @FutureTense provides in his package

now it’s about a 1 sec delay to load the page and maybe a 1-2 sec delay for any code to load. but i noticed, once i loaded one of the codes, the images cached and the subsequent popups were almost instant!

time to make it prettier and clean it up more now that it is functional. probably add some more folding rows to hide the days of the week as i won’t be using those most of the time.

access count and date range will probably be the most used. (though if my wife forces me now that i have this cool way to manage the lock, might need to do the day of the week for maid service (ugh, lazy :slight_smile: ) )
note, i also use lovelace_gen to keep my config files small

20200630_132834

I did some testing with the new ozw beta, looks like I was able to get a usercode to delete in my Kwikset lock now. :tada:

Wow that is very cool. Mind sharing your new yaml when you get it tweaked?

sure thing. i need to fix a few ui things that i broke last night and i’ll post up later today.

i tried using more nested fold-entity-rows for the days of the week config part. on the desktop browser, browser mod doesn’t do a good job of expanding the popup, so it cuts off some of the days, even after expanding others. not quite sure if/how i will be able to correct that. the workaround is to zoom out. i’ll need to dig into that at a later date.

however, in the mobile phone, there are no issues with this and the popup displays properly in the app (i use companion app on my android phone) as well as expands with scroller. since i’ll most likely use my phone for whenever i need to change or update a code, i don’t see the issue i’m dealing with on the desktop or tablets, being an issue for me, but i feel it’s worth mentioning for others.

OK. i’m happy with what i have now. this i gonna be a long post.

My config is broken up into many files and I heavily leverage lovelace_gen and button-card templates to keep things small. I also use layout-card fairly heavily to get the dynamic page sizes so things look nice on desktop/tablet as well as mobile. a lot of inspiration from dwains-theme in my config

So my system overview page i have a “lock manager card” per se that keeps overview things for this package neat.


the code from inside that page is here

          
          # ---------------------------------
          # ----- LOCK MANAGER
          # ---------------------------------
          #- break
          - type: vertical-stack
            cards:
              - type: markdown
                content: |
                  ## Lock Manager
                  ---
              # Lock Manager Status Buttons    
              - !include ../champs-lovelace/cards/more-page/lock-manager-status-buttons.yaml
              
              - type: custom:restriction-card
                restrictions:
                  pin:
                    code: !secret restriction_card_pin_code
                  block:
                    exemptions:
                      - user: !secret user_id
                card:
                  type: custom:button-card
                  icon: mdi:lock-smart
                  name: Front Door Codes and Configuration
                  template: lock_manager_button
                  tap_action:
                    action: navigate
                    navigation_path: /champs-theme-ng/keypad-frontdoor

              # Lock Manager Overrides
              - !include ../champs-lovelace/cards/more-page/lock-manager-overrides.yaml   
                    

the status buttons and overrides section in the above code block are below

lock-manager-status-buttons.yaml:

# lovelace_gen

type: horizontal-stack
cards:
  - type: custom:button-card
    entity: binary_sensor.system_ready
    template: lock_manager_button
    show_state: false
  - type: custom:button-card
    entity: binary_sensor.allow_automation
    template: lock_manager_button
    show_state: false

lock-manager-overrides.yaml:

# lovelace_gen

type: vertical-stack
cards:
  - type: custom:mod-card
    style: |
      ha-card {
        background-color: var(--champs-theme-primary);
        padding-right: 20px;
        padding-bottom: 10px;
        border-radius: 10px;
      }
    card:    
      type: custom:fold-entity-row
      head:
        type: section
        label: Notification Override 
      entities:
        - entity: input_boolean.frontdoor_lock_notifications
        - entity: input_boolean.frontdoor_dooraccess_notifications
  - type: custom:mod-card
    style: |
      ha-card {
        background-color: var(--champs-theme-primary);
        padding-right: 20px;
        padding-bottom: 10px;
        border-radius: 10px;
      }
    card:  
      type: custom:fold-entity-row
      head:
        type: section
        label: Lock Manager Override
      entities:
        - entity: input_boolean.system_ready  
        - entity: input_boolean.allow_automation_execution

lock_manager_button button-card template:

lock_manager_button:
  size: 25px
  show_state: true
  show_name: true
  styles:
    grid:
      - grid-template-areas: '"n" "i" "s"'
      - grid-template-columns: 1fr
      - grid-template-rows: min-content min-content min-content min-content
    card:
      - background-color: var(--champs-theme-primary)
      - border-radius: 10px
    name:
      - font-size: 14px
      - color: var(--champs-theme-names)
    state: 
      - font-size: 14px
    icon:
      - padding-bottom: 10px

  tap_action:
    action: none

Then, on my actual lock-manager page that the Front Door Codes and Configuration button navigates to looks like the images below. here i’m using button-card and button-card templates as well as browser-mod for the popups




lock-manager-lovelace.yaml

# lovelace_gen

###################################
#----------------------------------
#---- Lock Manager ----------------
#----------------------------------
###################################

- title: 'FrontDoor Codes and Configuration'
  path: keypad-frontdoor
  background: var(--background-image)
  icon: 'mdi:lock-smart'
  panel: true
  cards:
    # Main Container
    - type: custom:mod-card
      style: |
        ha-card {
          max-width: 1465px;
          padding: 10px;
          padding-bottom: 50px;
          margin: 10px auto;
        }
      card:
        type: vertical-stack
        cards:
          # start homepage header
          - type: custom:mod-card
            style: |
              ha-card {
                padding: 0px;
               background-color: var(--champs-theme-primary);
                --ha-card-background: transparent;
                border-radius: 10px;
                overflow: hidden;
              }
              @media only screen and (min-width: 1025px) {
                ha-card {
                  margin-top: 25px;
                  padding-top: 15px;
                  padding-bottom: 10px;
                }
              }
            card:
              type: custom:layout-card
              layout: horizontal
              column_width: 100%
              cards:
                #Header
                - !include
                  - ../partials/header.yaml
                  - title: Front Door Codes and Configuration
                    navigation_path: more-page

          - type: vertical-stack
            cards:
              # Lock Manager Status Buttons
              - !include ../champs-lovelace/cards/more-page/lock-manager-status-buttons.yaml
              
              # Lock Manager Overrides
              - !include ../champs-lovelace/cards/more-page/lock-manager-overrides.yaml

              # Lock Code Configuration
              - type: markdown
                content: "## Lock Code Config"
              - type: custom:layout-card
                layout: horizontal
                min_columns: 3
                cards:
                  - type: custom:button-card
                    name: "Code 1"
                    entity: binary_sensor.active_frontdoor_1
                    template: lock_manager_button
                    tap_action:
                      !include ../champs-lovelace/views/popups/lock-manager/code-1.yaml  
                  - type: custom:button-card
                    name: "Code 2"
                    entity: binary_sensor.active_frontdoor_2
                    template: lock_manager_button
                    tap_action:
                      !include ../champs-lovelace/views/popups/lock-manager/code-2.yaml
                  - type: custom:button-card
                    name: "Code 3"
                    entity: binary_sensor.active_frontdoor_3
                    template: lock_manager_button
                    tap_action:
                      !include ../champs-lovelace/views/popups/lock-manager/code-3.yaml
                  - type: custom:button-card
                    name: "Code 4"
                    entity: binary_sensor.active_frontdoor_4
                    template: lock_manager_button
                    tap_action:
                      !include ../champs-lovelace/views/popups/lock-manager/code-4.yaml
                  - type: custom:button-card
                    name: "Code 5"
                    entity: binary_sensor.active_frontdoor_5
                    template: lock_manager_button
                    tap_action:
                      !include ../champs-lovelace/views/popups/lock-manager/code-5.yaml
                  - type: custom:button-card
                    name: "Code 6"
                    entity: binary_sensor.active_frontdoor_6
                    template: lock_manager_button
                    tap_action:
                      !include ../champs-lovelace/views/popups/lock-manager/code-6.yaml
                  - type: custom:button-card
                    name: "Code 7"
                    entity: binary_sensor.active_frontdoor_7
                    template: lock_manager_button
                    tap_action:
                      !include ../champs-lovelace/views/popups/lock-manager/code-7.yaml
                  - type: custom:button-card
                    name: "Code 8"
                    entity: binary_sensor.active_frontdoor_8
                    template: lock_manager_button
                    tap_action:
                      !include ../champs-lovelace/views/popups/lock-manager/code-8.yaml
                  - type: custom:button-card
                    name: "Code 9"
                    entity: binary_sensor.active_frontdoor_9
                    template: lock_manager_button
                    tap_action:
                      !include ../champs-lovelace/views/popups/lock-manager/code-9.yaml
                  - type: custom:button-card
                    name: "Code 10"
                    entity: binary_sensor.active_frontdoor_10
                    template: lock_manager_button
                    tap_action:
                      !include ../champs-lovelace/views/popups/lock-manager/code-10.yaml
        

and each code popup is basically identical just referencing the appropriate code number entities. below is the code-10.yaml

# lovelace_gen

# popup for code config
haptic: heavy
action: call-service
service: browser_mod.popup
service_data:
  title: 'Code 10'
  style:
    background: var(--champs-theme-primary)
  card:
    type: entities
    show_header_toggle: false
    entities:
      - type: divider
      - entity: input_text.frontdoor_name_10
      - entity: input_text.frontdoor_pin_10
      - entity: input_boolean.enabled_frontdoor_10
      - entity: input_boolean.notify_frontdoor_10
      - type: divider
      - entity: binary_sensor.active_frontdoor_10
        state_color: true
      - type: divider
      - type: 'custom:fold-entity-row'
        head:
          type: section
          label: Advanced Options
        entities:
          - entity: input_boolean.reset_codeslot_frontdoor_10
          - type: divider
          - entity: input_boolean.accesslimit_frontdoor_10
          - entity: input_number.accesscount_frontdoor_10
          - type: divider
          - entity: input_boolean.daterange_frontdoor_10
          - entity: input_datetime.start_date_frontdoor_10
          - entity: input_datetime.end_date_frontdoor_10
          - type: divider
      - type: custom:fold-entity-row
        head:
          type: section
          label: 'Day of Week Access Breakdown'
        entities:
          - type: custom:fold-entity-row
            head:
              type: section
              label: 'Sun'
            entities: 
              - input_boolean.sun_frontdoor_10
              - input_boolean.sun_inc_frontdoor_10
              - input_datetime.sun_start_date_frontdoor_10
              - input_datetime.sun_end_date_frontdoor_10
          - type: custom:fold-entity-row
            head:
              type: section
              label: 'Mon'
            entities: 
              - input_boolean.mon_frontdoor_10
              - input_boolean.mon_inc_frontdoor_10
              - input_datetime.mon_start_date_frontdoor_10
              - input_datetime.mon_end_date_frontdoor_10
          - type: custom:fold-entity-row
            head:
              type: section
              label: 'Tues'
            entities: 
              - input_boolean.tue_frontdoor_10
              - input_boolean.tue_inc_frontdoor_10
              - input_datetime.tue_start_date_frontdoor_10
              - input_datetime.tue_end_date_frontdoor_10
          - type: custom:fold-entity-row
            head:
              type: section
              label: 'Weds'
            entities: 
              - input_boolean.wed_frontdoor_10
              - input_boolean.wed_inc_frontdoor_10
              - input_datetime.wed_start_date_frontdoor_10
              - input_datetime.wed_end_date_frontdoor_10
          - type: custom:fold-entity-row
            head:
              type: section
              label: 'Thurs'
            entities: 
              - input_boolean.thu_frontdoor_10
              - input_boolean.thu_inc_frontdoor_10
              - input_datetime.thu_start_date_frontdoor_10
              - input_datetime.thu_end_date_frontdoor_10
          - type: custom:fold-entity-row
            head:
              type: section
              label: 'Fri'
            entities: 
              - input_boolean.fri_frontdoor_10
              - input_boolean.fri_inc_frontdoor_10
              - input_datetime.fri_start_date_frontdoor_10
              - input_datetime.fri_end_date_frontdoor_10
          - type: custom:fold-entity-row
            head:
              type: section
              label: 'Sat'
            entities: 
              - input_boolean.sat_frontdoor_10
              - input_boolean.sat_inc_frontdoor_10
              - input_datetime.sat_start_date_frontdoor_10
              - input_datetime.sat_end_date_frontdoor_10
        
          
  deviceID:
    - this

the only other thing i might do is add the code user name to the button card, but yeah, overall. loving this package. hope this helps inspire others. I sure have had a ton of inspiration from those brighter than me on this forum over the years.

cheers!

3 Likes