michaelarnauts / home-assistant-comfoconnect

Home Assistant integration for Zehnder ComfoAir trough a Zehnder ComfoConnect LAN C.
Other
26 stars 13 forks source link

AttributeError: 'Bridge' object has no attribute 'connect'. Did you mean: '_connect'? #45

Closed roofburner closed 3 months ago

roofburner commented 4 months ago

Hi,

I ran this integration successful for a long time, but I no face this error after a power down/up of the Zehnder unit.

FYI: I successfully connect to the unit via the smartphone app...

Installation spec:

Home Assistant (docker)
  --> Core 2024.4.1
  --> Frontend 20240307.0

Zehnder ComfoAirQ integration via HACS
  --> v0.1.10

ComfoAir Q350 B R ST ERV Prem
  --> Firmware: R1.11.0
ComfoConnect LAN C
  --> Firmware: R1.5.1

I try to add the Zehnder, but I face this error:

UnknownErrorOccured

I'm not able to run a debug, but in the logs I see (tcpdump below):

2024-04-13 22:00:03.915 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 88, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 71, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 73, in wrapper
    result = await method(view, request, data, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 356, in async_configure
    result = await self._async_configure(flow_id, user_input)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 402, in _async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 506, in _async_handle_step
    result: _FlowResultT = await getattr(flow, method)(user_input)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/comfoconnect/config_flow.py", line 68, in async_step_user
    return await self._register()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/comfoconnect/config_flow.py", line 131, in _register
    await self.bridge.connect(self.local_uuid)
          ^^^^^^^^^^^^^^^^^^^
AttributeError: 'Bridge' object has no attribute 'connect'. Did you mean: '_connect'?

comfoconnect.zip

roofburner commented 4 months ago

Extra info: I installed aiocomfoconnect (https://github.com/michaelarnauts/aiocomfoconnect).

# python3 -m aiocomfoconnect discover
Discovered bridges:
<Bridge 192.168.0.177, UID=00000000001210138001144fd71e1811>

What else can I test?

roofburner commented 4 months ago

I did some further testing: I can control my Zehnder via the "build in" integration, i.e. https://www.home-assistant.io/integrations/comfoconnect/

Thus, I decide my ComfoConnect LAN C isn't broke...

LavermanJJ commented 4 months ago

Same error occurs for me when trying with 0.1.10. Downgrading to 0.1.9 works for me.

roofburner commented 4 months ago

I did some further testing. It seems, when you want to install v0.1.10, you first need to install v0.1.9 and then upgrade to v0.1.10. You can't install v0.1.10 "from scratch". Strange...

krismarc commented 3 months ago

I just followed errors: https://github.com/michaelarnauts/home-assistant-comfoconnect/pull/49/files seems like methods at source were renamed with leading underscores and code in this repo wasn't alligned. I am not sure if that's enough to make it compabile. However, worked to run the integration. https://github.com/michaelarnauts/aiocomfoconnect/compare/v0.1.9...v0.1.10#

michaelarnauts commented 3 months ago

This is indeed the fix. Thanks @krismarc!

I'll make a new release with this fix.