Problems with ComfoAir binding and serial port

Hello community

I have been experimenting with OpenHAB for a while and also read many posts in this community. I am stuck with a specific problem regarding the comfoair binding.

I am using OpenHAB 2 and the comfoair binding 1.9. I understand that this is an OpenHAB1 binding, but supposed to work with OpenHAB2. It was installed via PaperUI.
OpenHAB runs on a Windows 10 machine (after some frustrating time, I gave up on the Raspberry and OpenHabian) and so far things work they way they are supposed to. Managed to find my three Sonos devices and can control them. But with the comofair-Binding, I am stuck. I need it to control a Zehnder ComfoAir350 ventilation system. The Windows machine is next to the ventilation device and connected via an ATEN UC232A USB-Serial adapter. I followed this (https://github.com/openhab/openhab1-addons/wiki/Samples-Comfo-Air-Binding) to create a section of the sitemap and items for the ventilation.
When I start OpenHAB, the ComfoEASE control stays on (it should go off, if OpenHAB takes over). This is the first indication, that OpenHAB cannot find the ventilation system. In the UI, I cannot get any values from the ventilation and using the switches, nothing happens.
I thought this is because of me using the wrong port. So I changed the “port:” setting in comofair.cfg to all possible values (/dev/ttyS0 to S5, /dev/ttyUSB0 to 5, COM1 to COM5). The Aten Adapter identifies as COM3 in the Windows Device Manager. After each change I restart OpenHAB to reload the config. But nothing happens.

So, here are a couple of questions:

  1. Do I need the serial binding in addition to the comfoair binding?
  2. Is it correct to use “port:COM3” under Windows or do I need to use “port:/dev/ttyUSB2” in the config file?
  3. The settings for the serial port Baud Rate: 9600, Data Bits: 8, Parity: None, Stop Bits: 1, Flow Control: None. Is that correct?
  4. Can it be a problem of the USB Adapter?
  5. Does anybody have the same setup and got it up and running? Can you perhaps send me your comfoair.cfg and snips of sitemap and items?

I have seen this (Comfoair binding (1.9) for Zehnder in openHAB2) thread, but following it, I can still not get it to work.

Any more ideas?

Thanks!

Hi Jochen,

I’m running the ComfoAir binding without any hassle and without problems.*) What I do differently though: I disconnected the CCEASE prior to the start of the binding. I didn’t test it, whether the binding and the CCEASE can operate in parallel, but I know, that in my old smarthome.py environment, the comfoair-plugin couldn’t be run in parallel. If I remember correctly, there’s a problem with collisions or something and I doubt, that the comfoair binding for openHAB can prevent that. So my advice is: disconnect the CCEASE (I just installed a switch at the CCEASE, so that I can turn it on easily, if the installateur is doing some maintenance).

*) ok, I lied a little! :wink: sometimes, I get some errors in the log, but this seems to be normal, the processing unit of the comfoair has as I understood a little bug, resulting in rubbish sent back over the RS232, but this is just every week or so.

Hi Thomas

Thank you for the speedy reply. I will try this later today. It might certainly be a thing. I noticed, that if I disconnect the openHAB-machine from serial port, sometimes the CCEAse goes black and I have to re-start the ventilation system.

Any advice on the comfoair.cfg? Can you perhaps post the content of your file here? And maybe a snip from your sitemap and items files which concerns the comfoair? I am still struggling to get it up and running in a proper way.
Can also be by private message.

Thanks a lot
Jochen

Hi Jochen,

config is simple straight-forward, I nearly just copied it from the binding-wiki:

As I guess, you’re geman speaking, I didn’t translate the german expressions! :wink:
comfoair.cfg

# Serial port of the Zehnder ComfoAir to connect to
#port=/dev/ttyS0
port = /dev/ttyUSB1

# refresh interval in milliseconds (optional, defaults to 60000)
#refresh=

comfoair.items

/* Comfoair */

Number Lueftung_Auto_Mode   "Modus"                 <selfAutoMode> (gComfoair, UG_Technik)

String Lueftung_Aussentemperatur_Message "Aussen [%s]"          <temperature> (UG_Technik)
String Lueftung_Innentemperatur_Message "Innen [%s]"            <temperature> (UG_Technik)
String Lueftung_Ventilator_Message "Ventilator [%s]"            <selfAiring> (gComfoair, UG_Technik)
String Lueftung_Filterlaufzeit_Message  "Filterlaufzeit [%s]"       <selfRuntime> (gComfoair, UG_Technik)
String Lueftung_Status_Message  "Status [%s]"               <selfError> (gComfoair, Lueftung)

