Schlage Connect Locks - HA Integration Needs Attention

this should work for autolocking your door after 9pm if left unlocked for 10 mins - be sure to change ‘your_lock’ with the name of your lock :slight_smile:

automation:
- id: 'lock_after_10_mins_when_ after_9pm'
  alias: 'lock after 10 mins when after 9pm'
  trigger:
    platform: state
    entity_id: lock.your_lock
    to: 'unlocked'
    for:
      minutes: 10
  condition:
    condition: time
    after: '21:00:00'
  action:
    service: lock.lock
    entity_id: lock.your_lock
3 Likes

The packages folder contains 95% of my locks configuration. You will find a few automations for locks in my automations yaml as well

3 Likes

Oh man, this is the best.

Stuff like this makes me so excited to get more involved in building all this HA fun.

1 Like

I’m going to try to install @ptdalen 's door-locks.yaml package soon, one question though: is there a Lovelace UI config available for it already? Im not using the old UI config, just Lovelace, has anyone have a template for this lock package on Lovelace? Would be great!

Hmm I planned on the same attempt (although I have kwikset locks not Schlage it should work…) I hadn’t even considered Lovelace as a factor?

Circling back to changing the code length, I’m testing @ptdalen’s lock package right now and I don’t see the option of changing the code length (the amount of digits for user codes), don’t see anything in the code either. I know it will reset all codes when you do but it would be great if this was added. Is this in the pipeline still? How would I add that feature? Thank you for all the work and sharing it.

You can change the code length under “Configuration -> Zwave” find the lock and then under settings you should find many possible settings, one of which is code length. Like you already noticed, changing the length, will erase all codes. I was working on getting this in my package, but felt like these kinds of settings are usually something you’d set up once, and leave, and had a higher possibility that someone would erase their codes accidentally. Also, might just be me, but the only time I ever have issues with my locks is when I’m changing Zwave settings. Not every time, but sometimes.

I have not gotten into lovelace too much yet, but love the idea. If anyone puts something together, please share. :slight_smile:

1 Like

@ptdalen I don’t want to jinx it but I think I just got your door lock package working and I am THRILLED. I’m a noob to all of this but your code was so clean and well commented that even I was able to figure it out which is no small feat. Pro tip for anyone following this thread @ptdalen created one and two lock versions of his code so you don’t have to spend a bunch of time deleting extra locks and associated code (like I did before noticing it was available)

Three questions…

  1. It added 30 ungrouped sensors up along the top of my UI for keypad 1-15. “Turn keypad 1 off”, “Turn keypad 1 on”, “Turn keypad 2 off”, etc. What are those and did I mess something up to make them ungrouped? entity_id is “sensor.keypad_1_temp_lock_turn_off”

  2. Has anyone had success using this with the ios notify component? I’m sure I need to change something in the message title template but I’m at a loss on where to start.

       - service: notify.ios_garrett_iphone
         data_template:
           message: >-
             {% set object_id = trigger.to_state.object_id %}
             {% set code_slot = object_id[7:-18] %}
             {% set usercode_input = 'door_keypad_' ~ code_slot ~ '_code' %}
             {% set usercode = states['input_text'][usercode_input].state %}
             {% set name_input = 'door_keypad_' ~ code_slot ~ '_name' %}
             {% set name = states['input_text'][name_input].state %}
             {% set start_input = 'door_keypad_' ~ code_slot ~ '_date_start' %}
             {% set start = states['input_datetime'][start_input].state %}
             {% set end_input = 'door_keypad_' ~ code_slot ~ '_date_end' %}
             {% set end = states['input_datetime'][end_input].state %}
             The pin code {{ usercode }} is now temporarily enabled for {{ name }} from {{ start }} to {{ end }}.
    
           title: >-
             {% set object_id = trigger.to_state.object_id %}
             {% set code_slot = object_id[7:-18] %}
             {% set switch_input = 'door_keypad_' ~ code_slot ~ '_front_switch' %}
             {% set switch_name = states['input_boolean'][switch_input].attributes.friendly_name %}
             Beach House: Temporary code enabled on {{ switch_name }}
    
  3. Executing the Delete Door Code command isn’t working for me right now. I’ll dig a little deeper into the thread and see if others have had the same problem. I’m using a Schlage BE469.

UPDATE Looks like I need to try and update zwave; currently stumbling around trying to figure out how to do that.

Really really appreciate all the work you put into this. Can’t thank you enough!

