KeyMaster Z-Wave lock manager and scheduler

HACS OZW beta for me. v0.0.11-ozw

@mang0 and @joe_blow, what version of Home Assistant are you using?

Home Assistant 0.114.4

Home Assistant 0.114.3

I’ve got it installed in Docker, can’t imagine that would matter in this case though…

You error message indicates that the user_code sensor is in an unavailable status.

That’s what’s got me scratching my head, here’s that sensor in States:

Mine was one of the disabled entities that I had to physically enable when I first included the lock. It shows enabled, but the statusreport sensor is still listed as unavailable in entities.

The master branch contains the old/current zwave integration. OpenZWave uses ozw.

Your sensor name doesn’t match what you posted in this post append _frontdoor to the sensor name and it should work or reconfigure the integration and re-select your sensor.

After reading through the full thread I noticed above that it was no longer required to append the lockname. Since the post you’re referencing I deleted everything and started from scratch, including using the factory sensor ids. Still get the same result, however.

Could you re-post your lines 37-41 from frontdoor_lock_manager_common.yaml?

      friendly_name: 'frontdoor Status Report'
      value_template: >
        {% set UC = 'sensor.assa_abloy_yale_key_free_touchscreen_deadbolt_yrd446_alarm_level' %}
        {% set AC = 'sensor.assa_abloy_yale_key_free_touchscreen_deadbolt_yrd446_alarm_type' %}

just to reiterate the above, I’ve tried the configuration with the stock sensor id and I’ve tried appending the lockname and both result in the same.

and just to be clear these 2 lines follow those right?

          {% set usercode_value = states(UC) %}
          {% set alarm_type_value = states(AC) %}

this is 42-45:

        {% if (((as_timestamp(now()) - as_timestamp(states.UC.last_changed)) < 15) and ((as_timestamp(now()) - as_timestamp(states.AC.last_changed)) < 15)) %}

          {% set usercode_value = states(UC) %}
          {% set alarm_type_value = states(AC) %}

Please paste the following into dev tools -> Templates

          {% set UC = 'sensor.assa_abloy_yale_key_free_touchscreen_deadbolt_yrd446_alarm_level' %}
          {% set AC = 'sensor.assa_abloy_yale_key_free_touchscreen_deadbolt_yrd446_alarm_type' %}

          {% set usercode_value = states(UC) %}
          {% set alarm_type_value = states(AC) %}

          {% if 'alarm_type' in AC %}
            {% 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 AC %}
            {% 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 %} 
            {% if ((as_timestamp(now()) - as_timestamp(states.UC.last_changed)) < 15) %}
              {{alarm_type_value}};{{ alarm_type_lock_actions[alarm_type_value] }};{{usercode_value}}
            {% else %}
            {% endif %}
          {% 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 %}

and report the output.

0;No Status Reported

Better than an error.

Feel free to swap that code out for the template sensor, that should fix your errors.
We’ll get a permanent fix pushed :slight_smile:

I’ll try that next. Does it just remove the if statement in line 42?

1 Like

No it get’s moved down into the nested ifs near the bottom.

1 Like

Now the frontdoor Status Report sensor is no longer unavailable, instead it’s state is:

1;Unknown Alarm Type Value unavailable

Although, when I paste the above code into dev tools -> Templates, I still get:

0;No Status Reported

Still not able to set or clear codes from Lovelace. When I try to set code with the service I get:

Failed to call service lock/set_usercode. 18