Page 2 of 8

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Thursday 14 July 2016 20:22
by Sappien
I'm working on a new script, hope to finish it next week

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Friday 15 July 2016 21:44
by Sappien
The new version is working much better (also checking on faulty values etc)

This weekend some last testing.. ;)

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Saturday 16 July 2016 23:09
by Sappien
version 0.3 is ready for testing!
ventv03.zip
(3.51 KiB) Downloaded 334 times
Check/install if you have the python-requests module (apt-get install python-requests)

You need the following dummy devices in Domoticz

outsideairtemp
supplyairtemp
returnairtemp
exhaustairtemp
returnairlevel (dummy type text)
supplyairlevel (dummy type text)
fanlevel (dummy type text)

also add 5 On Push buttons (for controlling the fan level)

Level 0 = Auto --> (On Action) script:///var/bin/vent/ventlevel.sh 0
Level 1 = Away --> (On Action) script:///var/bin/vent/ventlevel.sh 1
Level 2 = Low --> (On Action) script:///var/bin/vent/ventlevel.sh 2
Level 3 = Middle --> (On Action) script:///var/bin/vent/ventlevel.sh 3
Level 4 = High --> (On Action) script:///var/bin/vent/ventlevel.sh 4

Put the files on your server and change the settings as listed below:

##### ventserver.sh

change the serialport (line 124)

##### ventclient.sh

enter Domoticz ip/port (line 11/12)

change the idx of the dummy devices (line 16-22)

when ventserver is running on different server you must change ip/port (line 44)

##### ventlevel.sh

when ventserver is running on different server you must change ip/port (line 11)


Add a cronjob for the ventserver and ventclient

@reboot /var/bin/vent/ventserver.sh
* * * * * /var/bin/vent/ventclient.sh

And the result :
2016-07-16 23_10_34-Domoticz.png
2016-07-16 23_10_34-Domoticz.png (46.56 KiB) Viewed 6251 times

ToDo List

- Check if ventserver is running
- Check if Domoticz is running
- FanLevel status (It's working but only when changed by the script.. Not with a remote)
- Add more data from the unit

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Monday 18 July 2016 21:21
by Sappien
I see 5 downloads, but no comments yet... Everything is working fine I hope?

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Monday 18 July 2016 22:36
by bizziebis
I will check it in a couple of days. The previous version is running fine at the moment with some minor adjustments.

You talk about an On action pointing to "setlevel.sh". Did you mean "ventlevel.sh"? That file is in the zip, the other isn't.

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Monday 18 July 2016 22:57
by Sappien
You're Right.. wrong filename used with the dummy buttons

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Monday 25 July 2016 9:04
by bejdehanz
I installed version 0.3 yesterday with the server and client on different servers.
The only issue I have is that the temperature values are not correct all the time, they fluctuate between -20 and 100.

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Monday 25 July 2016 9:26
by Sappien
When you run the vent.sh in the console, are the values also incorrect?

Are you able to change the fan speed?

Is the unit directly connected to your server (or with a lan2serial?)

Image

On my own server it's running stable for 3 weeks now..

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Tuesday 26 July 2016 13:12
by bejdehanz
I have domoticz and the ventclient running on my synology NAS. The ventserver is running on a RPI connected to the WHR with an USB to serial converter.

When run in the console I only got values for the Airlevels, the temperatures showed no data. Changing the fanspeed was possible all the time.

After a reboot of the RPI yesterday evening everything worked okay again. This morning it was still okay, hope it stays that way.

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Wednesday 27 July 2016 21:36
by domoticzcom1234
Hi bejdehanz. In return to your message of ยป Monday 11 July 2016 19:11 i would like to mention that my setup uses a rs323 to USB converter. So not a RJ45 connector. The WHR930 Luxe only offers a rs232 connection in my case.

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Wednesday 27 July 2016 22:03
by domoticzcom1234
Sappien: I have installed your script and followed your instructions. Somehow It keeps failing on my RPI.

By running my own (simple script) I can change the speed of the WHR930 in domoticz:

----simple script-------
#!/bin/sh
/bin/echo -e '\x07\xF0\x00\x99\x01\x01\x48\x07\x0F' > /dev/ttyUSB0
---------------------------

The push as described in your instruction button on the other hand does not respond. Also sending the command using the commandline does somehow fails. Very frustrating. When running /scripts/wtwunitwhr930/ventlevel.sh 2 for example I do not get a response.

When running /home/domoticz/domoticz/scripts/wtwunitwhr930/ventclient.sh I once received the following response:
No outsideAirTemp Data
No supplyAirTemp Data
No returnAir Data
No exhaustAir Data
No returnAirlevel Data
No supplyAirlevel Data
FanLevel = Unknown

I simpy cant get it working. Could this be caused by the Comfocontrol Ease controler? If yes this would be strange as the unit, as mentioned, is able to receive instructions from the script. Anyone an idea?

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Thursday 28 July 2016 18:35
by Sappien
Could you start the vent server&client in separate console's and check if they give any (error) message?

Otherwise edit the ventserver.sh and remove # on line 49

print self.outsideAirTemp

Then start the ventserver (not the client) and after max 60 seconds the outside air temp should be displayed.

Image

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Friday 29 July 2016 13:08
by domoticzcom1234
Thanks for your reply. Much appreciated. I followed your instructions and added some extra information.

root@domo:/dev# lsusb
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
Bus 001 Device 005: ID 0658:0200 Sigma Designs, Inc.
------------------------

So again FYI the WTW unit changes the speed with below script.
----simple script-------
#!/bin/sh
/bin/echo -e '\x07\xF0\x00\x99\x01\x01\x48\x07\x0F' > /dev/ttyUSB0

--------
However I'm (almost) sure I already added the root user to the dialout group to get the appropriate rights using the /dev/ttyUSB0 device I executed the following command:

sudo usermod -a -G dialout root

I get some the results, see below:
---------------------------
root@domo:/home/domoticz/domoticz/scripts/wtwunitwhr930# ./ventserver.sh
Exception in thread Thread-4:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 505, in run
self.__target(*self.__args, **self.__kwargs)
File "./ventserver.sh", line 82, in GetVentilationData
self.supplyAirLevel = int(raw[14], 16)
IndexError: list index out of range

Exception in thread Thread-5:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 505, in run
self.__target(*self.__args, **self.__kwargs)
File "./ventserver.sh", line 96, in GetVentilationData
self.highTime = int(''.join(raw[24:27]), 16)
ValueError: invalid literal for int() with base 16: ''

-------------------------------
root@domo:/home/domoticz/domoticz/scripts/wtwunitwhr930# ./ventclient.sh
outsideyAirTemp = 22.5
Traceback (most recent call last):
File "./ventclient.sh", line 128, in <module>
r.json()
TypeError: 'dict' object is not callable
root@domo:/home/domoticz/domoticz/scripts/wtwunitwhr930# ./ventclient.sh
outsideyAirTemp = -20.0
Traceback (most recent call last):
File "./ventclient.sh", line 128, in <module>
r.json()
TypeError: 'dict' object is not callable


-----------------
Now I edit the ventserver.sh and remove # on line 49 print self.outsideAirTemp

The string is found on line 60 and not line 49. :-)
----------------

