New binding Resol VBUS

Hi community,

i just created a pull request https://github.com/openhab/openhab/pull/3110 for a new binding containing the connection to RESOL devices using the VBUS. RESOL devices are mainly used for solar heating systems and sometimes together with the heating system and then rebranded (e.g. by Viessmann).

You can find the WIKI page at https://github.com/openhab/openhab/wiki/Resol-VBUS-Binding which is still WIP. So if you have any questions feel free to contact me.

The JAR file can be found here
https://drive.google.com/open?id=0BzRabLA27s-9YkNwT0RJQ2F0Ym8

Currently it’s developed with openhab 1.7 and hopefully it will find it’s way to openhab 1.8

Keep up the good work.
Regards,
Michael

1 Like

Hi Mitch

Thanks for the binding! Great work.
Only, I don’t get it working with my VBUS LAN device.

I have this in my openhab.cfg:

resolvbus:host=10.1.0.100
resolvbus:port=80
resolvbus:password=vbus
resolvbus:updateinterval=10
resolvbus:deviceid=4278

This in my items:

String Resol_state “Status [%s]” {resolvbus=“Status”}
Number Resol_pannels “Temperatuur panelen [%.1f °C]” {resolvbus=“Temperatur sensor 1”}
Number Resol_barrel “Temperatuur vat [%.1f °C]” {resolvbus=“Temperatur sensor 2”}
Number Resol_hours “Temperatuur vat [%.1f °C]” {resolvbus=“Betriebsstunden Relais 1”}

And I get this in the logs. It looks like he reads the device ID in the Binding but not in the LANReceiver? What’s the difference?

2015-10-28 08:20:22.004 [INFO ] [.b.r.internal.ResolVBUSBinding] - ResolVBUS Binding activated
2015-10-28 08:20:22.004 [INFO ] [.b.r.internal.ResolVBUSBinding] - Using deviceID: 4278
2015-10-28 08:20:29.832 [ERROR] [o.o.b.r.i.ResolVBUSLANReceiver] - Error while initializing LAN interface)
2015-10-28 08:20:29.832 [INFO ] [.b.r.internal.ResolVBUSBinding] - Device ID was null, reading from openhab.cfg
2015-10-28 08:20:30.096 [INFO ] [.service.AbstractActiveService] - ResolVBUS Refresh Service has been started

I can view the stats in the Resol software itself and I used to read the stats with this module successfully in the past: https://www.npmjs.com/package/resol-vbus

Hi Laurens,
On the first look it seems that something with the IP configuration is incorrect. Are you sure your LAN controller listens on port 80?
Can you try it with leaving the value to standard(e.g. Commenting it out in the openhab.cfg)
Thanks,
Michael

Yes, that was the trick! I saw a webpage and the terminal reacted on port 80 (of course it was the webserver :unamused:) and so I went for port 80. Working perfectly now with port 7053!

For documentation, I’m using these items:

Number Resol_state "Pomp [MAP(onoff.map):%s]" {resolvbus="Status"}
Number Resol_pannels "Temperatuur panelen [%.1f °C]" {resolvbus="Temperatur sensor 1"}
Number Resol_barrel "Temperatuur vat [%.1f °C]" {resolvbus="Temperatur sensor 2"}
Number Resol_hours "Aantal draaiuren [%.0f u]" {resolvbus="Betriebsstunden Relais 1"}

Tested with a citrin Solar cs1.2 (which is a deltasol bs) together with a resol USB converter. It works fine with the same item config as the post above.

The German item names are a bit strange though and the English ones don’t seem to work.

Just a suggestion would be to use English item names without spaces and to have a link to the XML files in the wiki.

The names come from controllers itself. It send it’s values with German tags even while my controller is set to English (I speak Dutch).

Thanks, nikoraes. Good to hear. The German item names come from the XML-files where the datapoints are defined. I agree that this is a bit strange for non-German people.
There are English names, too. Unfortunately not for every datapoint. So for keeping the binding as simple and for maintenance reasons I decided to use the German ones.
So I could think about improving the next version:
-Where english names are available, use english names, if not, use german ones

