Zwave Lock Manager

Nope - still stuck. My lock is still on Smartthings. Works really well there, but I’d like to move it to HA. ZigBee seems to be a second class citizen compared to Zwave for some reason.

1 Like

So doe the lock not pair at all with HA? Just curious for the most part. If it pairs, I’d think that although it might take a bit of research, this lock manager for the most part might work.

Z wave stuff is so expensive in Australia. Locks are 500. Motion sensors are 110 each! I makes it hard to move off

I’m just asking if the zigbee lock even pairs with HA? If so what sort of sensors, locks, etc does it have?

If you try to generate a random code longer than 5 digits then range() flips out…
Here’s my fix.

      - service: lock.set_usercode
        data_template:
          usercode: >-
            {% set object_id = trigger.to_state.object_id %}
            {% set lock_name = "_".join(object_id.split("_")[3:-1]) %}
            {% set lock_id = 'lock_zwave_option_16_' ~ lock_name %}
            {%- set size = states['input_select'][lock_id].state|int -%}
            {%- if (size > 5) -%}
            {%- set size = size-5 -%}
            {%- set max = ("9" * size)|int -%}
            {%- set base = ("1" + ("0" * (size-1)))|int -%}
            {%- set usercode = range(base, max)|random -%}
            {%- set size = 5 -%}
            {%- endif -%}
            {%- set max = ("9" * size)|int -%}
            {%- set base = ("1" + ("0" * (size-1)))|int -%}
            {%- set usercode = usercode ~ range(base, max)|random -%}
            {{ usercode }}

Generate 2 smaller random numbers and string concat to get a 6, 7, or 8 digit code length.

Check this out Kwikset Zigbee Deadbolt

So where is the entry point of this thread to get started with the latest code?

I’ve been a bit busy, so the one lock and two lock packages are a bit out of date.

This is where you’ll find the packages, though. The three lock package is up to date, and can pretty easily be modified for your configuration. I do have two different kinds of locks, so lock 3 has a couple custom automations/sensors, that might not apply to you. I tried to comment well enough to make it pretty easy to understand what is going on

1 Like

Maybe you can incorporate my auto lock code. I’ll try and post it soon.

1 Like

@FutureTense please do that would be awesome.

Thank you for sharing your work with us. I wouldn’t be able to work this stuff out on my own, let alone have so many of the features of these locks integrated into HA without it.

That being said my setup isn’t exactly the same so I’ve been stumbling my way through the code ironing it out to my setup (Single FE599GR at the front door) and the comments your put in the package file are a massive help! Thank you.

There is only one feature I had issues to get working, which is the sensor.garage_door_opened state. It never updated for me. I have a work around for it and I thought I’d share it here incase any one else with this lock was having the same issue.

In:

      garage_door_code_entered:
        value_template: >-
          {% if ((as_timestamp(strptime(states.sensor.date_time.state, "%Y-%m-%d, %H:%M")) - as_timestamp(states.sensor.lock_garage_door_lock_alarm_level.last_changed)) < 1) %}
            {{ states.sensor.lock_garage_door_lock_alarm_level.state }}
          {% else %}
            0
          {% endif %}

Change to:

      garage_door_code_entered:
        value_template: >-
          {% if ((as_timestamp(states.lock.lock_garage_door_lock.last_changed) - as_timestamp(states.sensor.lock_garage_door_lock_alarm_level.last_changed)) < 1) %}
            {{ states.sensor.lock_garage_door_lock_alarm_level.state }}
          {% else %}
            0
          {% endif %}

Seems to work for me now

1 Like

Sorted it out.

I’m using the single lock code and I’m seeing the following errors in my log when I try and perform an action.

Any ideas?

home-assistant | 2019-06-26T19:32:24.451943017Z 2019-06-26 19:32:24 INFO (MainThread) [homeassistant.components.automation] Executing Keypad switch turned off
home-assistant | 2019-06-26T19:32:24.452074369Z 2019-06-26 19:32:24 INFO (MainThread) [homeassistant.helpers.script] Script Keypad switch turned off: Running script
home-assistant | 2019-06-26T19:32:24.452195185Z 2019-06-26 19:32:24 INFO (MainThread) [homeassistant.helpers.script] Script Keypad switch turned off: Executing step call service
home-assistant | 2019-06-26T19:32:24.454102668Z 2019-06-26 19:32:24 ERROR (MainThread) [homeassistant.helpers.service] Error rendering data template: UndefinedError: ‘None’ has no attribute ‘attributes’

Did you ever create a dockerfile for this? Am I correct in thinking this will not persist if the container is restarted?

Could you share your updated one lock file?

No, I unfortunately haven’t had the time. I should have time this weekend.
It should persist if the container is restarted, but not if the container is upgraded I believe.

I should probably pull my image out of Watchtower until I have a way to persist my changes.

In the github repo, what’s the difference between door_locks.yaml and lock_package_for_one_deadbolt.txt? Are both needed?

Is there a simple explanation on installing this? For example, if you create a packages directory, you can do the following, but what would you include in the packages directory?

packages: !include_dir_named packages

Should this still work on .95.4? the Home Configuration Test says it isn’t compatible with the upgrade

Doesn’t seem like you have had a reply, I just installed this and this is what I have/finding out:
From the Github Repo, you only need to pick one of these files. If you have only one deadbolt, use the lock_package_for_one_deadbolt.yaml file. If you have 3 locks, pick the door_locks.yaml file. I only have 2 locks but picked the door_locks.yaml as it seems to be the most up to date. I just commented out anything related to back door lock.

Under your config directory, create a directory called “packages”. In that directory, place your door_locks.yaml file.

The entry in your configuration.yaml file - packages: !include_dir_named packages will read anything that’s in that directory, so later on, if you find another package you like just throw it in that directory and it will be picked up automatically.

I just finished installing this package and I am on 0.95.4 and I am not seeing any issues so far, working great.