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

I am a bit flabbergasted… It works, but I don’t know how?

grafik

This is the list of all devices in the UI no ca350 there…

It seems the entities are there however…

I have one other issue… Is there a way to get the custom UI working in the iOS App?
This is what I get on my iPhone:

Interestingly I have the same behaviour. All entities have been discovered but they don’t show up in the MQTT integration. Other than that all works great :slight_smile:

I’ve created a set of automations that would spin up the ventilation to full blast for a period of time (usually 30 min in my case) and then returns to the previous state. This is helpful when you’ve used the bathroom, taken a shower or had some smelly cheese in the Fondue (greetings from Switzerland!). In german, this is called “stosslueften”, hence the names below.

grafik

grafik

If you would like to replicate that, here are the instructions:

The Timer actually needs a run-time set. In my case I’ve set it to 30 min (00:30:00).

  • Add the following automations to automations.yaml or create them via the UI:
- id: StosslueftenTimerstart
  alias: Stosslüften Start
  trigger:
  - platform: state
    entity_id: input_boolean.stossluften_toggle
    to: 'on'
  condition: []
  action:
  - service: timer.start
    entity_id: timer.stosslueften
  - service: notify.pushovernotifier
    data:
      message: Stosslüften an für {{ (states.timer.stosslueften.attributes.duration).split(":")[1]
        | int }} min.
  - service: input_text.set_value
    data:
      value: '{{ states.fan.ca350_fan.attributes.speed }}'
    entity_id: input_text.stossluften_initial_state
  - service: fan.set_speed
    data:
      speed: high
    entity_id: fan.ca350_fan
  mode: single
- id: StosslueftenTimerFinish
  alias: Stosslüften Abbruch
  trigger:
  - platform: state
    entity_id: input_boolean.stossluften_toggle
    to: 'off'
  condition: []
  action:
  - service: timer.finish
    entity_id: timer.stosslueften
  - service: notify.pushovernotifier
    data:
      message: Stosslüften aus (zurück auf {{ states.input_text.stossluften_initial_state.state
        }})
  - service: fan.set_speed
    data:
      speed: '{{ states.input_text.stossluften_initial_state.state }}'
    entity_id: fan.ca350_fan
  mode: single
- id: StosslueftenTimerstop
  alias: Stosslüften Stop
  trigger:
  - platform: event
    event_type: timer.finished
    event_data:
      entity_id: timer.stosslueften
  action:
  - service: input_boolean.turn_off
    entity_id: input_boolean.stossluften_toggle

I use Pushover to notify me when these Fan events are triggered. You can safely leave that out or adapt it to your notification solution of choice.

On your dashboard you then need to add the timer and the boolean_input to see how much time is left for the fast ventilation and to turn it on by hand using the boolean_input switch (this also allows for turning it off before the timer expires).

Hope this is helpful for someone :wink:

2 Likes

Nice, another idea is to set high or medium speed when humidity in a bathroom exceeds set value. Another one to set it to away when people are not at home, to low at night and to medium in high usage times e.g. mornings and evenings when bathrooms are used or Sunday noon when there is a lot of cooking in the kitchen :slight_smile:
And on my todo list: set the ventilation to medium when the cooker hood is turned on - need to get some sensor or smart switch in it first.

set the ventilation to medium when the cooker hood is turned on - need to get some sensor or smart switch in it first

In my installation I have air being pulled from the kitchen and the bathrooms, the other rooms are only getting air pushed in. So, in my case, it would be better to open the window, turn off the ventilation and turn the cooker hood at the highest level. Otherwise I would pull potentially fatty air into the kitchen ventilation vents and into the bathrooms.
I haven’t quite figured out how the fan modes work in the Comfoairs. On the Comfosense control, I can set input or output only. It might also be a good idea to only blow new air in from the outside when the cooker hood is on and don’t pull air out, but I’m not quite sure that this is the way the fan controls work (temperature exchange wouldn’t really work, would it?). In any case, fan control (other than speed) is not supported yet, is it?

I think this is exactly how the comfoair behaves when you have cooker hood connected to it (there is such possibility).

Indeed. It is on a to do list but not sure if possible at all. This is not in the protocol documentation we have. But for some other models with RS485 interface this option is there.

Strangely enough… Today it is even working in the App… so this fixed itself.

Hello again,

checking back on the installation of the MQTT component, I see the following Warnings on the console:

comfoair/speed/set is 40
FanLevel 4
03-02-2021 05:47:47 WARNING: Expected return not found
03-02-2021 05:47:47 WARNING: function get_bypass_status could not get serial data
03-02-2021 05:47:49 INFO: Changed the ventilation to 4
03-02-2021 05:47:49 WARNING: Expected return not found
03-02-2021 05:47:49 WARNING: function get_preheating_status could not get serial data
03-02-2021 05:47:51 WARNING: get_ventilation_status function could not get serial data
03-02-2021 05:51:12 WARNING: Incorrect length
03-02-2021 05:51:12 WARNING: get_temp function could not get serial data
03-02-2021 06:13:58 WARNING: Incorrect length
03-02-2021 06:13:58 WARNING: function get_fan_status could not get serial data
comfoair/speed/set is 20
FanLevel 2
03-02-2021 06:17:49 INFO: Changed the ventilation to 2
03-02-2021 06:17:49 WARNING: Expected return not found
03-02-2021 06:17:49 WARNING: get_temp function could not get serial data
03-02-2021 06:17:51 WARNING: Expected return not found
03-02-2021 06:17:51 WARNING: get_ventilation_status function could not get serial data
03-02-2021 06:17:53 WARNING: Expected return not found
03-02-2021 06:17:53 WARNING: function get_fan_status could not get serial data
03-02-2021 06:17:53 WARNING: get_filter_status function could not get serial data
03-02-2021 06:23:27 WARNING: Incorrect length
03-02-2021 06:23:27 WARNING: get_filter_status function could not get serial data

Is this normal?

Regards,
Pete

Same here. The serial interface of comfoair units is super unreliable hence all the recent changes to validate the received data and repeat communication.

Have question: I received RJ45 <> DB9 female adapter & trying to figure out pinout. Is the view on diagram above a view on adapter DB9 side (female in my case) or it’s a view on DB9 <> USB side (male) ? I know that it’s noted that it is male view - but wanted to be sure if it means RPi side.

Typically RS232 cables are female and ports are male. So pin numbers on female (cable) are mirror view of that of male. Just follow the pin numbers accordingly. They are generic, not comfoair specific. The same on RJ45 side.

Thanks. For now I didn’t succeeded. I connected it through RJ<>DB9 connector, tried also via direct connection from my ComfoAir 350 RS232 to USB. In both cases receiving:

07-02-2021 15:05:40 WARNING: Changing the RS232 mode went wrong
07-02-2021 15:05:40 INFO: Home Assistant MQTT Autodiscovery Topic Set: homeassistant/fan/ca350_fan/config
07-02-2021 15:05:40 INFO: Home Assistant MQTT Autodiscovery Topic Set: homeassistant/sensor/ca350_[nametemp]/config
07-02-2021 15:05:41 INFO: Successfull subscribed to the comfoair/on/set topic
07-02-2021 15:05:41 INFO: Successfull subscribed to the comfoair/speed/set topic
07-02-2021 15:05:41 INFO: Successfull subscribed to the comfoair/comforttemp/set topic
07-02-2021 15:05:41 INFO: Successfull subscribed to the comfoair/ha_climate_mode/set topic
07-02-2021 15:05:41 INFO: Successfull subscribed to the comfoair/ha_climate_mode/fan/set topic
07-02-2021 15:05:42 WARNING: get_temp function could not get serial data
07-02-2021 15:05:44 WARNING: get_ventilation_status function could not get serial data
07-02-2021 15:05:46 WARNING: get_filter_status function could not get serial data
07-02-2021 15:05:48 WARNING: function get_fan_status could not get serial data
07-02-2021 15:05:50 WARNING: function get_bypass_status could not get serial data
07-02-2021 15:05:52 WARNING: function get_preheating_status could not get serial data

Please double check your connection. Tell us more on which port you are connecting to on the comfoair unit, what type of port in each case you are using on your rpi. Here is clear explanation of the connections required:

Also remember that you also have to disconnect the Ease (or whichever you have) controller as two devices can’t be connected to RS232 at the same time.

Yes - I’am aware of this. For now I am trying to use only RS232 <> USB converted (cheap one, not mentioned FTDI support) plugged directly into CA350 & to Rpi3. It appeared as ttyUSB1 and I eddied it in ini.file.
I also disconnected external screen (RJ45).
My CA350 board (11 years old) look like that one:

Awesome work!!!

@Dapolux, Do you think that everything should work also with a cable rj45 - usb,
eg https://www.amazon.com/Console-console-Routers-Router-Windows/dp/B075V1RGQK/ref=sr_1_3?crid=ZE450XYUG6M0&dchild=1&keywords=rj45+usb&qid=1612738135&sprefix=rj45+us%2Caps%2C308&sr=8-3

Did you test this configuration?

Hello,

In the description on your link, it is mentionning that it replaces the rs232, so maybe it can work (i didn’t tried it). Personnaly i get 2 different cables (rj45/rs232 and rs232/usb) to follow what i found on some tutorials.

I also had this problem. There are two possible causes.

  • Pin layout is reversed so you can write TX to Pin3 (always middle one) rs232. But the RX to read is the wrong way round. (This was in my case)

  • Your ventilation is in the ‘off’ position. Set your ventilation on position 1,2 or 3.

Thank you @Dapolux, i see.
I found in another forum another option.
It seems that we need only 3 wires, we can plug an rj45 with and usb, it reduces the “connections” in between

1 Like

That is exactly what I have been sharing in this thread. Only 3 cables connected to RJ45 are needed.