When executing ./ventserver.sh I receive the following:
----------------
root@domo:/home/domoticz/domoticz/scripts/wtwunitwhr930# ./ventserver.sh
Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 505, in run
self.__target(*self.__args, **self.__kwargs)
File "./ventserver.sh", line 67, in GetVentilationData
raw = self.SendSerialCommand('\x07\xF0\x00\x0F\x00\xBC\x07\x0F', ['07', '0f'])
File "./ventserver.sh", line 50, in SendSerialCommand
serialConnection = serial.Serial(port = self.port, baudrate = 9600, bytesize = serial.EIGHTBITS, parity = serial.PARITY_NONE, stopbits = serial.STOPBITS_ONE, timeout = self.timeout)
File "/usr/lib/python2.7/dist-packages/serial/serialutil.py", line 260, in __init__
self.open()
File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 276, in open
raise SerialException("could not open port %s: %s" % (self._port, msg))
SerialException: could not open port /dev/ttyUSB0: [Errno 5] Input/output error: '/dev/ttyUSB0'
------------------
This keeps me busy..... many errors. What could be wrong?

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Friday 29 July 2016 13:22
by Sappien
Maybe you're Missing some Python modules.. I'll Make a list which modules I have installed

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Friday 29 July 2016 14:47
by domoticzcom1234
That would be great.... waiting for it. tnx

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Sunday 31 July 2016 10:43
by domoticzcom1234
Searched on the internet but it seems to be an unsolved raspberry debian python issue. Issue is listed on any sites but there is no solution for now. On a default debian distribution the scripts should work. Agree?

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Sunday 31 July 2016 10:50
by Sappien
I've got a pi somewhere.. Let me try it out..

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Sunday 31 July 2016 16:47
by domoticzcom1234
Can't wait to get the test results....

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Monday 01 August 2016 15:04
by Sappien
On my Pi no issue....

Image

I'm running with Python 2.7.3 / 4.4.16-v7+ / Raspian Wheezy

Do you've got a spare SD card? Try a fresh installation

Re: Zehnder/Stork WHR Ventilation Unit

Posted: Saturday 06 August 2016 0:00
by domoticzcom1234
Complete new install unfortunately with the following (different) response:

root@raspberrypi:/home/pi/wtwunitwhr930# ./ventserver.sh
Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "./ventserver.sh", line 87, in GetVentilationData
if fanLevel != self.fanLevel and self.fanLevel != False:
UnboundLocalError: local variable 'fanLevel' referenced before assignment

root@raspberrypi:/home/pi/wtwunitwhr930# ./ventclient.sh
No outsideAirTemp Data
No supplyAirTemp Data
No returnAir Data
No exhaustAir Data
No returnAirlevel Data
No supplyAirlevel Data
FanLevel = Unknown

What could be wrong? Do you have a confo control installed in your livingroom to control the fan speed? Could this interfere with this serverscript?

I also tried the "simple script" and again I can control the fanspeed. This is only transmitting a command. Receiving/reading the values from the WHR to the Raspberry seems to be an issue.

In my current setup I have my serial rs232 to USB directly connected to the rs232 connector on the WHR930 board and my RPI.
setup: WHR rs232 connector <--> rs232 to USB cable <--> RPI
So not with a RJ45 connector from the WHR to a rs232 connector.

Tomorrow I will try this setup again using the cable I created using the instructions of user : bjdehanz
( rj45 pin 2 -> rs232 pin 3 , rj45 pin 3 -> rs232 pin 2 , rj45 pin 8 -> rs232 pin 5 )
WHR RJ45 <--> RJ45 to rs232 <--> rs232 to USB cable <--> RPI
The problem is that when I connect to the RJ45<->rs323 and this to the rs323<-->USB cable the /dev/ttyUSB0 device on my RPI is no longer available. Looks like there is no power from the WHR RJ45 connector towards the rs232 USB cable? Strange.

Any ideas left?