Limych / ha-iaquk

Indoor Air Quality Sensor Component for Home Assistant
MIT License
105 stars 15 forks source link

ValueError: invalid literal for int() with base 10: 'Good' #117

Closed LuckyTriple7 closed 11 months ago

LuckyTriple7 commented 1 year ago

Environment

Describe the bug

Air Quality Level Sensor always Unknown: Index Sensor is working.

Configuration.yaml


iaquk:
  wohnzimmer:
    sources:
      temperature: sensor.bme680_esszimmer_temperatur
      humidity: sensor.bme680_esszimmer_luftfeuchtigkeit
      co2: sensor.eco2_value_esszimmer
      tvoc: sensor.total_volatile_organic_compound_esszimmer
      hcho: sensor.formaldehyd_pms5003st_wohnzimmer
      pm:
        - sensor.feinstaub_1_0um_pms5003st_wohnzimmer
        - sensor.feinstaub_2_5um_pms5003st_wohnzimmer
        - sensor.feinstaub_10_0um_pms5003st_wohnzimmer

Steps to Reproduce

Expected behavior

Debug log

Update for sensor.wohnzimmer_iaq_level fails 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: 'Good'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 554, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 784, in async_device_update await coro File "/config/custom_components/iaquk/sensor.py", line 102, in async_update if self.state == LEVEL_EXCELLENT File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 583, in state raise ValueError( ValueError: Sensor sensor.wohnzimmer_iaq_level 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: Good (<class 'str'>)


Add your logs here.

Additional context