Zehnder ComfoAir CA350 integration via serial connection (RS232) and MQTT

1 Like

anyone tried to interface with rs-485 of zehnder display touch, TPC, CAControl or Comfo CronoS ? thanks

Hi,

today I changed the main filters, but pressing reset button doesn’t reset the filter hours
What I have to do?

What is the state of binary_sensor.ca350_filter_status sensor? Based on my experience it only resets if it is already in ON state. And also according to the manual it resets if you press the button and power off - power back on the ventilation unit. I guess it somehow reflects the situation that you perform the maintenance / replace filters with the unit powered off.

Ok, I see
The status is OFF (I guess that it means 0)
I entered the Menu and set it from 0 to 1 to 0

after that, the counter was reset

Hi,
My setup has been working for months without any issues but I recently had to restart my RPi and now I see strange behavior:

  1. I am connecting to my RPi via VNC
  2. Everything looks fine until I start the ca350 script:

sudo /usr/local/share/ca350/bin/ca350

At this point I lose connection to my Pi and need to reboot to get back in again!

I’ve tried this several times and this behavior is consistent.

Any idea how this would be possible or why is it happening? Where to check etc.?

I would suggest that you connect to RPi with SSH only, change the debug parameter to True in config.ini and run the script again. It will be quite talkative so you should see if there is any specific place where it gets stuck.
I would also check if the serial port name has not changed, although it would simply throw an error message rather than freezing entire RPi.

Hi,
Not sure if that was the cause but I changed two things:

  1. I have removed the Serial Console option:
    image

  2. Before starting the script I have executed the script to create the VM

Even so, I noticed that after starting the script the accessibility to the RPi is very slow… so this could just be poor WiFi signal in my case…

However, it started to work now - so hopefully I’m back on track :slight_smile:

Hi adorobis&Tim! Great work and summary, thank you!
I have a problem. I did everything as described, but mqtt (rasbian) doesn’t want to connect to my HA broker. My other devices connect to my HA brokerage without any problems.

admin @ raspberrypi: ~ $ sudo python / usr / local / share / ca350 / bin / ca350

* CA350 MQTT Home Assistant *

13-06-2022 23:56:04 WARNING: Unable to connect to the MQTT broker. Retry in 10 seconds.
13-06-2022 23:56:14 WARNING: Unable to connect to MQTT broker. Retry in 10 seconds.
13-06-2022 23:56:24 WARNING: Unable to connect to the MQTT broker. Retry in 10 seconds.
13-06-2022 23:56:34 WARNING: Unable to connect to the MQTT broker. Retry in 10 seconds.
13-06-2022 23:56:44 WARNING: Unable to connect to the MQTT broker. Retry in 10 seconds.
13-06-2022 23:56:54 WARNING: Unable to connect to the MQTT broker. Retry in 10 seconds.
13-06-2022 23:57:04 WARNING: Unable to connect to the MQTT broker. Retry in 10 seconds.
13-06-2022 23:57:14 WARNING: Unable to connect to the MQTT broker. Retry in 10 seconds.
13-06-2022 23:57:24 WARNING: Unable to connect to the MQTT broker. Retry in 10 seconds.

my ca350 script:

SerialPort='/dev/ttyUSB0'                   # Serial port CA350 RS232 direct or via USB TTL adapter
RS485_protocol = True # Protocol type
refresh_interval = '10'  # Interval in seconds at which data from RS232 will be polled
enablePcMode = True     # automatically enable PC Mode (disable comfosense)
debug = True

MQTTServer='192.168.1.xx'            # MQTT broker - IP
MQTTPort = '1883'           # MQTT broker - Port
MQTTKeepalive = '45' # MQTT broker - keepalive
MQTTUser='xxxxx'                # MQTT broker - user - default: 0 (disabled/no authentication)
MQTTPassword='xxxxxx'        # MQTT broker - password - default: 0 (disabled/no authentication)

HAEnableAutoDiscoverySensors = True  # Home Assistant send auto discovery for temperatures
HAEnableAutoDiscoveryClimate = True  # Home Assistant send auto discovery for climate

HAAutoDiscoveryDeviceName = 'CA350'            # Home Assistant Device Name

