KeyMaster Z-Wave lock manager and scheduler

please post likes 245-260

When I generate the package those lines are as follows:

        - service: lock.set_usercode
          data_template:
            node_id: >- 
                {{states.lock.LOCKFACTORYNAMEPREFIX_frontdoor.attributes.node_id}}
            code_slot: >-
                {% set object_id = trigger.to_state.object_id %}
                {% set index = object_id.rfind('_') + 1 %}
                {% set code_slot = object_id[index:] %}
                {{ code_slot  }}
            usercode: >-
                {% set object_id = trigger.to_state.object_id %}
                {% set index = object_id.rfind('_') + 1 %}
                {% set code_slot = object_id[index:] %}    
                {% set codetext = 'frontdoor_pin_' + code_slot | string %}
                {% set code = states['input_text'][codetext].state %}
                {{ code | string }}
          data_template:
            node_id: >- 
                {{states.lock.assa_abloy_yale_key_free_touchscreen_deadbolt_yrd446_locked.attributes.node_id}}
            code_slot: >-
                {% set object_id = trigger.to_state.object_id %}
                {% set index = object_id.rfind('_') + 1 %}
                {% set code_slot = object_id[index:] %}
                {{ code_slot  }}
            usercode: >-
                {% set object_id = trigger.to_state.object_id %}
                {% set index = object_id.rfind('_') + 1 %}
                {% set code_slot = object_id[index:] %}    
                {% set codetext = 'frontdoor_pin_' + code_slot | string %}
                {% set code = states['input_text'][codetext].state %}
                {{ code | string }}

I changed the reference to LOCKFACTORYNAMEPREFIX_frontdoor both at line 248 and 322 to no avail. I should point out my lock entity factory id is: lock.assa_abloy_yale_key_free_touchscreen_deadbolt_yrd446_locked

note the _locked which is different from the sensors. Even with the correct lock entity id Iā€™m still unable to call the setcode service.

Are you able to call the service from the services menu?

Negative, I get the same failure to call error.

Can you post what youā€™re putting into the service call? Screenshot is fine.

After changing the references to LOCKFACTORYNAMEPREFIX in frontdoor_lock_manager_common.yaml I got the set user_code service to work and the Lovelace interface is now working as well. I think the issue was that the integration wasnā€™t calling lock.set_usercode (line 247 and 321) because my lock entity id had the extra _locked appended by default.

Thanks for your patience on this. Stoked to have it working.

1 Like

Just a quick update: Iā€™ve actually only got it partially working. The set and clear lock functions are working but the status report is not, which is causing the notifications to not work (i think).

Anyway, the status report sensor never carries over the alarm_type_general_actions, alarm_type_lock_actions, or alarm_type_code_actions. Instead, the nested ifs always produce Unknown Alarm Type Value. Even if the alarm type sensor has a valid value.

Iā€™ve tried debugging the if statements but Iā€™m not familiar enough with the code to figure out why the sensor isnā€™t generating properly.

1 Like

FutureTense is working on a tweak to that template, Iā€™ve tested it out with good results so far.

1 Like

Same thing with me @joe_blow. The status report shows the right status in developer tools (after removing the if statement that checks last changed time), but the entity itself reports "1;Unknown Alarm Type Value"

In dev tools, I can type this:
{{states('sensor.kwikset_spectrum_brands_touchpad_electronic_deadbolt_alarm_type_frontdoor')}}
and I get:
19

Itā€™s pretty strange. Iā€™ve been through the if statements in that sensor template a dozen times and canā€™t see how itā€™s missing the if statements above ā€œUnknown Alarm Typeā€. Sounds like thereā€™s a fix in the work though.

I have read through a lot of this thread, but I am still a bit confused. I have never successfully been able to get this installed back before a HACS version was released. I figured I would give it a try again since it now has HACS integration.

I was successfully able to get the integration added via HACS. When I attempt to configure the integration, I fill out the required information but when hitting submit I get a User input malformed error and it wonā€™t submit.

Note that I donā€™t have a User Code Sensor. Iā€™m not sure if I need to do something special for that to populate, but it doesnā€™t appear that I have any entities disabled.

My configuration:
HA Platform: Docker
Zwave: Zwave2MQTT (Iā€™m assuming this means I need the ozw version)
Lock: Schlage Connect (BE469 Touchscreen Deadbolt)

I did attempt to install this a while back with the manual method, but I think I have cleaned up everything from that end. I mention that because itā€™s possible I have some leftovers from that install process.

can you post all of your lock related entities? screenshot is fine

Iā€™m in the process of moving my locks over to OZW Beta, and noticed some behavior with sensors I was not expecting. Iā€™ve looked through your package though, and I think its normal. I noticed the access level for door events has changed, what used to be 19, is now 6 for keypad unlock. Usercode is itā€™s own sensor, etc.

One thing I wanted to verify. Iā€™ve noticed that my values all seem to ā€œresetā€ after a couple of seconds.

So user code shows the correct slot, but then changes back to 0. Same for the access control value. Is this normal behavior for the new 1.6 OZW, or is there a setting I need to change to make the sensor values stay?

This is the way the lock is supposed to work. In the old integration the user code and access control was still there but was hacked to show alarm type and alarm level, and the codes mapped. One big hack, this is no longer the case and youā€™re seeing your proper values populate.

Alarm type and alarm level were v1 notifications for the old locks.
Access control and user code are v4 (i think) notifications for newer locks.

Notifications can expire automatically or forced to be cleared.

