Hi… i have a few warnings and errors. Any ideas, how to solve them?
Logger: homeassistant.helpers.template
Source: helpers/template.py:1366
First occurred: 9:36:26 (14 occurrences)
Last logged: 10:48:20
Template variable warning: 'dict object' has no attribute 'click' when rendering '{{ value_json.click }}'
2nd: My Sensors:
- platform: template
sensors:
tempmaxheute:
friendly_name: 'Temp Max Heute'
value_template: "{{ state_attr('weather.weatherbit_rehfelde', 'forecast')[0].temperature }}"
unit_of_measurement: '°C'
Error:
Logger: homeassistant.components.template.template_entity
Source: components/template/template_entity.py:72
Integration: Template (documentation, issues)
First occurred: 10:59:56 (2 occurrences)
Last logged: 10:59:56
TemplateError('UndefinedError: None has no element 0') while processing template 'Template("{{ state_attr('weather.weatherbit_rehfelde', 'forecast')[0].temperature }}")' for attribute '_state' in entity 'sensor.tempmaxheute'
TemplateError('UndefinedError: None has no element 1') while processing template 'Template("{{ state_attr('weather.weatherbit_rehfelde', 'forecast')[1].precipitation }}")' for attribute '_state' in entity 'sensor.regenmengemorgen'
and
Logger: homeassistant.helpers.event
Source: helpers/template.py:391
First occurred: 10:59:56 (2 occurrences)
Last logged: 10:59:56
Error while processing template: Template("{{ state_attr('weather.weatherbit_rehfelde', 'forecast')[0].temperature }}")
Error while processing template: Template("{{ state_attr('weather.weatherbit_rehfelde', 'forecast')[1].precipitation }}")
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 389, in async_render
render_result = _render_with_context(self.template, compiled, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1358, in _render_with_context
return template.render(**kwargs)
File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 1304, in render
self.environment.handle_exception()
File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 925, in handle_exception
raise rewrite_traceback_stack(source=source)
File "<template>", line 1, in top-level template code
File "/usr/local/lib/python3.8/site-packages/jinja2/sandbox.py", line 326, in getattr
value = getattr(obj, attribute)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1382, in _fail_with_undefined_error
raise ex
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1374, in _fail_with_undefined_error
return super()._fail_with_undefined_error(*args, **kwargs)
jinja2.exceptions.UndefinedError: None has no element 0
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 505, in async_render_to_info
render_info._result = self.async_render(variables, strict=strict, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 391, in async_render
raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: UndefinedError: None has no element 0
But its working…
Any ideas? Thanks