home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.63k stars 30.78k forks source link

problem tempalte sensor / image processing process #101648

Closed pilot1981 closed 10 months ago

pilot1981 commented 1 year ago

The problem

Hi, I'm using image process to process images of my license plates.

to use it with automation I created these sensors templates:

template:

targhe auto

the result is:

Error while processing template: Template<template=({% for package in states.sensor.seventeentrack_packages_in_transit.attributes.packages %} >- {{ package.friendly_name }} ({{ package.tracking_number }}): {{ package.info_text }} {% endfor %}) renders=236> Error while processing template: Template<template=({% for package in states.sensor.seventeentrack_packages_in_transit.attributes.packages %} >- {{ package.friendly_name }} ({{ package.tracking_number }}): {{ package.info_text }} {% endfor %}) renders=240> Error while processing template: Template<template=({% for package in states.sensor.seventeentrack_packages_in_transit.attributes.packages %} >- {{ package.friendly_name }} ({{ package.tracking_number }}): {{ package.info_text }} {% endfor %}) renders=244> Error while processing template: Template<template=({% for package in states.sensor.seventeentrack_packages_in_transit.attributes.packages %} >- {{ package.friendly_name }} ({{ package.tracking_number }}): {{ package.info_text }} {% endfor %}) renders=248> Error while processing template: Template<template=({% for package in states.sensor.seventeentrack_packages_in_transit.attributes.packages %} >- {{ package.friendly_name }} ({{ package.tracking_number }}): {{ package.info_text }} {% endfor %}) renders=252> Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 568, in async_render render_result = _render_with_context(self.template, compiled, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2198, in _render_with_context return template.render(kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/jinja2/environment.py", line 1301, in render self.environment.handle_exception() File "/usr/local/lib/python3.11/site-packages/jinja2/environment.py", line 936, in handle_exception raise rewrite_traceback_stack(source=source) File "