I just looked at how the groups are made in the old ui and recreated them in lovelace with entity cards. Here is one page I created for the lock codes. I have configuration menu and status cards on a different page, but I think you get the idea.

  • title: Lock
    panel: true
    icon: mdi:lock-smart
    id: doorlock
    cards:
    • type: custom:layout-card
      layout: horizontal
      cards:
      • type: entities
        title: Entry Code 1
        entities:

        • input_text.door_keypad_1_name
        • input_text.door_keypad_1_code
        • input_select.door_keypad_1_access_schedule
        • input_datetime.door_keypad_1_date_start
        • input_datetime.door_keypad_1_date_end
        • input_boolean.door_keypad_1_front_switch
        • script.door_keypad_1_delete
      • type: entities
        title: Entry Code 2
        entities:

        • input_text.door_keypad_2_name
        • input_text.door_keypad_2_code
        • input_select.door_keypad_2_access_schedule
        • input_datetime.door_keypad_2_date_start
        • input_datetime.door_keypad_2_date_end
        • input_boolean.door_keypad_2_front_switch
        • script.door_keypad_2_delete
      • type: entities
        title: Entry Code 3
        entities:

        • input_text.door_keypad_3_name
        • input_text.door_keypad_3_code
        • input_select.door_keypad_3_access_schedule
        • input_datetime.door_keypad_3_date_start
        • input_datetime.door_keypad_3_date_end
        • input_boolean.door_keypad_3_front_switch
        • script.door_keypad_3_delete
      • type: entities
        title: Entry Code 4
        entities:

        • input_text.door_keypad_4_name
        • input_text.door_keypad_4_code
        • input_select.door_keypad_4_access_schedule
        • input_datetime.door_keypad_4_date_start
        • input_datetime.door_keypad_4_date_end
        • input_boolean.door_keypad_4_front_switch
        • script.door_keypad_4_delete
      • type: entities
        title: Entry Code 5
        entities:

        • input_text.door_keypad_5_name
        • input_text.door_keypad_5_code
        • input_select.door_keypad_5_access_schedule
        • input_datetime.door_keypad_5_date_start
        • input_datetime.door_keypad_5_date_end
        • input_boolean.door_keypad_5_front_switch
        • script.door_keypad_5_delete
      • type: entities
        title: Entry Code 6
        entities:

        • input_text.door_keypad_6_name
        • input_text.door_keypad_6_code
        • input_select.door_keypad_6_access_schedule
        • input_datetime.door_keypad_6_date_start
        • input_datetime.door_keypad_6_date_end
        • input_boolean.door_keypad_6_front_switch
        • script.door_keypad_6_delete
      • type: entities
        title: Entry Code 7
        entities:

        • input_text.door_keypad_7_name
        • input_text.door_keypad_7_code
        • input_select.door_keypad_7_access_schedule
        • input_datetime.door_keypad_7_date_start
        • input_datetime.door_keypad_7_date_end
        • input_boolean.door_keypad_7_front_switch
        • script.door_keypad_7_delete
      • type: entities
        title: Entry Code 8
        entities:

        • input_text.door_keypad_8_name
        • input_text.door_keypad_8_code
        • input_select.door_keypad_8_access_schedule
        • input_datetime.door_keypad_8_date_start
        • input_datetime.door_keypad_8_date_end
        • input_boolean.door_keypad_8_front_switch
        • script.door_keypad_8_delete
      • type: entities
        title: Entry Code 9
        entities:

        • input_text.door_keypad_9_name
        • input_text.door_keypad_9_code
        • input_select.door_keypad_9_access_schedule
        • input_datetime.door_keypad_9_date_start
        • input_datetime.door_keypad_9_date_end
        • input_boolean.door_keypad_9_front_switch
        • script.door_keypad_9_delete
      • type: entities
        title: Entry Code 10
        entities:

        • input_text.door_keypad_10_name
        • input_text.door_keypad_10_code
        • input_select.door_keypad_10_access_schedule
        • input_datetime.door_keypad_10_date_start
        • input_datetime.door_keypad_10_date_end
        • input_boolean.door_keypad_10_front_switch
        • script.door_keypad_10_delete
      • type: entities
        title: Entry Code 11
        entities:

        • input_text.door_keypad_11_name
        • input_text.door_keypad_11_code
        • input_select.door_keypad_11_access_schedule
        • input_datetime.door_keypad_11_date_start
        • input_datetime.door_keypad_11_date_end
        • input_boolean.door_keypad_11_front_switch
        • script.door_keypad_11_delete
      • type: entities
        title: Entry Code 12
        entities:

        • input_text.door_keypad_12_name
        • input_text.door_keypad_12_code
        • input_select.door_keypad_12_access_schedule
        • input_datetime.door_keypad_12_date_start
        • input_datetime.door_keypad_12_date_end
        • input_boolean.door_keypad_12_front_switch
        • script.door_keypad_12_delete
      • type: entities
        title: Entry Code 13
        entities:

        • input_text.door_keypad_13_name
        • input_text.door_keypad_13_code
        • input_select.door_keypad_13_access_schedule
        • input_datetime.door_keypad_13_date_start
        • input_datetime.door_keypad_13_date_end
        • input_boolean.door_keypad_13_front_switch
        • script.door_keypad_13_delete
      • type: entities
        title: Entry Code 14
        entities:

        • input_text.door_keypad_14_name
        • input_text.door_keypad_14_code
        • input_select.door_keypad_14_access_schedule
        • input_datetime.door_keypad_14_date_start
        • input_datetime.door_keypad_14_date_end
        • input_boolean.door_keypad_14_front_switch
        • script.door_keypad_14_delete
      • type: entities
        title: Entry Code 15
        entities:

        • input_text.door_keypad_15_name
        • input_text.door_keypad_15_code
        • input_select.door_keypad_15_access_schedule
        • input_datetime.door_keypad_15_date_start
        • input_datetime.door_keypad_15_date_end
        • input_boolean.door_keypad_15_front_switch
        • script.door_keypad_15_delete
      • type: entities
        title: One Time Use Code 1
        entities:

        • input_select.door_keypad_16_access_schedule
        • input_text.door_keypad_16_name
        • input_text.door_keypad_16_code
        • input_boolean.door_keypad_16_front_switch
        • script.door_keypad_16_delete
      • type: entities
        title: One Time Use Code 2
        entities:

        • input_select.door_keypad_17_access_schedule
        • input_text.door_keypad_17_name
        • input_text.door_keypad_17_code
        • input_boolean.door_keypad_17_front_switch
        • script.door_keypad_17_delete
      • type: entities
        title: One Time Use Code 3
        entities:

        • input_select.door_keypad_18_access_schedule
        • input_text.door_keypad_18_name
        • input_text.door_keypad_18_code
        • input_boolean.door_keypad_18_front_switch
        • script.door_keypad_18_delete
