I would like to add information, that the Energy Dashboard worked fine for a year with my energy sensor definitions, but suddenly (but I don’t know from when on) the sensor could not be added.
Maybe it is influenced by something beside the sensor or the dashboard itself?
Recorder or database? Could anybody explain how to check this?
Found this in the logs:
Logger: homeassistant.components.websocket_api.http.connection
Source: core.py:1500
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 07:11:47 (15 occurrences)
Last logged: 08:06:22
[139826959212224] Error handling message: Unknown error (unknown_error) Heiko from 88.153.88.137 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Safari/605.1.15)
[139829017173952] Error handling message: Unknown error (unknown_error) Heiko from 88.153.88.137 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Safari/605.1.15)
[139824562596288] Error handling message: Unknown error (unknown_error) Heiko from 88.153.88.137 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Safari/605.1.15)
[139824565521088] Error handling message: Unknown error (unknown_error) Heiko from 88.153.88.137 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Safari/605.1.15)
[139828623677120] Error handling message: Unknown error (unknown_error) Heiko from 88.153.88.137 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Safari/605.1.15)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/recorder/websocket_api.py", line 334, in ws_get_statistics_metadata
metadata = await async_list_statistic_ids(hass, statistic_ids_set_or_none)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 701, in async_list_statistic_ids
return await instance.async_add_executor_job(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 769, in list_statistic_ids
result = _statistic_by_id_from_metadata(hass, metadata)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 714, in _statistic_by_id_from_metadata
return {
^
File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 716, in <dictcomp>
"display_unit_of_measurement": get_display_unit(
^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 185, in get_display_unit
if state := hass.states.get(statistic_id):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 1500, in get
return self._states.get(entity_id.lower())
^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'lower'
Best regards
Heiko