Drastically improve logging/error handling. The current log messages are many times completely useless. Any message should have at a minimum:
- the right level (currently some clear ERRORs are reported as DEBUG on INFO)
- a clear reason (why that happened, what file, what line, what config statement, …)
- a clear, actionable way to deal with it (how to fix it)
A few examples that were dismissed in other contexts, maybe this will get some attention instead of being instantly dismissed as irrelevant.
2020-10-28 11:59:23 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: not a valid value for dictionary value @ data['action'][2]['entity_id']. Got None. (See ?, line ?).
as a result, all automations are disabled. Absolutely no idea what do do about it, or where to look.
2020-09-26 10:11:12 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/template/template_entity.py", line 265, in _async_template_startup
self.hass, template_var_tups, self._handle_results
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/event.py", line 792, in async_track_template_result
tracker.async_setup()
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/event.py", line 518, in async_setup
self._info[template] = template.async_render_to_info(variables)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/template.py", line 306, in async_render_to_info
render_info._result = self.async_render(variables, **kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/template.py", line 285, in async_render
return compiled.render(kwargs).strip()
File "/srv/homeassistant/lib/python3.7/site-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/srv/homeassistant/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/srv/homeassistant/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "<template>", line 1, in top-level template code
ZeroDivisionError: 0.0 cannot be raised to a negative power
No idea where the error comes from. I don’t care about the backtrace in the core code, I care about the config that caused the error.
2020-09-24 20:32:38 WARNING (MainThread) [homeassistant.components.template.binary_sensor] The 'entity_id' option is deprecated, please remove it from your configuration
Where is this coming from? What config file? What line in that config?
Examples are too many to list here, it seems to be a systemic problem.