Number Lueftung_Control     		"Steuerung"                 		<settings> 		(gComfoair, UG_Technik)		{comfoair="activate"}
Number Lueftung_Fan_Level   		"Stufe [%d]"                		<selfAiring>	(gComfoair, UG_Technik)		{comfoair="fan_level"}
Number Lueftung_Komfortemperatur	"Zieltemperatur [%.1f °C]"        	<temperature>	(gComfoair, UG_Technik)		{comfoair="target_temperatur"}
Number Lueftung_Bypass      		"Bypass [MAP(comfoair_bypass.map):%s]"    <selfBypass>	(gComfoair, UG_Technik)		{comfoair="bypass_mode"}


Number Lueftung_Aussenlufttemperatur "Aussenzuluft [%.1f °C]"			<temperature>	(gComfoair, UG_Technik)		{comfoair="outdoor_incomming_temperatur"}
Number Lueftung_Fortlufttemperatur 	"Aussenabluft [%.1f °C]"			<temperature>	(gComfoair, UG_Technik)		{comfoair="outdoor_outgoing_temperatur"}
Number Lueftung_Zulufttemperatur 	"Raumzuluft [%.1f °C]"				<temperature>	(gComfoair, UG_Technik)		{comfoair="indoor_incomming_temperatur"}
Number Lueftung_Ablufttemperatur 	"Raumabluft [%.1f °C]"				<temperature>	(gComfoair, UG_Technik)		{comfoair="indoor_outgoing_temperatur"}

Number Lueftung_Zuluft      		"Ventilator Zuluft [%d %%]" 		<selfAiring> (gComfoair, UG_Technik) {comfoair="incomming_fan"}
Number Lueftung_Abluft      		"Ventilator Abluft [%d %%]"			<selfAiring> (gComfoair, UG_Technik) {comfoair="outgoing_fan"}
Number Lueftung_Filterlaufzeit  	"Filterlaufzeit [%d h]"				<selfClock> (gComfoair, UG_Technik) {comfoair="filter_running"}
Number Lueftung_FilterfehlerI   	"Filter (intern) [MAP(comfoair_filter.map):%s]"	<selfFilterintern>	(gComfoair, UG_Technik)	{comfoair="filter_error_intern"}
Number Lueftung_FilterfehlerE   	"Filter (extern) [MAP(comfoair_filter.map):%s]"	<selfFilterextern>	(gComfoair, UG_Technik)	{comfoair="filter_error_extern"}
String Lueftung_Fehlermeldung   	"Fehlercode [%s]"					<selfError>		(gComfoair, UG_Technik)		{comfoair="error_message"}

snippet of the .sitemap

	Frame label="Lüftungsanlage" {
		Text item=Lueftung_Fan_Level label="Lüftung [MAP(comfoair_level.map):%d]" icon="selfAiring" {
			Frame {
				Switch item=Lueftung_Auto_Mode label="Modus" mappings=[1="Auto", 0="Manuell"]
				Switch item=Lueftung_Fan_Level label="Stufe" mappings=[1="A", 2="1", 3="2", 4="3"]
			}
			Frame {
				Setpoint item=Lueftung_Komfortemperatur step=0.5 minValue=15 maxValue=25
				Text item=Lueftung_Aussentemperatur_Message
				Text item=Lueftung_Innentemperatur_Message
				Text item=Lueftung_Ventilator_Message
				Text item=Lueftung_Bypass
			}
			Frame {
				Text item=Lueftung_Filterlaufzeit_Message
				Text item=Lueftung_Status_Message
				Switch item=Lueftung_Control mappings=[1="App", 0="CCEase"]
			}
		}	
	}

comfoair_level.map

1=Abwesend/Urlaub
2=Level 1
3=Level 2
4=Level 3
0=Geschlossen
undefined=undefiniert
-=undefiniert

comfoair_bypass.map

1=Offen
0=Geschlossen
undefined=undefiniert
-=undefiniert

comfoair_filter.map

1=Wechseln
0=Ok
undefined=undefiniert
-=undefiniert

sorry, do you know if the binding could work even with Comfoair 200?
thanks!

Thank you very much. Extremely helpful. Yes, German is no problem…

And no, sorry. No idea about the Comfoair 200. If it has the same RS232 port, it might work. I know that the 550 should work.

Another stupid question. Where do you put the .map files? Also in the sitemaps directory?

Jochen

I don’t think so, I guess the protocols of the ComfoAir 200 is not the same as the one for the 350 (which is much the same as the 550). The Wiki of the binding lists this:

Binding should be compatible with the Zehnder ComfoAir 350 ventilation system. ComfoAir 550 is untested but should supposedly use the same protocol. The same is true for the device WHR930 of StorkAir, G90-380 by Wernig and Santos 370 DC to Paul.

unfortunately no 200.

Within openHAB you can use Map-Files for transformation of statuscodes to text. e.g. 0=off and 1=on.
Therefore you have to activate the transformation mapping(1) and then you can use map-syntax within items or rules.

