Olen / homeassistant-plant

Alternative Plant component of home assistant
308 stars 23 forks source link

Lots of excetions in log with 2024.6.0.b2 #167

Closed EDelsman closed 3 months ago

EDelsman commented 4 months ago

The beta version of HA shows many exceptions when the entities used by plant are not yet known during startup: Two kinds, one for groups, the other not liking unknown as a state for many numerical values

Logger: homeassistant.components.sensor Bron: helpers/entity_platform.py:600 integratie: Sensor (documentatie, problemen) Eerst voorgekomen: 18:45:51 (40 gebeurtenissen) Laatst gelogd: 18:45:52

Error adding entity sensor.verbena_bonariensis_illuminance for domain sensor with platform plant Error adding entity sensor.verbena_bonariensis_conductivity for domain sensor with platform plant Error adding entity sensor.buitenplant_6_soil_moisture for domain sensor with platform plant Error adding entity sensor.verbena_bonariensis_temperature for domain sensor with platform plant Error adding entity sensor.buitenplant_6_air_humidity for domain sensor with platform plant Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 658, in state numerical_value = int(value) ^^^^^^^^^^ ValueError: invalid literal for int() with base 10: 'unknown'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 661, in state numerical_value = float(value) ^^^^^^^^^^^^ ValueError: could not convert string to float: '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 600, in _async_add_entities await coro File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 914, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1355, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1000, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1126, in _async_write_ha_state state, attr, capabilities, shadowed_attr = self.async_calculate_state() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1061, in async_calculate_state state = self._stringify_state(available) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1006, in _stringify_state if (state := self.state) is None: ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 665, in state raise ValueError( ValueError: Sensor sensor.binnenplant_1_illuminance_2 has device class 'illuminance', state class 'measurement' unit 'lx' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: 'unknown' (<class 'str'>)

Olen commented 3 months ago

This should (finally) have been resolved with the latest release. Can you verify that?

EDelsman commented 3 months ago

I no longer see the errors. Thanks!