Describe the bug
Log Details (ERROR)
Logger: homeassistant.components.sensor
Source: components/sensor/init.py:583
Integration: Sensor (documentation, issues)
First occurred: 23:23:11 (4 occurrences)
Last logged: 23:32:52
Error adding entities for domain sensor with platform nasa
Error while setting up nasa platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 581, in state
numerical_value = float(value) # type:ignore[arg-type]
ValueError: could not convert string to float: 'Centaurus A: A Peculiar Island of Stars'
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 846, 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.nasa_apod has device class None, state class measurement unit Apod and suggested precision None thus indicating it has a numeric value; however, it has the non-numeric value: Centaurus A: A Peculiar Island of Stars (<class 'str'>)
To Reproduce
Steps to reproduce the behavior:
I think that this started happening after installing homeassistant 2023.5.0
Expected behavior
Nasa entities to be available
Additional context
Sensors fail to be created and related enrities are unavailable