1 Like

Care to share your status and config cards too?

Hi @garrettshannon, I’m looking to add @ptdalen component to my HA as well but haven’t been able to find the one lock version you mention. Do you have a link to it by chance? I was about to start deleting all the code for lock 2 and 3 like you did and then happened to see your response. Thanks!

It’s in the packages folder of my git hub. It’s just named with a .txt vs .yaml

Sure. Conveniently they are the first two cards on that page, so here they are.

  • title: Home
    id: home
    cards:
    • type: entities
      title: Front Door Info
      entities:

      • lock.lock_front_door_lock
      • sensor.front_door_report
      • sensor.frontdoor_code
    • type: entities
      title: Front Door Config Options
      entities:

      • input_select.lock_zwave_option_3_front
      • input_select.lock_zwave_option_4_front
      • input_select.lock_zwave_option_5_front
      • input_select.lock_zwave_option_7_front
      • input_select.lock_zwave_option_8_front
      • input_select.lock_zwave_option_9_front
      • input_select.lock_zwave_option_10_front
      • input_select.lock_zwave_option_11_front
      • input_select.lock_zwave_option_15_front
      • input_select.lock_zwave_option_16_front

wow… not sure how i missed that. I saw “door_locks.yaml” and completely didn’t see the txt files below. I was having problems with zigbee stuff and had a long night I guess. Thanks for the quick reply!

1 Like

I am SO happy to help. It’s saved as a txt file so it (I’m assuming) doesn’t interfere with his config. Thanks again @ptdalen

One Lock: https://github.com/ptdalen/home-assistant/blob/master/packages/lock_package_for_one_deadbolt.txt

Two Locks: https://github.com/ptdalen/home-assistant/blob/master/packages/lock_package_for_two_deadbolts.txt

*EDIT I was too slow :cry:

1 Like

Do you have a git hub where I can look at the yaml for these directly. Also could you possibly format your post using the formatting block.

I will say I’ve really not gotten into the lovelace yet, so thanks for taking this part on. Once I get around to it, I’ll post the lovelace in my repository as well.

I’ve kinda been working on getting my stuff up on github, but haven’t really tried, so don’t have that going yet. I thought I did use the formatting block, not sure why my dashes turned into bullet points…
I’m at work right now and won’t have access to my configs until tomorrow. I’ll try to repost then.

1 Like

Here’s a portion of my config. I’ll be adding to it as I sanitize everything.

1 Like

Btw, I split it up so I could see the config options and the info menu on my main Home page, while I have all of the granular code options on a separate page, as there are so many of them. Basically all I did was take what was a “group” in the old interface and made an Entity card of each “group” in lovelace. Just wanted to expound on what I did and why, once you get used to looking at the code and seeing what’s going on you should figure it out pretty easily.