Serial binding - reading heating regulation

I’m new to openHAB and I’m just getting into everything.

I want to read my heating regulation, which can be done via RS232. I do have a running python script, which reads the modules from the regulation like diverse temperatures, pump status and other stuff.
The regulation expects this:

  1. write initials (bytes)
  2. read the ACK
  3. write the read instruction for the module, which you want to read
  4. read the answer and decode the byte response

I’m totally stuck at the beginning - like how to set up the connection to my regulation and how to write a loop, which reads the 50 modules from my heating…

Thanks for some initial help on how to start!


Frankly, if you already have it working in Python it would probably be easier and more flexible for you to simply publish the values from Python to openHAB using the REST API of openHAB (e.g. setting the state of Items through web calls) or through MQTT messaging.

I have attempted to help several people get the Serial Binding working and I’m convinced that it is not one for new comers to openHAB to start with. It requires too much of an understanding of how OH works along with how to do serial communication, dealing with binary data, etc that it quickly becomes overwhelming. But if you want to give it a try see the Serial Binding wiki page and pay special attention to the notes.

1 Like

You’re probably right! :wink:
I could just simply add the API-calls after reading the values and push them to openHAB…

I didn’t get the logic from the serial binding’s wiki! :confused:

The thing to realize with openHAB (which is why I gave the advice I did) is that the things you are concerned about (e.g. looping) is handled by the binding. You never have to worry about that in OH. As the data comes it the binding loads it into your configured Items, which works great for most bindings. But it is all but impossible to make something that works for all cases all the time for the really low level bindings like Serial and TCP/UDP. And unless you really know what you are doing from both the low level protocol level and how openHAB works level it is very difficult to debug and solve problems.

Given that your serial connection includes a handshake type protocol I wonder whether the Serial binding would work at all, now that I think about it. I suppose it would be possible to implement the back and forth in Rules.