jason0x43 / hacs-hubitat

A Hubitat integration for Home Assistant
MIT License
189 stars 46 forks source link

Convert strings to numbers Errors #245

Closed syepes closed 4 months ago

syepes commented 6 months ago

Hello,

After the last updates I have notices the following errors. looks like its trying to converts string to numbers:

2024-01-04 23:08:59.622 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback Hub._process_event({'content': {'data': None, 'descriptionText': 'VOC is 2.256 ppb', 'deviceId': '1978', 'displayName': 'Sensor - Int...edroom - Main', ...}})
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 644, in state
    numerical_value = int(value)
                      ^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 'Harmful'
2024-01-04 23:20:29.224 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback Hub._process_event({'content': {'data': None, 'descriptionText': 'Temperature is 18.5 °C', 'deviceId': '1323', 'displayName': 'Sensor - Interior - Salon', ...}})
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 644, in state
    numerical_value = int(value)
                      ^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 'dc'
ValueError: Sensor sensor.sensor_interior_air_quality_bedroom_main_carbondioxide_level has device class 'carbon_dioxide', state class 'measurement' unit 'None' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: 'Bad' (<class 'str'>)
2024-01-04 23:22:59.614 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback Hub._process_event({'content': {'data': None, 'descriptionText': 'VOC is 2.046 ppb', 'deviceId': '1978', 'displayName': 'Sensor - Int...edroom - Main', ...}})
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 644, in state
    numerical_value = int(value)
                      ^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 'Bad'
jason0x43 commented 6 months ago

Could you post the capabilities of your device?

jason0x43 commented 6 months ago

The issue should be fixed for power level entities (the dc error above) in v0.9.19. I'm not sure yet about the others -- I'll need to see the capabilities to know what's being expected.

jason0x43 commented 6 months ago

Just checking -- are you still seeing this issue?

jason0x43 commented 4 months ago

I'm closing this as it likely has been fixed with the last couple of updates. If it comes up again we can reopen the issue.