radon_uptime_string wrong type #34

Closed
opened 2025-07-08 08:33:36 -04:00 by AtHeartEngineer · 0 comments

Originally created by @Din-BH on 5/22/2023

Seems the type for the value of radon_uptime_string is not correct. Of course the issue goes away if you disable the sensor, but if one would like to keep the sensor, then a small fix would probably be needed. Log below.

2023-05-22 16:20:18.601 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform rd200_ble
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: '13d 03:53:02'
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 455, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 731, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 845, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 585, in async_write_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.fr_re22207111153_radon_uptime_string has device class None, state class measurement unit None and suggested precision None thus indicating it has a numeric value; however, it has the non-numeric value: 13d 03:53:02 (<class 'str'>)
*Originally created by @Din-BH on 5/22/2023* Seems the type for the value of radon_uptime_string is not correct. Of course the issue goes away if you disable the sensor, but if one would like to keep the sensor, then a small fix would probably be needed. Log below. ``` 2023-05-22 16:20:18.601 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform rd200_ble 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: '13d 03:53:02' 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 455, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 731, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 845, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 585, in async_write_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.fr_re22207111153_radon_uptime_string has device class None, state class measurement unit None and suggested precision None thus indicating it has a numeric value; however, it has the non-numeric value: 13d 03:53:02 (<class 'str'>) ```
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/rd200v2#34