Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comfoconnect Pro (newer replacement model for Comfoconnect LAN C) is unsupported #53

Open
Testingfor101 opened this issue May 6, 2024 · 7 comments

Comments

@Testingfor101
Copy link

Hello,

I am using ComfoConnect PRO device, Product Number: 30006323.
With every version of this integration I get the same error.

Here is the log after failed integration:

Logger: homeassistant
Source: /usr/src/homeassistant/homeassistant/runner.py:146
First occurred: 10:15:30 PM (2 occurrences)
Last logged: 10:26:30 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/aiocomfoconnect/bridge.py", line 213, in _process_message
message = await self._read()
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiocomfoconnect/bridge.py", line 176, in _read
msg_len_buf = await self._reader.readexactly(4)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/streams.py", line 750, in readexactly
raise exceptions.IncompleteReadError(incomplete, n)
asyncio.exceptions.IncompleteReadError: 0 bytes read on a total of 4 expected bytes

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/aiocomfoconnect/bridge.py", line 108, in _read_messages
await self._process_message()
File "/usr/local/lib/python3.12/site-packages/aiocomfoconnect/bridge.py", line 247, in _process_message
raise AioComfoConnectNotConnected
aiocomfoconnect.exceptions.AioComfoConnectNotConnected


Logger: aiohttp.server
Source: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:421
First occurred: 10:15:30 PM (2 occurrences)
Last logged: 10:26:30 PM

Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for
return await fut
^^^^^^^^^
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/aiocomfoconnect/bridge.py", line 168, in _send
return await asyncio.wait_for(fut, TIMEOUT)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/tasks.py", line 519, in wait_for
async with timeouts.timeout(timeout):
File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in aexit
raise TimeoutError from exc_val
TimeoutError

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

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 77, 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 133, in _register
await self.bridge.cmd_start_session(True)
File "/usr/local/lib/python3.12/site-packages/aiocomfoconnect/bridge.py", line 172, in _send
raise AioComfoConnectTimeout from exc
aiocomfoconnect.exceptions.AioComfoConnectTimeout

@michaelarnauts
Copy link
Owner

Is the Comfoconnect Pro something like a Comfoconnect Lan C? I have never heard of it, and I don't know if it is compatible. According to your log, it seems like it's using a different protocol.

Or do you still have a Comfoconnect Lan C, and is the Comfoconnect Pro something else?

@Testingfor101
Copy link
Author

Comfoconnect PRO looks like new version of LAN C.

@michaelarnauts
Copy link
Owner

I'm afraid I'm not able to help you since I don't have a Comfoconnect Pro, nor is there any information available.

If the protocol is similar to the Comfoconnect LAN C, but maybe a different port or something, having a packet dump of the Android App connecting locally to your Comfoconnect Pro could help.

@michaelarnauts michaelarnauts changed the title Unknown error occurred when setting up integration Comfoconnect Pro (newer replacement model for Comfoconnect LAN C) is unsupported May 24, 2024
@goncalossilva
Copy link

I have one of these newer devices. Do you recommend one particular method or app for capturing packets? And what action(s) should I perform when capturing?

@michaelarnauts
Copy link
Owner

On the original Comfoconnect, the local communication between the app and the device is unencrypted.

Some of the possibilities to capture the traffic:

  • Run an android emulator with the app in your computer and capture the traffic it makes.
  • Use a network switch with port mirroring, and mirror the port that is connected to the Comfoconnect to a computer that captures the traffic.
  • Use a wireless hotspot that stores the traffic it passes.

You'll end up with a pcap you can open in Wireshark. Prepare for a lot of evenings staring at hex values trying to figure out how it works. This is how I did it for the original Comfoconnect. It took a lot of time.

Some tips:

  • Make multiple captures of the same action (setting fan speed for example) and check for similarities in the captures.
  • Read the protocol docs of the aiocomfoconnect repo. This is applicable on the actual Ventilation Unit, so it should match for the Comfoconnect Pro.
  • If you are lucky, the Comfoconnect Pro does more abstraction, and supplies nice API's you can call.
  • If the traffic between the app and the Comfoconnect Pro is encrypted, you should look at mitmproxy, there are guides online in how go remove the certificate pinning from the APK.

Good luck!

@Unloadable
Copy link

should be easy.
"Global management and smart home solutions: The ComfoConnect PRO enables easy integration into smart home systems and offers automation protocols such as Modbus RTU/TCP."

Link

@szbartnik
Copy link

Comfoconnect PRO looks like new version of LAN C.

Sorry for off topic @Testingfor101 but how you got the new ComfoConnect Pro?

It's still not available in official distribution - asked Zehnder representatives few weeks ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants