Hi everyone
I have the following error in my log. How can I fix this?
It talks about the use of the an unexpected curly brace. I can’t see where this is.
Please help.
Logger: homeassistant.helpers.event
Source: helpers/template.py:514
First occurred: 12:17:49 (55 occurrences)
Last logged: 12:24:40
Error while processing template: Template<template=({%- if has_value('sensor.bicester_village_station_buses') -%} {%- if (state_attr('sensor.bicester_village_station_buses', 'calls') | count) == 0 %} Information is not available {%- else %} <table style="text-align: left"> <tr> <th style="width: 5%">Bus</th><th>Destination</th><th>Expected</th> </tr> {%- for call in state_attr('sensor.bicester_village_station_buses', 'calls') %} <tr> <td>{{ call.service_description }}</td> <td style="max-width: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis">{{ call.destination }}</td> <td style="width: 20%; white-space: nowrap"> {%- if call.display_time[2] != ":" %} {{ call.expected_departure_time[11:16] }} {{ '(' }} {%- endif -%} {{ call.display_time }} {%- if call.display_time[2] != ":" %} {{- ')' }} {%- endif %} </td> </tr> {%- endfor %} </table> {% if state_attr('sensor.bicester_village_station_buses', 'messages') is not none %} <br /> {% for message in state_attr('sensor.bicester_village_station_buses', 'messages') %} <marquee behavior="scroll" direction="left">{{ message }}</marquee> {%- endfor %} {% endif %} {% endif %} {%- endi -%}) renders=2>
Error while processing template: Template<template=({%- if has_value('sensor.bicester_village_station_buses') -%} {%- if (state_attr('sensor.bicester_village_station_buses', 'calls') | count) == 0 %} Information is not available {%- else %} <table style="text-align: left"> <tr> <th style="width: 5%">Bus</th><th>Destination</th><th>Expected</th> </tr> {%- for call in state_attr('sensor.bicester_village_station_buses', 'calls') %} <tr> <td>{{ call.service_description }}</td> <td style="max-width: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis">{{ call.destination }}</td> <td style="width: 20%; white-space: nowrap"> {%- if call.display_time[2] != ":" %} {{ call.expected_departure_time[11:16] }} {{ '(' }} {%- endif -%} {{ call.display_time }} {%- if call.display_time[2] != ":" %} {{- ')' }} {%- endif %} </td> </tr> {%- endfor %} </table> {% if state_attr('sensor.bicester_village_station_buses', 'messages') is not none %} <br /> {% for message in state_attr('sensor.bicester_village_station_buses', 'messages') %} <marquee behavior="scroll" direction="left">{{ message }}</marquee> {%- endfor %} {% endif %} {% endif %}) renders=6>
Error while processing template: Template<template=({%- if has_value('sensor.bicester_village_station_buses') -%} {%- if (state_attr('sensor.bicester_village_station_buses', 'calls') | count) == 0 %} Information is not available {%- else %} <table style="text-align: left"> <tr> <th style="width: 5%">Bus</th><th>Destination</th><th>Expected</th> </tr> {%- for call in state_attr('sensor.bicester_village_station_buses', 'calls') %} <tr> <td>{{ call.service_description }}</td> <td style="max-width: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis">{{ call.destination }}</td> <td style="width: 20%; white-space: nowrap"> {%- if call.display_time[2] != ":" %} {{ call.expected_departure_time[11:16] }} {{ '(' }} {%- endif -%} {{ call.display_time }} {%- if call.display_time[2] != ":" %} {{- ')' }} {%- endif %} </td> </tr> {%- endfor %} </table> {% if state_attr('sensor.bicester_village_station_buses', 'messages') is not none %} <br /> {% for message in state_attr('sensor.bicester_village_station_buses', 'messages') %} <marquee behavior="scroll" direction="left">{{ message }}</marquee> {%- endfor %} {% endif %} {% endif %}) renders=10>
Error while processing template: Template<template=({%- if (state_attr('sensor.manorsfield_road_stand_2_buses', 'calls') | count) == 0 %} Information is not available {%- else %} <table style="text-align: left"> <tr> <th style="width: 5%">Bus</th><th>Destination</th><th>Expected</th> </tr> {%- for call in state_attr('sensor.manorsfield_road_stand_2_buses', 'calls') %} <tr> <td>{{ call.service_description }}</td> <td style="max-width: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis">{{ call.destination }}</td> <td style="width: 20%; white-space: nowrap"> {%- if call.display_time[2] != ":" %} {{ call.expected_departure_time[11:16] }} {{ '(' }} {%- endif -%} {{ call.display_time }} {%- if call.display_time[2] != ":" %} {{- ')' }} {%- endif %} </td> </tr> {%- endfor %} </table> {% if state_attr('sensor.manorsfield_road_stand_2_buses', 'messages') is not none %} <br /> {% for message in state_attr('sensor.manorsfield_road_stand_2_buses', 'messages') %} <marquee behavior="scroll" direction="left">{{ message }}</marquee> {%- endfor %} {% endif %} {% endif %} {%- endif -%}) renders=2>
Error while processing template: Template<template=({%- if (state_attr('sensor.manorsfield_road_stand_2_buses', 'calls') | count) == 0 %} Information is not available {%- else %} <table style="text-align: left"> <tr> <th style="width: 5%">Bus</th><th>Destination</th><th>Expected</th> </tr> {%- for call in state_attr('sensor.manorsfield_road_stand_2_buses', 'calls') %} <tr> <td>{{ call.service_description }}</td> <td style="max-width: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis">{{ call.destination }}</td> <td style="width: 20%; white-space: nowrap"> {%- if call.display_time[2] != ":" %} {{ call.expected_departure_time[11:16] }} {{ '(' }} {%- endif -%} {{ call.display_time }} {%- if call.display_time[2] != ":" %} {{- ')' }} {%- endif %} </td> </tr> {%- endfor %} </table> {% if state_attr('sensor.manorsfield_road_stand_2_buses', 'messages') is not none %} <br /> {% for message in state_attr('sensor.manorsfield_road_stand_2_buses', 'messages') %} <marquee behavior="scroll" direction="left">{{ message }}</marquee> {%- endfor %} {% endif %} {% endif %} {%- endif -%}) renders=2>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 512, in ensure_valid
self._compiled_code = self._env.compile(self.template)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2607, in compile
cached = self.template_cache[source] = super().compile(source)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/jinja2/environment.py", line 768, in compile
self.handle_exception(source=source_hint)
File "/usr/local/lib/python3.11/site-packages/jinja2/environment.py", line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File "<unknown>", line 1, in template
jinja2.exceptions.TemplateSyntaxError: unexpected '}'
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 694, in async_render_to_info
render_info._result = self.async_render(
^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 562, in async_render
compiled = self._compiled or self._ensure_compiled(limited, strict, log_fn)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 765, in _ensure_compiled
self.ensure_valid()
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 514, in ensure_valid
raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: TemplateSyntaxError: unexpected '}'