Page 1 of 8

Zehnder/Stork WHR Ventilation Unit

Posted: Sunday 27 December 2015 18:05
by Sappien
I've hooked up my Zehnder WTW unit to Domoticz. (RJ45 -> RS232). This way it's possible to control the unit and to read all the temperatures

Image

Let me know if your interested, then I make a setup guide for it.


----- update 14-01-2019

I've made a new script, check

https://github.com/AlbertHakvoort/Stork ... oticz-MQTT

Re: Zehnder WHR Ventilation Unit

Posted: Sunday 27 December 2015 18:30
by ThinkPad
Always interesting to see how it works, so please explain :D (also as a backup for yourself, for later).

Re: Zehnder WHR Ventilation Unit

Posted: Sunday 27 December 2015 18:57
by bizziebis
Does it work for a basic WHR 930?
I don't have anything fancy like ComfoSense..

Re: Zehnder WHR Ventilation Unit

Posted: Sunday 27 December 2015 22:58
by Sappien
Yes, comfosense is not requierd. I will post a manual tomorrow

Verstuurd vanaf mijn LG-D855 met Tapatalk

Re: Zehnder WHR Ventilation Unit

Posted: Tuesday 29 December 2015 10:34
by Sappien
Zehnder/Stork WHR status&control scripts version 0.01

(ventserver.sh is made by Shapeshifter @ tweakers.net)

1) Download the zip file and extract it on your linux server ( /var/bin/whr ? )

2) Add 4 dummy temperature sensors (Domoticz > Hardware > Create Virtual sensors)

3) Add 4 dummy Push On Buttons (speed 0 / speed 1 / speed 2 /speed 3)

4) Edit the 4 Push On buttons, and add the corresponding speed script

Image

5) Edit the ventserver.py and change the the serial port (line 13 port = '/dev/YPort')

6) Edit the status.sh and change the Domoticz idx id's and folder path.

7) Run the status.sh and check if your dummy device's are updated

8) Add a cronjob so the status.sh is executed every minute

Re: Zehnder WHR Ventilation Unit

Posted: Tuesday 29 December 2015 11:01
by ThinkPad
Nice, thanks for sharing!

Instead of pasting in the 'On Action' 4 times, you could also create a Lua script that triggers when one of the 4 switches is being used.
Something like this:

Code: Select all

if devicechanged['Ventilation Speed 0'] or devicechanged['Ventilation Speed 1'] or devicechanged['Ventilation Speed 2'] or devicechanged['Ventilation Speed 3'] then
  if devicechanged['Ventilation Speed 0'] == 'On' then
  os.execute('speed0.py')
  end

  if devicechanged['Ventilation Speed 1'] == 'On' then
  os.execute('speed1.py')
  end
end
That will make it a bit more easier to backup (when backupping Domoticz, the On Action is easy to forget).
Instead of executing the speedX.py with os.execute maybe you can also directly execute the command that is in those Python scripts.

Re: Zehnder WHR Ventilation Unit

Posted: Tuesday 29 December 2015 11:23
by Sappien
@Thinkpad,

It's a little bit dirty scripting at this moment ;) It needs some code cleaning and optimalization.

I'm gonna try your lua suggestion.

The required cable is a rj45 -> rs232

rj45 pin 2 -> rs232 pin 2
rj45 pin 3 -> rs232 pin 3
rj45 pin 8 -> rs232 pin 5

Image

Image

Re: Zehnder WHR Ventilation Unit

Posted: Tuesday 29 December 2015 12:45
by ThinkPad
With http://domoticz.com/forum/viewtopic.php?f=30&t=8505 you could hook it up to your network if you want. Makes you a bit more flexible in the placing of the Raspberry.
Communicating with the device is quite easy then, i think you can use something like 'nc' (netcat) to send the hex-commands to the unit.

Re: Zehnder WHR Ventilation Unit

Posted: Tuesday 29 December 2015 12:55
by Sappien
I'm already using a rs232>network converter with socat ;)

Re: Zehnder WHR Ventilation Unit

Posted: Tuesday 29 December 2015 14:23
by Sappien
Using nc is working to send commands

(set whr to speed 0)

