YunoHost-Apps / homeassistant_ynh

Home automation platform package for YunoHost
https://www.home-assistant.io/
Apache License 2.0
20 stars 15 forks source link

Python errors & ZHA not working #319

Closed cichy1173 closed 2 months ago

cichy1173 commented 3 months ago

Describe the bug

Hello. After upgrade to Home Assistant 2024.4.2 my ZHA integration failed and I cannot connect and use these devices. I downgraded Home Assistant to 2024.4.1 using preupgrade backup but ZHA with Sonoff dongle E still fails.

Also I have strange error logs regarding Python

Context

Steps to reproduce

Log into Home Assistant and check integration. Go to Zigbee Home Automation and see failing

image

Expected behavior

ZHA should work and Python errors should not be present

Logs

Rejestrator: homeassistant
Źródło: /var/www/homeassistant/lib/python3.12/site-packages/homeassistant/runner.py:146
Pierwsze zdarzenie: 21:59:13 (26 zdarzenia)
Ostatnio zalogowany: 22:16:24

Error doing job: Exception in callback SerialTransport._read_ready()
ValueError: (11, None) is not a valid NcpResetCode

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/var/www/homeassistant/lib/python3.12/site-packages/serial_asyncio_fast/__init__.py", line 137, in _read_ready
    self._protocol.data_received(data)
  File "/var/www/homeassistant/lib/python3.12/site-packages/bellows/uart.py", line 84, in data_received
    self.frame_received(frame)
  File "/var/www/homeassistant/lib/python3.12/site-packages/bellows/uart.py", line 119, in frame_received
    self.rstack_frame_received(data)
  File "/var/www/homeassistant/lib/python3.12/site-packages/bellows/uart.py", line 160, in rstack_frame_received
    code, version = self._get_error_code(data)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/www/homeassistant/lib/python3.12/site-packages/bellows/uart.py", line 193, in _get_error_code
    return t.NcpResetCode(data[2]), data[1]
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/www/homeassistant/lib/python3.12/site-packages/bellows/types/basic.py", line 216, in __call__
    return super().__call__(value, names, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/enum.py", line 757, in __call__
    return cls.__new__(cls, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/enum.py", line 1179, in __new__
    raise exc
  File "/usr/local/lib/python3.12/enum.py", line 1156, in __new__
    result = cls._missing_(value)
             ^^^^^^^^^^^^^^^^^^^^
  File "/var/www/homeassistant/lib/python3.12/site-packages/bellows/types/basic.py", line 225, in _missing_
    new = int_type.__new__(cls, value)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'tuple'
ewilly commented 3 months ago

hum apparently not due to yunohost packaging, did you have a look at https://github.com/home-assistant/core/issues?q=is%3Aissue+label%3A%22integration%3A+zha%22 or the homeassistant forum ?

rungeard commented 3 months ago

Hi ! I have the exact same issue. Did you find any solutions ?

ewilly commented 3 months ago

see https://github.com/home-assistant/core/issues/115459

cichy1173 commented 3 months ago

Should be fixed in 2024.5 https://github.com/home-assistant/core/issues/115459#issuecomment-2075689248

TiberiusRegenschein commented 2 months ago

I did my tests with my installation using 2024.5 and all works again for me - Thanks for keeping an eye on the topic

cichy1173 commented 2 months ago

I tested 2024.5.0 and zigbee works again🍰. Thanks for quick packaging!