This is what I get now when i try to clear
Logger: homeassistant.components.template.template_entity
Source: components/template/template_entity.py:71
Integration: template ([documentation](https://www.home-assistant.io/integrations/template), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+template%22))
First occurred: 1:09:20 PM (1 occurrences)
Last logged: 1:09:20 PM
TemplateError('str: Invalid domain name 'UC'') while processing template 'Template("{% set UC = 'sensor.kwikset_spectrum_brands_touchpad_electronic_deadbolt_alarm_level_patiodoor' %} {% set AC = 'sensor.kwikset_spectrum_brands_touchpad_electronic_deadbolt_alarm_type_patiodoor' %} {% 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) %} {% 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 %} {{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 %} ")' for attribute '_state' in entity 'sensor.patiodoor_statusreport'
This is what I get for when I add a user code
Logger: homeassistant.components.automation.patiodoor_add_code
Source: helpers/service.py:140
Integration: Automation (documentation, issues)
First occurred: 1:13:19 PM (2 occurrences)
Last logged: 1:13:19 PM
patiodoor Add Code: Error executing script. Unexpected error for call_service at pos 1: Error rendering data template: str: Invalid entity ID 'lock.LOCKFACTORYNAMEPREFIX_patiodoor'
While executing automation automation.patiodoor_add_code
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 138, in async_prepare_call_from_config
service_data.update(template.render_complex(config[conf], variables))
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 81, in render_complex
return {
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 82, in <dictcomp>
render_complex(key, variables): render_complex(item, variables)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 86, in render_complex
return value.async_render(variables)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 285, in async_render
return compiled.render(kwargs).strip()
File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/usr/local/lib/python3.8/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "<template>", line 1, in top-level template code
File "/usr/local/lib/python3.8/site-packages/jinja2/sandbox.py", line 407, in getattr
value = getattr(obj, attribute)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 461, in __getattr__
raise TemplateError(f"Invalid entity ID '{entity_id}'")
homeassistant.exceptions.TemplateError: str: Invalid entity ID 'lock.LOCKFACTORYNAMEPREFIX_patiodoor'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 206, in _async_step
await getattr(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 385, in _async_call_service_step
domain, service, service_data = async_prepare_call_from_config(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 140, in async_prepare_call_from_config
raise HomeAssistantError(f"Error rendering data template: {ex}") from ex
homeassistant.exceptions.HomeAssistantError: Error rendering data template: str: Invalid entity ID 'lock.LOCKFACTORYNAMEPREFIX_patiodoor'