Connect OpenHAB to binding, {binding config}

I am working on a binding as an interface to a heating system controller; access to the controller is via the so-called Boiler System Bus (BSB) and a serial interface. The nitty-gritty coding of the BS-Bus protocol handling and the bus hardware interface are not the problem, but my understanding how the OpenHAB core interfaces to my binding, which functions I have to provide on the binding side and how I would declare the {binding config} part in the .items file.

The heating controller command set contains commands to read parameters and to set parameters; each command definition contains a unique CmdNumber, a CmdName, and the command structure. A “read” command contains no payload and triggers a response from the heater with a payload (=the value). Conversely, a write command is sent to the heater with a payload (=the set value). The guaranteed unique CmdNumber string looked to me like a good candidate as a {binding config} to address the commands…

I have written some scaffolding code to confirm from within my binding that my code generates correct command messages when I call getParameterByCmdNr() or setParameterByCmdNr(), two functions which I hope to use between the OpenHAB API and my low level code.

At this time I am stuck how to define the {binding config} parts in the bsbus.items file. Can someone please lend me a helping hand? This is my biggest stumbling block right now.

Example for a temperature setting command in the .items file

Number ComfortTemperature  “Comfort temperature [%.1f deg C]  <temperature>  (gTGroup)  {bsbus=”1234”}

where the string “1234” is the CmdNumber. My getParameterByCmdNr() method takes the CmdNumber, looks up the respective command description, and uses this description to send an appropriately formatted “Read Comfort Temperature” command to the heater system. The getParameterByCmdNr() method returns the payload of the heater response.

  1. Is this a workable assumption?
  2. How does the heater response value get back to OpenHAB? And how do I / how does OpenHAB differentiate between a “read value” command and a “set value” command, and how do I declare this difference in the {binding config} between the curly braces? I very much believe that I am missing something here in my understanding.
1 Like

Is there a list of functions with their descriptions which serve as the API between bindings and OpenHAB core? Something Java-like perhaps?

Harald, I haven’t developed a binding either but I am definitely interested in a BSB binding and gateway.


I had put this project on the back burner since January 2017 (my last post in
this thread), therefore nothing has happened since.

Status as of January 2017: I had parts of an OpenHAB-1 binding for the BS-bus
written which I modeled after the OpenHAB-1 Stiebel heat pump binding. My and
the Stiebel binding initially load a list of all implemented bus commands from
an XML file and communicate over the computer’s serial interface. I liked the
XML representation because it is a universal and implementation-independent
way to describe the BS bus commands.

If I should go back to this project I’d have to decide whether I start with a
brand new concept or only rewrite my code as an OpenHAB-2 binding.

Greetings, Harald