(1) to activate Transformation in OH2 you can use PaperUI (Add-ons >> TRANSFORMATIONS >> Map Transformation) or you can edit /Services/addons.cfg:

# A comma-separated list of transformation services to install (e.g. "map,jsonpath")
transformation = map

after that, you can copy the map-files to /transform, they’re then called like in the example items:

Number Lueftung_FilterfehlerI   	"Filter (intern) [MAP(comfoair_filter.map):%s]"	<selfFilterintern>	(gComfoair, UG_Technik)	{comfoair="filter_error_intern"}

the item Lueftung_FilterfehlerI gets the value 0 - the “comfoair_filter.map” transforms 0 to “Ok”.

Thanks for all the input and help.
Unfortunately, I seem to be unable to get it to work properly, even with the CCEase disconnected.
I played around quite a while now and I suspect that my USB-to-Serial adapter might be the cause of the problem. I don’t have another one to test right now. It is identified and correctly installed as COM3 in Windows 10 device manager. But neither using port:COM3 nor using port:/dev/ttyUSB2 or port:/dev/ttyS2 in the comfoair.cfg file works. I also tried assigning it COM1 and 2 and changing the comfoair.cfg accordingly.
It is best if I get another USB-serial adapter and try again, I think.

Hmm… Forget about the port:/dev/... syntax if using Windows, this won’t work! :wink:
tthe device manager shows the COM-Port, if it’s COM3, then the usage in your comfoair.cfg is as you typed:

# Serial port of the Zehnder ComfoAir to connect to
#port=/dev/ttyS0
port = COM3

# refresh interval in milliseconds (optional, defaults to 60000)
#refresh=

I don’t know how to test the connection in Windows. But here’s the link to my RS232-USB converter (yes, it’s Amazon, but anyway: https://www.amazon.de/Manhattan-USB-Seriell-Konverter-USB-Seriell/dp/B0007OWNYA/). The important thing is, the converter should use the Prolific PL-2303RA chipset. This is the recommended one (which works fine with my ComfoAir and my heating controller).

All right. I tried port=COMx anyways several times before. Does also not work. I believe I have a Profilic adapter, but I will try the one you linked.
Will be back as soon as I got hold of the adapter.

ok, it’s not the biggest investition, but if you open the device manager in windows, the chipset will be shown in the settings.

Oh, but be careful, I don’t have personal experience, but judging from this thread, there could be problems with the PL2303 with Windows higher than 7?

Will do so.

Now I have first to solve a different problem. I re-connected my CCEase and it only shows “NC” now. Several power-off - power-on cycles did not help…

I hate that machine. Need to buy the Q450 with Lan Gateway instead…
:wink:

Jochen

So, more news from me. Meanwhile, I tried with a Raspberry Pi 3 and OpenHabian. And also with an older Windows PC which has still serial ports built-in. Both options did not work- the ventilation is not recognized and the comfoair-binding und OpenHAB2 does not work.
I am lost here. No idea where to look any further.

Perhaps I simply wait until somebody re-wrote the binding for OpenHAB2 native and with autodiscover-funktion. This binding was the main reason I tried OpenHAB. After countless hours spent, I have zero new functionality.

On top of that, removing the CCEase was not a good idea. I had to contact Zehnder and get the procedure for a hard reset explained. Will see tomorrow if I can get it to work again.

Anyways, thanks for all the help.
Best
Jochen

Hi Jochen,

with openHABian and a RS232-USB converter with PL2303 chipset it should work like a charm?

Only thing, what troubles me, is your hassle with removing the CCEase. What were your proceedings for this?
I did the following a few times

  1. remove power from the ComfoAir
  2. opening the CCEase and unscrewing the cables
  3. connecting the RS232 converter
  4. power on the ComfoAir

If I need the CCEase for some reason, just did it the other way round.

My ComfoAir 350 is now 4years old. I guess, yours is 2016? Perhaps there was some change in the control unit?
Just to be sure, do you have a ComfoAir 350 Luxe? There seems to be some different models of a 350. Does your front look like this: https://knx-user-forum.de/filedata/fetch?id=847759 ? Mine does not have a display integrated in the front but has the control unit on top: http://www.intranet-der-dinge.de/sites/default/files/Lueftungsanlage_Hardware2.jpg

The type reference of mine is “ComfoAir 350 R Luxe ERV”, perhaps yours is a different one?

Hi Thomas

I have the Comfoair 350 R Luxe E (Enthalpie). It is about 6 yeas old and the mainboard has version 3.1. Last year, a Zehnder technician updated it to the newest software version.
I do remove the CCEase exactly as you describe, but at the ventilation device, not at the other end of the cable.
The last try I made was with an older Windows PC which had two build-in serial ports. So I can say it is not a problem of the USB adapter.

Jochen

I run my setup with a modified comfoair binding since OH1.7. It always hangs internally at the fluh command. Maybe this helpful for you.