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.
I can gladly give you access to the config if you want to try it.
when I run the setup.sh no new folder generate as the github instructions state would.
I am only trying to setup one lock, here is the ini:
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="kwikset_spectrum_brands_unknown_type_0003_id_0541"
#The name of the (optional) door sensor.
sensorname="frontdoor"
#the "lowest common denominator" of the factory door sensor name.
sensorfactoryname="lumi_lumi_sensor_magnet_aq2_7c804e04remind"
#the Home Assistant EntityID of your (optional) garage door
garageentityid="cover.garage_door_opener"
I might be overlooking something but I see not yaml files in the directory. There are .txt files. As far as I can tell the only thing edited from the Github is the FrontDoor.ini nothing else was touched.
For those who are having problems running setup.sh it looks like you need to be using gawk (tested with 4.2.1, may work with older) but mawk from Ubuntu and nawk in FreeBSD certainly don’t work without some modification of the code.
It does run under Ubuntu if you install gawk and it works in FreeBSD if you install gawk and gsed and patch the code to run those versions.
Unfortunately I have no clue what any of that means. I am running home assistant in a virtual box on my windows pc. Any suggestions on how I go about running this?
Are you running Windows 10? You have a couple options, you could install Ubuntu in another VM and install gawk (sudo apt install gawk) or possibly use the WSL (Windows Subsystem for Linux) and do the same thing. Other than that I don’t have anything just yet.
There could probably be a way to patch the code to know that it is using a different awk (busybox for example in what was hassio) but I haven’t had the time to look into it yet as I just stumbled on this myself and tried to get it working.
I appreciate the help on this. I may attempt the option you suggest if I have time down the line.
Do you have an alternate method of managing locks and users you can suggest for me? I cannot seem to find anything that works for me. currently I can only lock and unlock my system and I have yet to figure out how I can add users and pins, etc. I was hoping this would be my solution. I will likely connect it back to my SmartThings Hub for now and go that route until I find a better option. If you cannot tell I am new to Home Assistant (within the past month).
@FutureTense - Great work bro. Quick question, can you maybe get the Status Report Sensor to use the input_text.<your_value__name_1, name_2, etc when updating. That way we’d get the name of the code that was used. And maybe same with the notification delivery…so I know which kid just passed through the frontdoor. Cheers!
dude that worked! At least it installed, haven’t fiddled yet, but adding gawk as you just said (apk add gawk) through the terminal and then running ./setup worked! I will report back if I end up being wrong cause I cannot fiddle with it until later.
I am getting several errors in my logs in relation to adding/updating/clearing user codes.
“Error while executing automation automation.outsidegaragedoor_clear_code. Invalid data for call_service at pos 1: expected int for dictionary value @ data[‘code_slot’]”
Error while executing automation automation.outsidegaragedoor_add_code. Invalid data for call_service at pos 1: expected int for dictionary value @ data[‘code_slot’]
am i missing something?
code for adding was set by setup.sh:
- alias: OutsideGarageDoor Add Code
condition:
- condition: state
entity_id: 'binary_sensor.allow_automation'
state: 'on'
trigger:
entity_id: binary_sensor.active_outsidegaragedoor_1, binary_sensor.active_outsidegaragedoor_2, binary_sensor.active_outsidegaragedoor_3, binary_sensor.active_outsidegaragedoor_4, binary_sensor.active_outsidegaragedoor_5, binary_sensor.active_outsidegaragedoor_6
platform: state
to: 'on'
action:
- service: lock.set_usercode
data_template:
node_id: >-
{{states.lock.schlage_be469nxcen_touchscreen_deadbolt_locked_outsidegaragedoor.attributes.node_id}}
code_slot: >-
{% set object_id = trigger.to_state.object_id %}
{% set index = 17 %}
{% set code_slot = object_id[index:] %}
{{ code_slot }}
usercode: >-
{% set object_id = trigger.to_state.object_id %}
{% set index = 17 %}
{% set code_slot = object_id[index:] %}
{% set codetext = 'outsidegaragedoor_pin_' + code_slot | string %}
{% set code = states['input_text'][codetext].state %}
{{ code | string }}
- alias: OutsideGarageDoor Update Code
trigger:
entity_id: input_text.outsidegaragedoor_pin_1, input_text.outsidegaragedoor_pin_2, input_text.outsidegaragedoor_pin_3, input_text.outsidegaragedoor_pin_4, input_text.outsidegaragedoor_pin_5, input_text.outsidegaragedoor_pin_6
platform: state
condition:
- condition: state
entity_id: 'binary_sensor.allow_automation'
state: 'on'
- condition: template
value_template: >-
{% set object_id = trigger.to_state.object_id %}
{% set index = 14 %}
{% set code_slot = object_id[index:] %}
{% set b = 'input_boolean.enabled_outsidegaragedoor_' + code_slot | string %}
{{ is_state(b, 'on') and (trigger.from_state.state != trigger.to_state.state)}}
action:
- service: persistent_notification.create
data_template:
title: "outsidegaragedoor LOCK MANAGER"
message: >-
{% set object_id = trigger.to_state.object_id %}
{% set index = 14 %}
{% set code_slot = object_id[index:] %}
{{ 'You changed the PIN for code ' + code_slot | string + '. Please enable it in order to make it active.'}}
- service: input_boolean.turn_off
data_template:
entity_id: >-
{% set object_id = trigger.to_state.object_id %}
{% set index = 14 %}
{% set code_slot = object_id[index:] %}
{{ 'input_boolean.enabled_outsidegaragedoor_' + code_slot | string }}
I am unfortunately getting a similar error. Everything seems to work fine with my front door lock if I remove the single quotes from input_boolean.allow_automation_execution and input_boolean.allow_automation_execution in my scripts.yaml:
# LOCK MANAGER SCRIPTS
system_cleanup:
sequence:
#- service: homekit.start If you use homekit, uncomment this statement
- service: input_boolean.turn_on
entity_id: input_boolean.system_ready
- service: input_boolean.turn_on
data:
entity_id: input_boolean.allow_automation_execution
customstartup:
sequence:
- service: input_boolean.turn_off
data:
entity_id: input_boolean.allow_automation_execution
However, my second (garage) lock is not functioning properly. I am getting the following errors in log:
Error while executing automation automation.garagesd_clear_code. Invalid data for call_service at pos 1: expected int for dictionary value @ data['code_slot']
AND
Error rendering data template: str: Invalid entity ID 'input_text.garagesd_pin_'
If I run ‘lock.set_usercode’ from services tab with the following data:
node_id: 12
code_slot: 1
usercode: 1234
It seems to work. Obviously doesn’t change the code in lovelace but if I check through the zwave panel I can see the code has changed.
I removed the ’ ’ from those entity_id: sections and my errors went away, but none of the functionality is still working. I did notice some more of the ’ ’ in the _lock_manager_common.yaml file so you may want to check there and see if that resolves the issues for your other door locks.
I tried to run the ‘lock.set_usercode’ from the services tab and the ‘lock.get_usercode’ but they don’t work for me so i’m thinking there is something else that i’m missing also.
Yeah, I think my removing those actually did nothing… I found some better ways to debug and found it was a false positive. Anyhow, hate to say the obvious, but you’ve checked your entity ID naming, right?