Comfoconnect component not reconnecting after using zehnder comfoconnect app

Hi,
I’m using the comfoconnect component to control my zehnder comfoairQ ventilation unit. I run homeassistant in a docker container.
Comfoconnect works great after I start home assistant but it stops working after I use the Android comfoconnect app (made by zehnder). This should not be a problem as the documentation states:
Note that it’s not possible to have multiple connection to the bridge at the same time. This integration will keep the connection open, and if you open the app, it will ask you to disconnect Home Assistant. If you close the app again, Home Assistant will reconnect automatically.

However it is my experience that Home Assistant does not reconnect after I close the android app. Only after I restart Home Assistant the connection works again (until I connect using the android app after with HA loses its connection again). It seems like the HA component is not triggered to reconnect again after losing its connection.

Values are not updated and I cannot control the fan speed.

How could I fix this?

I get the error below when I try to change fan speed.

2020-08-07 15:06:18 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.139865630396688] Not connected!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 130, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1260, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1295, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 209, in handle_service
    self._platforms.values(), func, call, required_features
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 454, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 595, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 485, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 134, in async_turn_on
    await self.hass.async_add_job(ft.partial(self.turn_on, speed, **kwargs))
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/comfoconnect/fan.py", line 109, in turn_on
    self.set_speed(speed)
  File "/usr/src/homeassistant/homeassistant/components/comfoconnect/fan.py", line 126, in set_speed
    self._ccb.comfoconnect.cmd_rmi_request(CMD_FAN_MODE_HIGH)
  File "/usr/local/lib/python3.7/site-packages/pycomfoconnect/comfoconnect.py", line 465, in cmd_rmi_request
    use_queue=use_queue
  File "/usr/local/lib/python3.7/site-packages/pycomfoconnect/comfoconnect.py", line 150, in _command
    self._bridge.write_message(message)
  File "/usr/local/lib/python3.7/site-packages/pycomfoconnect/bridge.py", line 127, in write_message
    raise Exception('Not connected!')
Exception: Not connected!

Thanks!

Update: I think it’s fixed by installing the newest version of the comfoconnect python libarary:
pip3 install --upgrade git+https://github.com/michaelarnauts/comfoconnect.git@97093b8b50710107c96eb101f2db83ae0f2ddfaf’

So it seems like the version installed automatically is older and having some issues.

I have the same issue here running HAS 0.112.5 and pycomfoconnect 0.3.

However, to install the latest relaese of pycomfoconnect, which at the moment of this post was release 0.4, I used your command as follows:

pip3 install --upgrade git+https://github.com/michaelarnauts/comfoconnect.git

This gave me:


Found existing installation: pycomfoconnect 0.3
Uninstalling pycomfoconnect-0.3:
Successfully uninstalled pycomfoconnect-0.3
Successfully installed pycomfoconnect-0.4

Using your command with the stuff behind the @ installed release 0.3 of pycomfoconnect, which was already installed in my case.

regards,
Jan

Update:
Even having installed pycomfoconnect-0.4 I still loose connection from HA to Comfoconnect from time to time…

Regards,
Jan

I’m using a recent docker image now that I have not modified. HA consistently reconnects almost immediately after I use the comfoconnect app. Not noticing any issues anymore.

I placed a cron job which restarts HA every 3 hours. By doing so the comfoconnect component reconnects in case it has lost connection.

Regards
Jan

Hello,

I also moved to Docker. I am on HA version 2021.6.2 now.

However, HA still loose the connection after a while and is not reconnecting…

Any ideas?

Jan

There was a software update of the comfoconnect box, which now allows up to 5 multiple connections.
Since this update I do not loose the connection any longer.

Regards,
Jan

1 Like

Thanks for the heads-up. My app offered it as well when I started it.
Hint, if you click “cancel”, your app doesn’t seem to offer it again, at least not immediately. I used the app on another phone to initialize the update. Perhaps clearing the app will reshow the notification.

For those interested, the changelog is the following. The firmware updated from 1.1.10 to 1.2.6.

  1. Support for up to 5 connections/sessions in parallel
  2. improved stability of local and remote connections
  3. Suppression of redundant error messages

After installation, I can connect with the app and HA at the same time which is an improvement.

I finally fixed the issue with regard to the loss off connections between HA and the Comfoconnect:
It was due to wifi connection of my Pi to my home network. Since I had connected my Pi via a lan cable the connection losses disappeared.
I noticed the issue because my Pi was not accessible from time to time, but it showed up again after a few minutes when it was connected via wifi.

Jan