Zwave Lock Manager

I’m just looking at installing this on my Docker instance. What changes did you need to make?

Sorry for the late reply. I’m using compose so I mounted my /home volume in my docker container just to expose some directory to make it easier.

cd to the mounted volume on your host system.

Clone his repo:
git clone -b hass https://github.com/ptdalen/open-zwave (or use your own updated git fork)

Run these commands:
export LOCAL_OPENZWAVE=/home/open-zwave/
pip uninstall -y homeassistant-pyozw==0.1.2 (or whatever the current version is)
pip install homeassistant-pyozw==0.1.2 --no-cache-dir --no-deps --install-option="–flavor=dev" (make sure to match the version of pyozw)

Restart your home assistant container.

You could also easily create a dockerfile to do all of this. I’ll do that when I have some time.

1 Like

Oh wow, I guess I need to read the thread a little more extensively. I didn’t see anything about needing a custom open-Zwave def branch fork! Is this just for specific lock models or all? I have an older Yale YRD-110 lock.

You should not need the fork for Yale.

I’m trying to use this with my kwikset (910 or 912 i don’t recall exactly). and both deleting and setting does not seem to work, i don’t know what logs or info anyone would need to help, so please let me know if anyone has ran into this issue

Can you set/clear codes manually using the zwave control panel?

I can set them from the zwave panel, but not able to clear. i will check when i get home if setting to zeroes blanks it or if zeroes get into my house.

I’ve also figured out the issue initially. the lock_id that is created did not match my object_id for the lock.

Another question, should the input text field for the code be reading FROM the lock? or does it just write to it.

Only writes. Cannot read the codes from the locks. probably a zwave security reason. Yes, try setting four 0’s and see if it clears the code or sets a code to 0000

Settings 0s on KwikSet locks does not work. You need to random gen and overwrite a code once you program it in.

actually i did get it to work. i set it to a number above 8 digits.

so “x\0x\0x\0x\0x\0x\0x\0x\0x\0”

and it stored it, and the code doesn’t work.

so it sort of clears it. it will work for me :slight_smile:

2 Likes

Nice I’ll give it a shot.

So did some more digging, it looks like my lock doesn’t allow any code to be the same in another slot.

so me setting a user code to “\x30\x30\x30\x30\x30\x30\x30\x30” works in stopping it from being used, but i have to set the next one to “\x30\x30\x30\x30\x30\x30\x30\x31” in order for it to save correctly.

@ptdalen for the code that you have setting the value to a random number, how would i code it to tell it to set the value t o 6 zeros + the code slot number?

so if i am clearing or removing the user code slot #4 i want the usercode to be “00000004”

Just to make sure I’m understanding. The goal is to clear codes. Setting to 0000 does not clear the codes for your lock (KwikSet) slot? Just asking because if it all works, setting a code slot to 0000, regardless of how many digits the lock takes, is supposed to clear the slot. With that said setting 0000 has been buggy for a lot of locks, but mostly schlage and sound like also KwikSet. Personally I would just go for a totally random number in that case. If you’re using 8 digit codes, the chances of someone getting lucky and guessing a random code would be very small. Also if you think about it. Let’s say I have 10 codes that I usually keep full time (family and friends), then I set a slot or two from time to time for others, then reset them later. At most I’d have 2-3 “unknown” random codes. Even if I reset it 100’s of times. More likely the codes of friends and family members would be easier to guess. I know my schlage goes into a “time out” period after 3 failed attempts.

With that said, I’m interested in learning about KwikSet. So are you saying if you set 6 0’s followed by a #4 that is clears out slot 4, or are you setting slot 4 to a code of 0000004.

Setting it to anything under 7 digits will actually set the code to that value, and my door accepts it. anything above 8 digits will store the value as is, but doesn’t work on the door itself.

My concern of going completely random, is there is a chance it can try to write the same number (very low chance). If it attempts to set it to a number that exists, it will not update the user code.

Any number of digits between 8-10 digits stores the value of what you say. but the code stored does not work in the door.

so if i set slot 3 to “1234567890” and try the door, it yells because the code is to long for it to accept.

So i think i am just going to set 7 zeroes, following by the 1-2 digit code slot. i will have to verify it works when i get home, but i can at least set the values as i said for now.

I want to correct my above statement. i can only set the code slot value to a maximum of 8 digits, i tried 9 and 10 digits and it just reverts back to the previous value

what i don’t remember is if my door accepted 6 digit codes at max or 7. If i recall when i tested, it allowed up to 7, even though the documentation said 4-6. and so setting it to an 8 digit value kind of causes the door to not process the code

I dont have the template checker available, but this is the code you’d want to change

      - service: lock.set_usercode
        data_template:
          usercode: >-
            {% set object_id = trigger.to_state.object_id %}
            {% set user_code = ENTER 6 OR 7 NUMBERS HERE "_".join(object_id.split("_")[2:-2]) %}
            {{  user_code }}
			
          node_id: >-
            {% set object_id = trigger.to_state.object_id %}
            {% set lock_name = "_".join(object_id.split("_")[3:-1]) %}
            {% set lock_id = 'lock_' ~ lock_name ~ '_door_lock' %}
            {{ states['lock'][lock_id].attributes.node_id }}

          code_slot: >-
            {% set object_id = trigger.to_state.object_id %}
            {% set code_slot = "_".join(object_id.split("_")[2:-2]) %}
            {{ code_slot }}

Basically you want to modify the usercode section to append the codeslot to the end. Should be pretty easy, just need to play around to figure it out

I was trying to add some logic to ensure it always sets it to a 8 digit code, so if it’s user code slot 1-9 it adds an additional zero

data_template:
  usercode: >-
    {% if code_slot < 10 %}
      {% set clear_code = 1000000 %}
	{% else %}
	  {% set clear_code = 100000 %}
	{% endif %}
	{{clear_code}}

But that isn’t working for me.

try this

            {% set object_id = trigger.to_state.object_id %}
            {% set user_code = '1234567' + "_".join(object_id.split("_")[2:-2]) %}
            {{ user_code }}

it returns 12345673
when what i want is 123456783

but for 10+ codes, it should be 123456##

I was trying something like this

{% set object_id = 'door_keypad_3_front_switch' %}
{% if "_".join(object_id.split("_")[2:-2]) > 9 %}
  {% set user_code = '123456' + "_".join(object_id.split("_")[2:-2]) %}
{% elif "_".join(object_id.split("_")[2:-2]) < 10 %}
  {% set user_code = '1234567' + "_".join(object_id.split("_")[2:-2]) %}
{% endif %}
{{ user_code }}

but i get an error saying

“Unknown error rendering template”