Several months ago I created a panel to show the consumption of some power lines.
Energy measurements are calculated using the integration platform (Integration - Riemann sum integral).
Today, after the latest updates (addon_core_mariadb_2.5.2, addon_a0d7b954_ssh_14.0.1 and core_2023.4.6) plus some reboots due to the necessity to join a couple of new zigbee devices, I find myself with some energy sensors (not all) that are in ‘unavailable’ state.
Is there a way to recover or at least reinitialize the value of power sensors?
I have disabled the historicization of data so my database is a empty file.
For me it would be enough to be able to reinitialize the value of the lost energy sensors.
I have the same problem. Seems the sensors don’t handle a zero input value any more, but I’m not sure.
I additionally get a mass of sensor errors:
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 579, in state
numerical_value = int(value)
ValueError: invalid literal for int() with base 10: 'unknown'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 852, in _update_entity_states
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 572, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 649, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 591, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 583, in state
raise ValueError(
ValueError: Sensor sensor.go_echarger_XXXXX_dwo has device class energy, state class None unit Wh and suggested precision None thus indicating it has a numeric value; however, it has the non-numeric value: unknown (<class 'str'>)