Hello there
I do need some general advice on how to track down errors showing in the log/protocol. I’m certainly not a newbie but definitly not a programmer language speaking person😅 and any help is appreciated.
So I’m looking for a “general way” to solve those errors, how to start tackling them.
Like on different occasions I get “Error while processing template: … … renders=2>”, also in below protocolls copy
I’ve tried to search forums, google, for quite a while for different such errors etc. but was either unable to find any solution that helps me understand why my issue occurs nor to understand the reason for the error at all. So someone more capable might be able to enrich my capabilities about that “renders=” error?
Also I see there are references to codelines (for example “Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/template.py”, line 587, in ensure_valid”) where they seem to occur but I don’t get where to start looking for them or how to find that location of the code. I assume is to do with a template I’ve created but sometimes I do not see which one…
Logger: homeassistant.helpers.event
Quelle: helpers/template.py:589
Erstmals aufgetreten: 10. März 2025 um 19:58:59 (12 Vorkommnisse)
Zuletzt protokolliert: 10. März 2025 um 20:00:16
Error while processing template: Template<template=({% if is_state('binary_sensor.pending_updates', 'on') and states('sensor.pending_updates')|int(0) > 15 and is_state('binary_sensor.updates_paused', 'off') %}red {% elif is_state('binary_sensor.pending_updates', 'on') and states('sensor.pending_updates')|int(0) > 15 and is_state('binary_sensor.updates_paused', 'on') %}orange {% elif (is_state('binary_sensor.updates_paused', 'off')is_state('binary_sensor.pending_updates', 'on') and is_state('schedule.update_system', 'on')) or states('sensor.pending_updates')|int(0) > 10 or is_state('update.home_assistant_core_update', 'on') or is_state('update.home_assistant_operating_system_update', 'on') or is_state('update.home_assistant_supervisor_update', 'on') %}orange {% elif is_state('binary_sensor.pending_updates', 'on') %}blue {% else %}green {% endif %}) renders=2>
Error while processing template: Template<template=({% if is_state('binary_sensor.pending_updates', 'on') and states('sensor.pending_updates')|int(0) > 15 and is_state('binary_sensor.updates_paused', 'off') %}red {% elif is_state('binary_sensor.pending_updates', 'on') and states('sensor.pending_updates')|int(0) > 15 and is_state('binary_sensor.updates_paused', 'on') %}orange {% elif (is_state('binary_sensor.updates_paused', 'off') is_state('binary_sensor.pending_updates', 'on') and is_state('schedule.update_system', 'on')) or states('sensor.pending_updates')|int(0) > 10 or is_state('update.home_assistant_core_update', 'on') or is_state('update.home_assistant_operating_system_update', 'on') or is_state('update.home_assistant_supervisor_update', 'on') %}orange {% elif is_state('binary_sensor.pending_updates', 'on') %}blue {% else %}green {% endif %}) renders=2>
Error while processing template: Template<template=({% if is_state('binary_sensor.pending_updates', 'on') and states('sensor.pending_updates')|int(0) > 15 and is_state('binary_sensor.updates_paused', 'off') %}red {% elif is_state('binary_sensor.pending_updates', 'on') and states('sensor.pending_updates')|int(0) > 15 and is_state('binary_sensor.updates_paused', 'on') %}orange {% elif (is_state('binary_sensor.updates_paused', 'off') ais_state('binary_sensor.pending_updates', 'on') and is_state('schedule.update_system', 'on')) or states('sensor.pending_updates')|int(0) > 10 or is_state('update.home_assistant_core_update', 'on') or is_state('update.home_assistant_operating_system_update', 'on') or is_state('update.home_assistant_supervisor_update', 'on') %}orange {% elif is_state('binary_sensor.pending_updates', 'on') %}blue {% else %}green {% endif %}) renders=2>
Error while processing template: Template<template=({% if is_state('binary_sensor.pending_updates', 'on') and states('sensor.pending_updates')|int(0) > 15 and is_state('binary_sensor.updates_paused', 'off') %}red {% elif is_state('binary_sensor.pending_updates', 'on') and states('sensor.pending_updates')|int(0) > 15 and is_state('binary_sensor.updates_paused', 'on') %}orange {% elif (is_state('binary_sensor.updates_paused', 'off') anis_state('binary_sensor.pending_updates', 'on') and is_state('schedule.update_system', 'on')) or states('sensor.pending_updates')|int(0) > 10 or is_state('update.home_assistant_core_update', 'on') or is_state('update.home_assistant_operating_system_update', 'on') or is_state('update.home_assistant_supervisor_update', 'on') %}orange {% elif is_state('binary_sensor.pending_updates', 'on') %}blue {% else %}green {% endif %}) renders=2>
Error while processing template: Template<template=({% if is_state('binary_sensor.pending_updates', 'on') and states('sensor.pending_updates')|int(0) > 15 and is_state('binary_sensor.updates_paused', 'off') %}red {% elif is_state('binary_sensor.pending_updates', 'on') and states('sensor.pending_updates')|int(0) > 15 and is_state('binary_sensor.updates_paused', 'on') %}orange {% elif (is_state('binary_sensor.updates_paused', 'off') andis_state('binary_sensor.pending_updates', 'on') and is_state('schedule.update_system', 'on')) or states('sensor.pending_updates')|int(0) > 10 or is_state('update.home_assistant_core_update', 'on') or is_state('update.home_assistant_operating_system_update', 'on') or is_state('update.home_assistant_supervisor_update', 'on') %}orange {% elif is_state('binary_sensor.pending_updates', 'on') %}blue {% else %}green {% endif %}) renders=2>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 587, in ensure_valid
self._compiled_code = self._env.compile(self.template)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 3233, in compile
compiled = super().compile(source)
File "/usr/local/lib/python3.13/site-packages/jinja2/environment.py", line 771, in compile
self.handle_exception(source=source_hint)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/jinja2/environment.py", line 942, in handle_exception
raise rewrite_traceback_stack(source=source)
File "<unknown>", line 1, in template
jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'a'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 760, in async_render_to_info
render_info._result = self.async_render( # noqa: SLF001
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
variables, strict=strict, log_fn=log_fn, **kwargs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 637, in async_render
compiled = self._compiled or self._ensure_compiled(limited, strict, log_fn)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 841, in _ensure_compiled
self.ensure_valid()
~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 589, in ensure_valid
raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: TemplateSyntaxError: expected token 'end of statement block', got 'a'
For context:
I’m running HASS OS on a Beelink S12 pro with an external Zigbee Antenna (SMLIGHT SLZB-06M) connected over PoE and using ZHA
Current Versions:
- Core 2025.2.5
- Supervisor 2025.03.2
- Operating System 14.2
- Frontend 20250221.0