echo -e '\x07\xF0\x00\x99\x01\x01\x48\x07\x0F' | nc ipadres port

Also a idea to retrieve data after sending a command?

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Tuesday 29 December 2015 18:21
by bizziebis
Thanks! I will open up my WTW tomorrow and will try it on my raspberry. I have to clean the unit anyway ;)

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Sunday 10 January 2016 17:50
by bizziebis
Too bad I can't get it to work. Looks like I have no signal at the RS232 output from my WHR. When I measure, it only shows 0.7 volts on RX, and 0V on TX.
When I open up a serial connection nothing changes in the levels.

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Wednesday 27 January 2016 9:27
by bizziebis
I got it to work after all. Seems like all I did was swap TX and RX, and now it's working :)

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Wednesday 27 January 2016 21:56
by parador
Dear bizziebis,

do you couple the RS232 cable directly to the PI pins? Or do you use an interface in between?

Thanks for your answer!

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Thursday 28 January 2016 6:06
by bizziebis
I used a RS232 to USB convertor. If you wire them directly you can destroy your PI if the power levels are not exactly right.

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Monday 07 March 2016 11:41
by Marbaf
Hi all,
Happy to find this topic on domoticz, thanks for that!
As far as I can see, Sappien and ThinkPad, you are running domoticz on a Linux PC equipped with a RS232 plug and the connection to the ventilation unit is done thanks to a RJ45 to RS232 cable, am I right?

I'd like to plug my ComfoAir to a raspberry. I found a GPIO connection solution (raspiVMC) but I would be more confident in your solution bizziebis which is, please correct if I am wrong: RJ45 plug of ventilation unit -> RJ45-RS232 cable -> RS232-USB adapter -> one of USB plug of raspberry.

Did someone try this: http://www.fhemwiki.de/wiki/ComfoAir ?

Best Regards

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Monday 07 March 2016 19:14
by Sappien
Hi Marbaf,

The wiring setup is right.

There's also a newer version of the server script, but I didn't had time to update the script.. maybe soon

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Tuesday 08 March 2016 13:00
by Marbaf
Hello Sappien,

Do you mean ventserver.py by server script?
Are the author or where do you get it?
Is there any change in the protocol or is it a better interfacing?

Thanks.

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Saturday 25 June 2016 21:23
by domoticzcom1234
All,

Today I tried to connect my WHR 930 with a serial printboard using a serial to USB converter I bought at ebay. (Search on ebay for "USB 2.0 to RS232 Serial DB9 9 PIN Cable Adapter GPS PDA Converter", very cheap but should work)

I followed the instructions but running the status.sh only returned ONCE (out of many) a result in Domoticz but only with incorrect values (54 degrees outside temp. and more invalid information. The rest of the times it fails with the error message "integer expression expected". A reboot, disconnect cables, poweroff the WTW did not helped.

Update:
By running the following script I can change the speed:
-------------------------
#!/bin/sh
/bin/echo -e '\x07\xF0\x00\x99\x01\x01\x48\x07\x0F' > /dev/ttyUSB0
---------------------------

The script as posted gives a lot "integer expression expected" errors:
What could be the issue with the script? Please help.

Thanks in advance.

-----------------
ERROR CODES AFTER RUNNING STATUS.SH
-----------------
Ventserver not running..
./status.sh: line 50: [: : integer expression expected
Status WHR
{
"status" : "OK",
"title" : "Update Device"
}
{
"status" : "OK",
"title" : "Update Device"
}
{
"status" : "OK",
"title" : "Update Device"
}
{
"status" : "OK",
"title" : "Update Device"
}
./status.sh: line 70: [: : integer expression expected
./status.sh: line 78: [: : integer expression expected
./status.sh: line 86: [: : integer expression expected
./status.sh: line 94: [: : integer expression expected
----------------------------------------------------------------------------------------------------------------------------------------------

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Monday 11 July 2016 19:11
by bejdehanz
Hello domoticzcom1234,

I had the same issue, the problem is that the wiring instruction for the RJ45 to rs232 cable is wrong, it should be:

rj45 pin 2 -> rs232 pin 3
rj45 pin 3 -> rs232 pin 2
rj45 pin 8 -> rs232 pin 5