You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the integration tries to log the values of the recording sensors (old gathering) an exception is thrown and the sensors does not update until the integrations is reloaded even if it seems as the integration fetches the sensors every hour according to the log:
_Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 664, in state
numerical_value = float(value) # type:ignore[arg-type]
^^^^^^^^^^^^
ValueError: could not convert string to float: 'unavailable'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/config/custom_components/bosch/sensor/recording.py", line 90, in async_update
await self.async_old_gather_update()
File "/config/custom_components/bosch/sensor/recording.py", line 73, in async_old_gather_update
self.attrs_write(last_reset=last_hour)
File "/config/custom_components/bosch/sensor/recording.py", line 50, in attrs_write
self.async_schedule_update_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1267, in async_schedule_update_ha_state
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1007, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
self.__async_calculate_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1069, in __async_calculate_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1013, in stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 666, in state
raise ValueError(
ValueError: Sensor sensor.reheater has device class 'energy', state class 'total' unit 'kWh' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: 'unavailable' (<class 'str'>)
It have also happened for sensor "sensor.routputproduced"
There are also the following warnings about State Class: 2024-11-28 17:05:17.210 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.routdoor_t1 (<class 'custom_components.bosch.sensor.recording.RecordingSensor'>) is using state class 'total' which is impossible considering device class ('temperature') it is using; expected None or one of 'measurement';
2024-11-28 17:05:17.229 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.ractualtemp (<class 'custom_components.bosch.sensor.recording.RecordingSensor'>) is using state class 'total' which is impossible considering device class ('temperature') it is using; expected None or one of 'measurement';
To Reproduce
Reload the integration and the exception is thrown as soon the integration handles the sensor "sensor.reheater"
See error
Expected behaviour
No exception thrown.
Screenshots
If applicable, add screenshots to help explain your problem.
Version
HA version: 2024.11.3
HA Bosch component version: 0.26.3
Python Bosch HTTP client version: 0.26.2
** Debug SCAN **
** IMPORTANT **
Go to Developer tools in Home Assistant, choose Service tab and choose bosch.debug_scan
Download file to your computer and upload it somewhere eg. https://jsonblob.com/
Additional context
Add any other context about the problem here.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Describe the bug
When the integration tries to log the values of the recording sensors (old gathering) an exception is thrown and the sensors does not update until the integrations is reloaded even if it seems as the integration fetches the sensors every hour according to the log:
_Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 664, in state
numerical_value = float(value) # type:ignore[arg-type]
^^^^^^^^^^^^
ValueError: could not convert string to float: 'unavailable'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/config/custom_components/bosch/sensor/recording.py", line 90, in async_update
await self.async_old_gather_update()
File "/config/custom_components/bosch/sensor/recording.py", line 73, in async_old_gather_update
self.attrs_write(last_reset=last_hour)
File "/config/custom_components/bosch/sensor/recording.py", line 50, in attrs_write
self.async_schedule_update_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1267, in async_schedule_update_ha_state
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1007, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
self.__async_calculate_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1069, in __async_calculate_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1013, in stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 666, in state
raise ValueError(
ValueError: Sensor sensor.reheater has device class 'energy', state class 'total' unit 'kWh' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: 'unavailable' (<class 'str'>)
It have also happened for sensor "sensor.routputproduced"
There are also the following warnings about State Class:
2024-11-28 17:05:17.210 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.routdoor_t1 (<class 'custom_components.bosch.sensor.recording.RecordingSensor'>) is using state class 'total' which is impossible considering device class ('temperature') it is using; expected None or one of 'measurement';
2024-11-28 17:05:17.229 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.ractualtemp (<class 'custom_components.bosch.sensor.recording.RecordingSensor'>) is using state class 'total' which is impossible considering device class ('temperature') it is using; expected None or one of 'measurement';
To Reproduce
Reload the integration and the exception is thrown as soon the integration handles the sensor "sensor.reheater"
Expected behaviour
No exception thrown.
Screenshots
If applicable, add screenshots to help explain your problem.
Version
** Debug SCAN **
** IMPORTANT **
Go to Developer tools in Home Assistant, choose Service tab and choose
bosch.debug_scan
Download file to your computer and upload it somewhere eg. https://jsonblob.com/
Additional context
Add any other context about the problem here.
bosch_scan(1).json
home-assistant_2024-11-28.log
The text was updated successfully, but these errors were encountered: