KeyMaster Z-Wave lock manager and scheduler

On a side note, I just tied the clear lock native zwave command with 105, and it still does not work.

EDIT: At least on my lock (schlage BE469) not only did it not work, it caused my lock to “crash” Totally unusable with HA or even keypad until I pulled the batteries.

Would that be changing:

           usercode: >-
              {{ range(1000, 9999) | random | int }}

to:

           usercode: >-
              {{ range(100000, 999999) | random | int }}

It is just in one place correct?

I am having the same issue as lazycro. I tried to debug by changing line 57 to true, but the output doesn’t change.

says
awk: comd. line:9: Unexpected token
lock_manager.ini is incomplete or does not exist

Ok, so I recently switched from Hubitat over to Home Assistant and slowly moving my setup over. Here is my question before I tackle this project:

  1. I don’t have door sensors, is this project reliant on them or can I just use the LM for my Yale locks?

  2. I have 3 identical ZWave Yale locks in my house, can I use one setup to control all of them for this project?

I’m sure I’ll have more questions but I figured I better start with these two. Thanks in advance!

Were you able to get passed the ./setup.sh? I’m having the same issue. Any help would be much appreciated -> lock_manager.ini is incomplete or does not exist…

Full output:
awk: line 9: syntax error at or near [
awk: line 10: syntax error at or near [
awk: line 11: syntax error at or near else
awk: line 12: syntax error at or near [
awk: line 16: syntax error at or near [
lock_manager.ini is incomplete or does not exist
./setup.sh: line 80: ((: i<=: syntax error: operand expected (error token is “<=”)
./setup.sh: line 97: ((: i<=: syntax error: operand expected (error token is “<=”)
creating
mkdir: missing operand
Try ‘mkdir --help’ for more information.
mv: missing destination file operand after ‘*.yaml’
Try ‘mv --help’ for more information.
mv: missing destination file operand after ‘_lovelace’
Try ‘mv --help’ for more information.

FrontDoor.ini–
#See README for more information.
[lockmanager]

#number of PINS to setup in lovelace
numcodes=6

#the name or location of the lock you are setting up (no spaces)
lockname=“FrontDoor”

#the “lowest common denominator” of the factory lock name.
lockfactoryname=“schlage_allegion_be469zp_connect_smart_deadbolt”

#The name of the (optional) door sensor.
sensorname=“frontdoor”

#the “lowest common denominator” of the factory door sensor name.
sensorfactoryname=“schlage_allegion_be469zp_touchscreen_deadbolt”

#the Home Assistant EntityID of your (optional) garage door
garageentityid=“cover.garage_door_opener”

1 Like

I’m running Hassio and ran into similar issues as stated above:

awk: cmd. line:9: Unexpected token
lock_manager.ini is incomplete or does not exist
./setup.sh: line 80: ((: i<=: syntax error: operand expected (error token is "<=")
./setup.sh: line 97: ((: i<=: syntax error: operand expected (error token is "<=")
creating
BusyBox v1.31.1 () multi-call binary.

Usage: mkdir [OPTIONS] DIRECTORY...

Create DIRECTORY

        -m MODE Mode
        -p      No error if exists; make parent directories as needed
BusyBox v1.31.1 () multi-call binary.

Usage: mv [-fin] SOURCE DEST
or: mv [-fin] SOURCE... DIRECTORY

Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY

        -f      Don't prompt before overwriting
        -i      Interactive, prompt before overwrite
        -n      Don't overwrite an existing file
BusyBox v1.31.1 () multi-call binary.

Usage: mv [-fin] SOURCE DEST
or: mv [-fin] SOURCE... DIRECTORY

Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY

        -f      Don't prompt before overwriting
        -i      Interactive, prompt before overwrite
        -n      Don't overwrite an existing file
➜  lockmanager >....
        -m MODE Mode
        -p      No error if exists; make parent directories as needed
BusyBox v1.31.1 () multi-call binary.

Usage: mv [-fin] SOURCE DEST
or: mv [-fin] SOURCE... DIRECTORY

Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY

        -f      Don't prompt before overwriting
        -i      Interactive, prompt before overwrite
        -n      Don't overwrite an existing file
BusyBox v1.31.1 () multi-call binary.

Usage: mv [-fin] SOURCE DEST
or: mv [-fin] SOURCE... DIRECTORY

Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY

        -f      Don't prompt before overwriting
        -i      Interactive, prompt before overwrite
        -n      Don't overwrite an existing file

No, you don’t need the sensors. You can also remove the devices from the Lovelace yaml if you don’t want to see them.

No. You will need three copies of the package. But this is easy enough to accomplish. The trick is to make sure you name your locks accordingly. Let’s say you have locks for frontdoor, backdoor, sidedoor. Follow the instructions and create frontdoor.ini, backdoor.ini, sidedoor.ini and name the “innards” of those files accordingly. I suggest excluding all of those locks from your zwave system, and then include them one at a time, following the renaming instructions. When you run the setup.sh, it will see all 3 ini files and should create 3 directories matching the names you specified. You can then copy those folders to your packages directory and all three will get loaded.

You will of course need to (or should) create three separate views, one for each lock and use the generated GUI yaml so you have a GUI for each lock.

I’ll see if I can figure out what’s going on. I might have you test a few dummy scripts for me just to isolate the issue.

The first thing you can do, is to put the folder with setup.sh and all the other files in your home directory under a folder called test. So you’ll have something like

/home/users/futuretense/test

And run the script from there. After you do that and you get the same error, paste your ini file here so I can run it on my system.

1 Like

Ok…so I’m still navigating my way through HA…but I don’t have a users folder in my home directory…it’s empty. I’m running Hassio? Does that matter?

Either way here’s my ini (deck.ini) file:

#See README for more information.
[lockmanager]

#number of PINS to setup in lovelace
numcodes=6

#the name or location of the lock you are setting up (no spaces)
lockname="deck"

#the "lowest common denominator" of the factory lock name.  
lockfactoryname="lock.lock"

#The name of the (optional) door sensor.
sensorname="sensor"

#the "lowest common denominator" of the factory door sensor name.  
sensorfactoryname="vision_security_zd2105us_5_recessed_door_window_sensor"

#the Home Assistant EntityID of your (optional) garage door
garageentityid="binary_sensor.tilt_sensor_garage_sensor"

Just create a new directory in your home folder and put it there. Or you can clone it from the repo. Go to your home directory and issue the following:

git clone https://github.com/FutureTense/lock-manager

Put your lock.ini file in there (and delete the original ini file) and then run setup.sh. You will need to make it executable before you call it. And I think your lockfactoryname is wrong. I strongly recommend you exclude it from your system and then include it again. Then do the renaming as mentioned in README. There are a lot of entities, so I suggest that you exclude all of your locks, then add one lock at a time. Once you exclude all of your locks, make sure you check your entities and verify there are no stragglers left over. So now include the deck lock, and go through every entity for this device and append _deck. Find the lockfactoryname “lowest common denominator”. It should be something like: schlage_allegion_be469zp_connect_smart_deadbolt

After you get this working for one lock, the process is the same for the other locks. So concentrate on getting the deck working and the others will be easy. After running the script, you will have 3 new directories in your lock-manager directory if you have 3 ini files. You only need those new directories copied over to the home assistant packages directory, but I find it easier just to copy the entire lock-manager directory.

I’ve never used Hassio, and I suspect that’s part of the problem. You might need to use a linux OS to run setup.sh, as Hassio might be missing some commands used in the script. If you have access to another Linux machine, try cloning the repo and running there. If you don’t get any errors, find a way of copying the new directories it created (or the entire lock-manager folder) to your Hassio packages directory.

FYI - I was about to switch to this package from ptdalen’s and got the same error message when I ran the script. I’m not using Home Assistant (formerly Hassio), I’m using HA Core in Docker.

I appreciate the time you’ve taken to help solve the problem but it seems to be something linked to the OS or Hassio that breaks the install/setup…I have a SAMBA share setup, would you be willing to break down the directory/file structure? Seems like it would just be easier to set it up manually rather than fiddling with the setup file at this point. Looks like a great little script…can’t wait to play with it! Thanks again!

I’m suspecting it’s a command inside the script for a program that is missing. I’ll take a look

Ok so I have been running one lock for a month or so. I just pulled the latest code down and made sure I had all the changes. My first lock still still working (However it doesn’t want to set a random value when I disable a user) Not sure why but I can change a user code and have it work.

My big problem is I added backdoor and now I am getting errors around the backdoor. These 2 errors show up in the log, and it never tries to update the lock on the zwave stack.


Error rendering data template: str: Invalid entity ID 'input_text.backdoor_pin_'
2:46 PM helpers/service.py (ERROR)
Error while executing automation automation.backdoor_clear_code. Invalid data for call_service at pos 1: expected int for dictionary value @ data['code_slot']
2:46 PM helpers/script.py (ERROR)

I have added a 3rd door garage and get the exact same issues on that door.

I too am having this same problem. I have the same line errors on 80 and 97. This happens even with the test directory. Any solution to this?

Ya not sure what is happening here looks like the code is expecting an int variable but not getting one. I have been slammed at work and had no free time to dig into it myself. I was hoping @FutureTense might have an ah-ha moment and go “Opps change this setting”

Paste the automation bits here so we can see about helping.

Since your code is generated via a script you’ll need to post your actual automation yml file bits where the error is occurring.