HAAutoDiscoveryDeviceId = 'ca350'     # Home Assistant Unique Id
HAAutoDiscoveryDeviceManufacturer = 'Zehnder'
HAAutoDiscoveryDeviceModel = 'ComfoAir 350 Luxe'

What am I doing wrong?

Thanks

Can you ping your mqtt broker’s IP address from the system where you are running ca350 script?

Hi adorobis,
Yes of course

admin @ raspberrypi::~ $ ping 192.168.1.17
PING 192.168.1.17 (192.168.1.17) 56(84) bytes of data.
64 bytes from 192.168.1.17: icmp_seq=1 ttl=64 time=13.3 ms
64 bytes from 192.168.1.17: icmp_seq=2 ttl=64 time=11.3 ms
64 bytes from 192.168.1.17: icmp_seq=3 ttl=64 time=6.43 ms
64 bytes from 192.168.1.17: icmp_seq=4 ttl=64 time=16.1 ms
^C
--- 192.168.1.17 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 6.425/11.791/16.146/3.547 ms

This is the message after the interruption:

4-06-2022 17:13:31 WARNING: Can't connect to MQTT broker. Retrying in 10 seconds.
^CTraceback (most recent call last):
  File "/usr/local/share/ca350/bin/ca350", line 948, in <module>
    mqttc.connect(MQTTServer, MQTTPort, MQTTKeepalive)
  File "/usr/local/lib/python3.9/dist-packages/paho/mqtt/client.py", line 912, in connect
    self.connect_async(host, port, keepalive,
  File "/usr/local/lib/python3.9/dist-packages/paho/mqtt/client.py", line 979, in connect_async
    if port <= 0:
TypeError: '<=' not supported between instances of 'str' and 'int'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/share/ca350/bin/ca350", line 952, in <module>
    time.sleep(10)
KeyboardInterrupt

Define port without quotation marks. E.g. MQTTPort=1883 as it should be a number not string. Similarly MQTTKeepAlive. Btw, are you using the latest version of the script? The config should be in a separate file config.ini

I tried but not good. The script I download from here
GitHub - adorobis/hacomfoairmqtt: Home Assistant integration for ComfoAir 350 device via serial communication and MQTT
I also tried to modify the config.ini and copied it to the script

[DEFAULT]
# Serial port CA350 RS232 / RS485 direct or via USB TTL adapter
SerialPort=/dev/ttyUSB0
# Select RS232 or RS485 protocol
RS485_protocol=True
# Interval in seconds at which data from RS232 will be polled
refresh_interval=10
# automatically enable PC Mode (disable comfosense)
enablePcMode=True
debug=True

[MQTT]
# MQTT broker - IP
MQTTServer=192.168.1.17
# MQTT broker - Port
MQTTPort=1883
 # MQTT broker - keepalive
MQTTKeepalive=45
# MQTT broker - user - default: empty (disabled/no authentication)
MQTTUser=xxxxx
# MQTT broker - password - default: empty (disabled/no authentication)
MQTTPassword=xxxxxxx

I’m clueless…

Got it, it’s gone!!! :smiley:
MQTT keepalive setting was at fault in my script.
Thank you adorobis, I am very grateful!

1 Like

Hi @adorobis !
Something is still not good :(. The mqtt is ok, but no data.
I have a ComfoAir 350 Luxe edition.
I put the RS232-USB cable on the RS232 PC interface. I removed the external control panel

Can you give me some advice?

Change the RS485_protocol to False. It is for other devices which have RS485 interface.

1 Like

Hi @adorobis
I solved it :).
I set the RS485 protocol type to “False” in config.ini and the ca350 script and see the miracle … the data is coming.
Thank you for this integration and your work

HI,

I would like to know what kind of automation people are using here.
especially if there is any use case to better manage the temperature exchange during this hot summer :slight_smile: (eg. reduce the fan speed during the day and increase it during the night)

regards

As far as I know the ventilation with a reku does not have enough throughput to have major influence on the temperature in the building. It should be rather amount of air required by people that controls the speed. The only automations I have are controlling the fan speed depending on:

  • time of the day and usual family habits (e.g. when we usually cook, take shower etc)
  • presence of people (go to away mode when nobody at home)
  • humidity in the bathroom (turn on higher speed if it becomes too humid)
    Additionally you can have notifications when filter requires replacement etc.