Specifically I mean the user code and access control, do not keep thier values. After 2-3 seconds they automatically reset to 0. Iā€™m ā€œokā€ with this, if its normal behavior, Iā€™m sure that can be taken into account, if I want a static value of who unlocked the door last, etc. Just want to make sure my lock is working correctly. Thanks for replying so quickly. Iā€™ve gotten fairly far with this package, and gotta say, WOW, lots of work here. Really great. Just trying to figure out the lovelace now. :slight_smile:

1 Like

I recall someone showing me their config options for the schlage, I recall seeing an option along the lines of ā€œauto clear notificationsā€ and it was a value in seconds. Iā€™d assume setting that to 0 would persist the access control and user code data.

Now Iā€™m gonna ask the same general questions that everyone else probably already has.

    frontdoor_statusreport:
      friendly_name: 'frontdoor Status Report'
      value_template: >
        {% set UC = 'sensor.be469_touchscreen_deadbolt_user_code_frontdoor' %}
        {% set AC = 'sensor.be469_touchscreen_deadbolt_access_control_frontdoor' %}

Status report. This is my packge lines above

I have verified that my sensors are named accordingly. I see them change (even if it is currently clearing after a couple seconds) it shows as unavailable

image

Iā€™d expect it to maybe not show what I want, but confused on why it is unavailable.

EDIT: when putting into the template test I get this

Error rendering template: str: Invalid domain name ā€˜UCā€™

Playing around with the template trying to figure things out a bit

frontdoor_statusreport:
      friendly_name: 'frontdoor Status Report'
      value_template: >
        
        
        0
        2

This was me manually locking the door

    frontdoor_statusreport:
      friendly_name: 'frontdoor Status Report'
      value_template: >
        {% set UC = 'sensor.be469_touchscreen_deadbolt_user_code_frontdoor' %}
        {% set AC = 'sensor.be469_touchscreen_deadbolt_access_control_frontdoor' %}
        {{ states.sensor.be469_touchscreen_deadbolt_user_code_frontdoor.state }}
        {{ states.sensor.be469_touchscreen_deadbolt_access_control_frontdoor.state }}
        {% if (((as_timestamp(now()) - as_timestamp(states.sensor.be469_touchscreen_deadbolt_user_code_frontdoor.last_changed)) < 15) and ((as_timestamp(now()) - as_timestamp(states.AC.last_changed)) < 15)) %}

          {% set usercode_value = states('sensor.be469_touchscreen_deadbolt_user_code_frontdoor') %}
          {% set alarm_type_value = states('sensor.be469_touchscreen_deadbolt_access_control_frontdoor') %}

          {% if 'alarm_type' in 'sensor.be469_touchscreen_deadbolt_access_control_frontdoor' %}
            {% set alarm_type_general_actions = {
              '0':'No Status Reported',
              '9':'Lock Jammed',
              '17':'Keypad Lock Jammed',
              '21':'Manual Lock',
              '22':'Manual Unlock',
              '23':'HA Lock Jammed',
              '24':'HA Lock',
              '25':'HA Unlock',
              '26':'Auto Lock Jammed',
              '27':'Auto Lock',
              '32':'All Codes Deleted',
              '161':'Bad Code Entered',
              '167':'Battery Low',
              '168':'Battery Critical',
              '169':'Battery Too Low To Operate Lock' } %}
            {% set alarm_type_lock_actions = {
              '18':'Keypad Lock',
              '19':'Keypad Unlock',
              '162':'Lock Code Attempt Outside of Schedule' } %}
            {% set alarm_type_code_actions = {
              '33':'Code Deleted',
              '112':'Code Changed',
              '113':'Duplicate Code' } %}
          {% elif 'access_control' in 'sensor.be469_touchscreen_deadbolt_access_control_frontdoor' %}
            {% set alarm_type_general_actions = {
              '1':'Manual Lock',
              '2':'Manual Unlock',
              '3':'RF Lock',
              '4':'RF Unlock',
              '7':'Manual not fully locked',
              '8':'RF not fully locked',
              '9':'Auto Lock locked',
              '10':'Auto Lock not fully locked',
              '11':'Lock Jammed',
              '16':'Keypad temporary disabled',
              '17':'Keypad busy' } %}
            {% set alarm_type_lock_actions = {
              '5':'Keypad Lock',
              '6':'Keypad Unlock' } %}
            {% set alarm_type_code_actions = {
              '12':'All User Codes Deleted',
              '13':'Single Code Deleted',
              '14':'New User Code Added',
              '15':'Duplicate Code' } %}
          {% endif %}
          {% if alarm_type_value in alarm_type_code_actions %}
            {{alarm_type_value}};{{ alarm_type_code_actions[alarm_type_value] }};{{usercode_value}}
          {% elif alarm_type_value in alarm_type_lock_actions  %}
            {{alarm_type_value}};{{ alarm_type_lock_actions[alarm_type_value] }};{{usercode_value}}
          {% elif alarm_type_value in alarm_type_general_actions %}
            {{alarm_type_value}};{{ alarm_type_general_actions[alarm_type_value] }}
          {% else %}
            {{-1}};Unknown Alarm Type Value {{ states(AC) }}
          {% endif %}
        {% else %}
        {% endif %}

I found the setting about clearing events. The default was 5000. I imagine that was 5000 ms, or 5 seconds. I set it to 0 as suggested and Iā€™m now good. I did this through the ozw control panel

1 Like

Thereā€™s a rework in progress for the template sensors.

1 Like