I’m beginning to wonder if home assistant receives data through the serial port at all. On my raspberry pi I run home assistant in docker container. Do I need to somehow activate the serial port when home assistant runs in docker? I receive data in correct format (checked with minicom) when I connect directly to my raspberry pi via SSH.
Now I see these errors:
Logger: homeassistant.helpers.event
Source: helpers/template.py:391
First occurred: 8:11:04 PM (2 occurrences)
Last logged: 8:11:04 PM
Error while processing template: Template("{{ (states(“sensor.serial_sensor”)|from_json)[“5C:CF:7F:8E:32:E4”][“Temperature”] }}")
Error while processing template: Template("{{ (states(“sensor.serial_sensor”)|from_json)[“5C:CF:7F:8E:32:E4”][“Voltage”] }}")
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 “”, line 1, in top-level template code
File “/usr/src/homeassistant/homeassistant/helpers/template.py”, line 1310, in from_json
return json.loads(value)
File “/usr/local/lib/python3.8/json/init.py”, line 357, in loads
return _default_decoder.decode(s)
File “/usr/local/lib/python3.8/json/decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/local/lib/python3.8/json/decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 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: JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Logger: homeassistant.components.template.template_entity
Source: components/template/template_entity.py:72
Integration: Template (documentation, issues)
First occurred: 8:11:04 PM (2 occurrences)
Last logged: 8:11:04 PM
- TemplateError(‘JSONDecodeError: Expecting value: line 1 column 1 (char 0)’) while processing template ‘Template("{{ (states(“sensor.serial_sensor”)|from_json)[“5C:CF:7F:8E:32:E4”][“Temperature”] }}")’ for attribute ‘_state’ in entity ‘sensor.tmp102_temperature’
- TemplateError(‘JSONDecodeError: Expecting value: line 1 column 1 (char 0)’) while processing template ‘Template("{{ (states(“sensor.serial_sensor”)|from_json)[“5C:CF:7F:8E:32:E4”][“Voltage”] }}")’ for attribute ‘_state’ in entity ‘sensor.tmp102_voltage’