KeyMaster Z-Wave lock manager and scheduler

It shouldn’t matter. It scans every ini file in the directory. Are you in the directory before you run the script? Is every value populated in the ini?

Yep, I even tried renaming the frontdoor.ini to lock_manager.ini
changed the folder to lock-manager from what i had it as last night (screenshot shows lockmaster)

image
image

Why is it creating BusyBox? In any case you should debug the script and see what’s happening at line 42. See if your ini file is retrieved from that. Change line 57 to true. All of those lines should print a value.

I am running into the same issue as lazycro. wondering if it could be that i’m currently running 105 beta.

I found some old threads about it being related to Hass.io… I really haven’t had more time to play with it and I only dabble with Home Assistant itself in my small free time so debugging the script isn’t high priority at the moment for me.

When I add this I get a config check error:

input_boolean.system_ready:
  name: 'System Ready'
  initial: off

Had to put it as:

system_ready:
  name: 'System Ready'
  initial: off

Which passed config check and I think is correct, but need to reboot and check :slight_smile:

Ok so I think I lied on the 6 digit code working. It looks like everything works however disabling a code doesn’t not. The lock is expecting 6 digit codes and you send a 4 digit random and it doesn’t take. So somewhere you need to add a “Code Length” variable that we can set. It would be ideal if it would use this variable for the random number, and if possible validate that the code entered is the correct length to make it more wife approved :slight_smile:

I added all this and it works great. I even added: binary_sensor.system_ready to the badges for the lock page. The only issue is the docs on the name as referenced in the post above: KeyMaster Z-Wave lock manager and scheduler - #37 by crzykidd

Find the clear code automation and you will see where it generates a 4 digit PIN. Just bump that up to 6

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.