home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.82k stars 30.08k forks source link

Aranet generates outliers and ValueErrors #106699

Closed shaunplee closed 7 months ago

shaunplee commented 9 months ago

The problem

The Aranet4 integration occasionally produces very extreme outlier data. image The spikes in the above temperature graph have values of 4361.5 °F, 1,460.8 °F, 926.4 °F, and 4,256.2 °F, compared to the baseline correct value of around 60 °F.

What version of Home Assistant Core has the issue?

core-2023.12.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Aranet

Link to integration documentation on our website

https://www.home-assistant.io/integrations/aranet/

Diagnostics information

home-assistant_aranet_2023-12-30T02-54-20.823Z.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

There are numerous messages like this in the log. Some may be related to Bluetooth connectivity. Maybe corrupted data due to Bluetooth drops?

2023-12-29 17:13:34.441 INFO (Thread-4 (_run)) [google.api_core.bidi] Re-established stream
2023-12-29 17:15:31.867 ERROR (MainThread) [homeassistant.components.aranet] Unexpected error updating Aranet4 20914 data: 223 is not a valid Status
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/passive_update_processor.py", line 373, in _async_handle_bluetooth_event
    update = self._update_method(service_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/aranet/__init__.py", line 27, in _service_info_to_adv
    return Aranet4Advertisement(service_info.device, service_info.advertisement)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aranet4/client.py", line 270, in __init__
    self.readings.decode(value)
  File "/usr/local/lib/python3.11/site-packages/aranet4/client.py", line 107, in decode
    self.status = Status(value[5])
                  ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/enum.py", line 712, in __call__
    return cls.__new__(cls, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/enum.py", line 1135, in __new__
    raise ve_exc
ValueError: 223 is not a valid Status
2023-12-29 17:15:32.209 INFO (MainThread) [homeassistant.components.aranet] Coordinator Aranet4 20914 recovered
2023-12-29 17:19:49.048 ERROR (MainThread) [homeassistant.components.aranet] Unexpected error updating Aranet4 20914 data: 113 is not a valid Status
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/passive_update_processor.py", line 373, in _async_handle_bluetooth_event
    update = self._update_method(service_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/aranet/__init__.py", line 27, in _service_info_to_adv
    return Aranet4Advertisement(service_info.device, service_info.advertisement)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aranet4/client.py", line 270, in __init__
    self.readings.decode(value)
  File "/usr/local/lib/python3.11/site-packages/aranet4/client.py", line 107, in decode
    self.status = Status(value[5])
                  ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/enum.py", line 712, in __call__
    return cls.__new__(cls, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/enum.py", line 1135, in __new__
    raise ve_exc
ValueError: 113 is not a valid Status
2023-12-29 17:19:49.205 INFO (MainThread) [homeassistant.components.aranet] Coordinator Aranet4 20914 recovered

Additional information

No response

home-assistant[bot] commented 9 months ago

Hey there @aschmitz, @thecode, mind taking a look at this issue as it has been labeled with an integration (aranet) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `aranet` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign aranet` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


aranet documentation aranet source (message by IssueLinks)