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.
Hi All,
Can someone please tell me if the following looks correct from my config yaml:
# LOCK MANAGER CONFIGS
binary_sensor:
- platform: template
sensors:
allow_automation:
friendly_name: "Allow Automation"
value_template: "{{ is_state('input_boolean.allow_automation_execution', 'on') }}"
system_ready:
friendly_name: "System ready"
value_template: "{{ is_state('input_boolean.system_ready', 'on') }}"
device_class: moving
input_boolean:
allow_automation_execution:
name: 'Allow Automation'
initial: off
system_ready:
name: 'System Ready'
initial: off
Seems to be something off here.
code looks ok to me.
Wondering if someone can help me here…
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.
I used to use the code from here https://community.home-assistant.io/t/zwave-lock-manager/79252 and that was working.
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?
I am unable to run ./setup.sh
I get…
“bad interpreter: No such file or directory”
Any ideas? Thanks.
where are you trying to run it?
yeah i checked them over several times and no luck
Not sure what you mean. Ubuntu terminal I guess?
have you tried to install gawk? mentioned here:
Yes I saw that comment before and installed gawk via the apt install method.
I’ve been testing the code by adding notifications right after the trigger happens and I get the initial notification (Code Created step 1). However, I am not getting the notification that it’s finished (Code Created Done) after the service: lock.set_usercode section
- 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: persistent_notification.create
data_template:
title: "debug"
message: "Code Created step 1"
- 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 }}
- service: persistent_notification.create
data_template:
title: "debug"
message: "Code Created Done"
Forgot to ask, any errors in your log when running lock.set_usercode from your developer panel?
Not showing any errors when i use the developer panel.
That is super strange. Can you ensure that node_id is active and the default user codes are associated with it?
when i try to run the unlock using developer panel or even from Lovelace lock/unlock, the door locks and unlocks and it says unlocked from RF or something in that nature.
Have you verified you are using the correct node_id when calling the service from dev panel?
yes and i made sure the lock node id matches with the zwave one.