And even “deleting” the spaces would be additional effort especially for documentation(WIKI), which is by far not complete for now.
(see discussion on https://github.com/openhab/openhab/pull/3110)

Of course I’m always open to good ideas.

Regards,
Mitch

Are there plans to develop this for OH2?

I have a Caleffi branded Resol solar controller I’d be happy to do some work and testing with.

Yes, sure. There are plans for OH2. At the moment a RESOL guy is helping us by developing some core classes to provide everything around data extraction and conversion for all controller types. That was a major issue with the current version.
So stay tuned. As soon as he has finished his work, I’ll start enhancing the OH1 binding and starting with OH2 one.
Of course you can start with the OH2 one if you like. The current status of the RESOL classes are here:


Please remember it’s still WIP.

Regards,
Michael

Hello,

how to configure a vbus usb device connected to a raspberry and openhab running on another raspberry ?

Thanks

Hi,

is there a documentation how to connect a raspberry pi to the vbus? Which hardware do I need? I have a Citrin CS 2.5 solar controller.

Thank you!
Regards,
Stefan

You need this one.

Hi Mitch,

I’m testing the COSMO Multi. Looks like the sensors are working.
But I have a MSR65 (Heizkreismodul) also connected to the dl2 via the Cosmo Multi.

How can I receive these values? As an example see the link for the json used by the visualization.
json

thx,
-thomas

Hi Thomas,
I’m not sure if this will work. If the binding recognizes the ID, it will look for data fields defined in XML files. If not, you have to define a XML-File. That could work.

But if you can get a JSON String why not use the HTTP-Binding and then transform the input via a transform file:
e.g. I’m getting the diesel prices via HTTP and a “diesel.js”:

Number diesel1 "Diesel Aral [%.2f Euro]" { http="<[https://creativecommons.tankerkoenig.de/json/detail.php?id=6f2391a3-1c74-46b5-bdf0-e00467eca0ab&apikey=myapi-key:JS(diesel.js)]" }

and diesel.js:
JSON.parse(input).station.diesel;

Regards,
Michael

Hi,

just tried to add the xml file. but looks like the binding is only finding the one device:
[o.o.b.r.i.ResolVBUSLANReceiver] - Device identified: 7821 <-- cosmo Multi.

Maybe I’ll go for the http workaround… could not any device connect via json?
dl2 url: dl2.fritz.box//dlx/download/live

Are you planning to do a actions binding as well?

regards,
-thomas

Hi,
If that could help, I’m using the datalogger2 (dl2) with Openhab2 through the http binding and json transform.
Here are the examples.

HTTP.cfg:

#timeout in milliseconds for the http requests (optional, defaults to 5000)
#timeout=

the interval in milliseconds when to find new refresh candidates

(optional, defaults to 1000)

#granularity=

configuration of the first cache item

solar-request.url=http://192.168.0.200/dlx/download/live?view=00
solar-request.updateInterval=60000

configuration of the second cache item

.url=

.updateInterval=

and the items configuration:

/* Solar - DataLogger2 */

Number solar_Temp1 “Capteur [%.1f °C]” (grSolar) { http="<[solar-request:30000:JSONPATH($.headersets[0].packets[0].field_values[0].raw_value)]"}
Number solar_Temp2 “Echangeur [%.1f °C]” (grSolar) { http="<[solar-request:30000:JSONPATH($.headersets[0].packets[0].field_values[1].raw_value)]"}
Number solar_Temp3 “Ballon Inférieur [%.1f °C]” <temperature_cold> (grSolar) { http="<[solar-request:30000:JSONPATH($.headersets[0].packets[0].field_values[2].raw_value)]"}
Number solar_Temp4 “Ballon Supérieur [%.1f °C]” <temperature_hot> (grSolar) { http="<[solar-request:30000:JSONPATH($.headersets[0].packets[0].field_values[3].raw_value)]"}
Number solar_Temp10 “Entrée compteur chaleur [%.1f °C]” (grSolar) { http="<[solar-request:30000:JSONPATH($.headersets[0].packets[0].field_values[9].raw_value )]"}
Number solar_Temp11 “Sortie compteur chaleur [%.1f °C]” (grSolar) { http="<[solar-request:30000:JSONPATH($.headersets[0].packets[0].field_values[10].raw_value)]"}
Number solar_FlowRate “Flow Rate [%.1f l/min]” (grSolar) { http="<[solar-request:30000:JSONPATH($.headersets[0].packets[0].field_values[11].raw_value)]"}
Number solar_PumpSpeed1 “Vitesse pompe primaire [%.1f %%]” (grSolar) { http="<[solar-request:30000:JSONPATH($.headersets[0].packets[0].field_values[12].raw_value)]"}
Number solar_PumpSpeed2 “Vitesse pompe secondaire [%.1f %%]” (grSolar) { http="<[solar-request:30000:JSONPATH($.headersets[0].packets[0].field_values[13].raw_value)]"}
Number solar_PumpSpeed3 “vitesse inverseur [%.1f %%]” (grSolar) { http="<[solar-request:30000:JSONPATH($.headersets[0].packets[0].field_values[14].raw_value)]"}
Number solar_QtyHeat “Quantité chaleur totale [%d Wh]” (grSolar) { http="<[solar-request:30000:JSONPATH($.headersets[0].packets[0].field_values[21].raw_value)]"}

2 Likes

thanks yphyph01, helped a lot.

I just tried this binding on my Raspberry pi with Vbus connected to the GPIO uart. It works perfect with a Python script, but the binding can not find the serial port /dev/ttyAMA0.

20:29:35.729 [INFO ] [.b.r.internal.ResolVBUSBinding:107  ] - ResolVBUS Binding activated
20:29:35.817 [DEBUG] [.b.r.internal.ResolVBUSBinding:181  ] - Starting ResolVBUS Serial Receiver
20:29:35.825 [DEBUG] [.b.r.i.ResolVBUSSerialReceiver:181  ] - Looking for serialport null
20:29:36.175 [DEBUG] [.b.r.i.ResolVBUSSerialReceiver:192  ] - Serialport not found /dev/ttyAMA0 
20:29:36.181 [INFO ] [.b.r.internal.ResolVBUSBinding:299  ] - Device ID was null, reading from openhab.cfg
20:29:36.186 [DEBUG] [.b.r.internal.ResolVBUSBinding:304  ] - Loading XML-Config for device ID: null

root:/opt/openhab# ll /dev/ttyAMA0 
crw-rw---T 1 root dialout 204, 64 Jan  1  1970 /dev/ttyAMA0

I am starting openhab as root …

I have seen that it might be a problem of the gnu.io RXTXcomm driver, but I am not sure how to solve it.

Thanks Holger

After googled for ttyAMA0 and found a hint, that openhab should be startet with
-Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0
but it did not fully help. I now get

RXTX Warning:  Removing stale lock file. /var/lock/LCK..ttyAMA0
19:46:51.926 [INFO ] [.b.r.internal.ResolVBUSBinding:107  ] - ResolVBUS Binding activated
19:46:52.029 [DEBUG] [.b.r.internal.ResolVBUSBinding:181  ] - Starting ResolVBUS Serial Receiver
19:46:52.041 [DEBUG] [.b.r.i.ResolVBUSSerialReceiver:181  ] - Looking for serialport null
RXTX fhs_lock() Error: opening lock file: /var/lock/LCK..ttyAMA0: Die Datei existiert bereits. It is mine

 testRead() Lock file failed
RXTX fhs_lock() Error: opening lock file: /var/lock/LCK..ttyAMA0: Die Datei existiert bereits. It is mine

??3?/ttyAMA0 testRead() Lock file failed
RXTX fhs_lock() Error: opening lock file: /var/lock/LCK..ttyAMA0: Die Datei existiert bereits. It is mine

??3?/ttyAMA0 testRead() Lock file failed
19:46:52.299 [DEBUG] [.b.r.i.ResolVBUSSerialReceiver:192  ] - Serialport not found /dev/ttyAMA0 
19:46:52.305 [INFO ] [.b.r.internal.ResolVBUSBinding:299  ] - Device ID was null, reading from openhab.cfg
19:46:52.323 [DEBUG] [.b.r.internal.ResolVBUSBinding:304  ] - Loading XML-Config for device ID: null

The lock file did not exist before starting openhab.
Any hints?
Regards Holger

Hi Holger,
it looks like any other program/thread is blocking the access to the port.
Can you confirm nothing else is trying to access the port?

Thanks,
Michael