Nope, just that same one “Could not render template frontdoo Status Report, the state is unknown”
Are your alarm_level
and alarm_type
sensors populated, as in do they have values? Or do they say “unavailable” ?
looks good, so lets do this.
Copy the value_template
part from the frontdoor_statusreport
in frontdoor_lock_manager_common.yaml
and paste it into the templates
section in the dev-tools.
See what it spits out.
EDIT: should show something similar to this:
21;Manual Lock
Apologies for the beginner question, but where exactly do you want me to put it when you say dev-tools?
I see the code you mentioned:
frontdoor_statusreport:
friendly_name: 'frontdoor Status Report'
value_template: >
{% set number = states('sensor.schlage_bolt_alarm_level_frontdoor') %}
{% set alarm_type_value = states('sensor.schlage_bolt_alarm_type_frontdoor') %}
{% if ((as_timestamp(now())-as_timestamp(states.lock.schlage_bolt_locked_frontdoor.last_changed)) < 15 and (as_timestamp(now())-as_timestamp(states.sensor.schlage_bolt_alarm_type_frontdoor.last_changed)) > 15) %}
{% if (states.lock.schlage_bolt_locked_frontdoor.state) == 'locked' %}
{% set alarm_type_value = '24' %}
{% elif (states.lock.schlage_bolt_locked_frontdoor.state) == 'unlocked' %}
{% set alarm_type_value = '25' %}
{% endif %}
{% endif %}
{% 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' } %}
{% if alarm_type_value in alarm_type_code_actions %}
{{alarm_type_value}};{{ alarm_type_code_actions[alarm_type_value] }};{{number}}
{% elif alarm_type_value in alarm_type_lock_actions %}
{{alarm_type_value}};{{ alarm_type_lock_actions[alarm_type_value] }};{{number}}
{% 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('sensor.schlage_bolt_alarm_type_frontdoor') }}
{% endif %}
There’s the problem. Your lock.schlage_bolt_locked_frontdoor
entity doesn’t have the last_changed
attribute.
Check under States
and see what attributes show up for your lock entity.
Try toggling your lock to unlocked/locked and see if you get a last_changed
Nope, just unlocked it from HA and this is what I see
There won’t be a last_changed attribute. That’s a a history event stored in the db that indicates when the state last changed time. If home assistant isn’t detecting the lock being changed via zwave and locking and unlocking through HA doesn’t do anything, there’s a zwave communication issue.
Can you lock and unlock the lock by selecting unlock and lock with your lock.schlage_bolt_front_lock_frontdoor entity?
Yes I can:
You could delete the line:
{% if ((as_timestamp(now())-as_timestamp(states.lock.kwikset_touchpad_electronic_deadbolt_locked_frontdoor.last_changed)) < 15 and (as_timestamp(now())-as_timestamp(states.sensor.kwikset_touchpad_electronic_deadbolt_alarm_type_frontdoor.last_changed)) > 15) %}
from the template and it should return a value then.
EDIT: You may have an underlying issue with your recorder
I commented out the code, guess I need to comment something else in order for the config to check out
Ya just delete the line, you can re-generate the script if you need it back in the future.
You probably need to delete the corresponding endif too.
Based on the 2nd error there, it looks like your entity doesn’t exist?
I see three different names being used for your lock:
lock.schlage_front_lock
lock.schlage_bolt_locked_frontdoor
lock.schlage_bolt_front_lock_frontdoor
In your ini file you have schlage_bolt
as your lowest common denominator. Your lock appears to be named lock.schlage_bolt_front_lock_frontdoor
but your other entities are lock.schlage_bolt_xxxxxxx_frontdoor
. The lowest common denominator must be the same for all of them. Seems the easiest thing to do it so remove the _lock
from the lock entity_id so it’s lock.schlage_bolt_lock_frontdoor
. Also, find where you have lock.schlage_front_lock
and correct that to lock.schlage_bolt_lock_frontdoor
.