Add support for the new ComfoConnect Pro#74
Conversation
|
Related to this discussion: #55 |
|
Thanks! I think this looks fine, odd that there is such a small difference between the two devices. Can you take a look at the lint issue? |
|
I agree it's odd that there is this difference between the two devices, but I suspect that they may have rewritten some of the networking inside the device, but were able to salvage much of the software of the old device? Or they just completely rebuild it using the existing spec, who knows. To be honest, I haven't tested the complete integration yet so I'm not sure if all the addresses are the same - but there's no reason for me to suspect they've changed. Linting issue has been fixed. |
|
Thanks! I do wonder if maybe the flow should be changed, because currently, we are waiting for a timeout to know that we should register. This can perhaps explain the timeout you are also seeing in Home Assistant. If you don't have a better idea, I'm okay with merging this. |
|
CI still fails. Can you also run black to format the code? poetry run black --check aiocomfoconnect/*.py |
|
The current flow for this fix is far from elegant, I agree. Obviously we could add a flag to the CLI interface but I don't like that and it would require the Home Assistant integration to add another option to the setup wizard. There is an option to do a version call before logging in. I've added the command to my branch, but I don't have a LAN C so I am unable to see the difference, could you run this? poetry run python -m aiocomfoconnect version --host <your host>On the Pro, this is the output: I've asked my digital junior developer for other options, this is the response:
However, I'm not very hopeful we can differentiate with only 2 devices. One other option is to call the HTTP endpoint that is exposed on port 80 on the device, and search the returned HTML for the text I should have fixed the linting and formatting issues btw. |
|
I might try to get a pcap from the Zehnder application to see how it is handling it later this week, but we could also accept this fix for now and perhaps later (well.... you know ;) ) find a better way. |
|
Using your version call times out on my Comfoconnect LAN C It's because you are using the same source UUID and destination UUID. Oddly enough, this then works fine on the ComfoConnect PRO? When I change your version code to be like this: async def run_version(host: str):
"""Request version information from the bridge (no registration required)."""
bridges = await discover_bridges(host)
if not bridges:
raise BridgeNotFoundException("No bridge found")
bridge = bridges[0]
await bridge.connect(DEFAULT_UUID)
try:
msg = await bridge.cmd_version_request()
print(f"gatewayVersion : {msg.gatewayVersion}")
print(f"serialNumber : {msg.serialNumber}")
print(f"comfoNetVersion : {msg.comfoNetVersion}")
finally:
await bridge.disconnect()It works, because the destination UUID is correct then. |
|
Also, calling the HTTP endpoint won't work, because the Comfoconect LAN C doesn't expose a HTTP server, and I don't like to try and wait for a timeout just to know what system you have. But maybe the Comfoconnect PRO sends a specifc UUID (because in your code, it seemed to accept the default uuid)? What do you see when you run |
I installed a new ComfoConnect Pro a few weeks ago, which seems to be replacing the previous version, and adds Wifi and other functionality that was in another connect box previously. The library didn't seem to properly connect to this new ComfoConnect Pro, even though it does support the same protocol. After some retrying, the library is able to connect, but since it initially fails the HACS integration doesn't really play nice. I used Claude to change the connection logic to also support this device, apparently it keeps the TCP connection open instead of disconnecting after a failed authentication, and just waits for a new registration.
I asked Claude to also add some test for this functionality, all other tests are still working. I do note that whenever I run the discover functionality the first time, it tends to not find the bridge. After running it a second time, it does run. Might need some more investigation but I suspect this won't be an issue with the Home Assistant integration.
Please let me know if you need anything changed or something else. Hopefully we can merge this, update the HACS integration as well with the new version and get the ComfoConnect Pro working in Home Assistant :) .