Developing and distributing own bindings

As you may have noticed i’m developing LogReader binding and I have few questions about contributing.

Here’s what the docs say:

We’re trying very hard to keep openHAB lean and focused. We don’t want it to do everything for everybody. This means that we might decide against incorporating a new feature. However, there might be a way to implement that feature on top of openHAB.

Now I’m developing this using Eclipse IDE and doing manual builds with maven with my home computer. After that uploading them to a server to distribute the binding (I know there’s eclipse marketplace to help distribute but haven’t set up an account yet). Does the line “However, there might be a way to implement that feature on top of openHAB” mean this kind of developement? If not, what does it exactly mean?

I quite sure that this kind of binding won’t ever get to official release but could it be possible to use jenkins builder to “own” bindings? Would be easier to develop while away from home. For example committing small bugfixes while travelling.


According to my opinion, a binding is already on “top of openHAB”.

I think this sentence is aimed to keep the core clean, not to keep some bindings out of the distribution.

Why don’t use your own fork of the openhab2-addons on github, do your development connected to your forkand use maven build. As long as you don’t request of merge into the official repo you can use your binding without any further questions by the admins.
For distributing your binding the marketplace has been setup. In there you only need to publish the build .jar.

Hi @opus,

I do have my own forked openhab2-addons github repo and current developement is in separate branch. So everything is almost set up but I wasn’t sure how to proceed from there. That you could just do a pull request with right name without disturbing admins (What would be a proper name? [WIP]Something? [No Merging]?). I’m mostly concerned that this way the repo just contains pull requests that won’t never get merged. But this is the way then I’m glad.

My reading of this is statement is that sometimes there are bindings that get created that would more properly be implemented in the OH core rather than as a separate binding.

The Logreader binding is kind of at the cusp of that.

If you are looking to contribute your binding to the official set (this means licensing it with the Eclipse license and given the Eclipse Foundation certain rights over the contribution, see the contributions docs) then you can post your binding as a Work In Progress [WIP] branch to the openhab2-addons repo and the maintainers will be able to review and comment. At that point someone like kai will chime in and perhaps comment this is better to be implemented in the core or in some other way.

If you are not willing to sign over your binding then the IoT Marketplace is definitely the place you want to get your binding.

Unrelated question: Have you give any thought or consideration of making this more generic and let someone tail any arbitrary log and using a REGEX cause an Item to be commanded or be updated? It seems like you have almost everything already in place and then perhaps others can use this to watch some other systems.

1 Like

If you are looking to contribute your binding to the official set

Of course I’m open to this idea to contribute but just as you earlier said, it’s not clear how this should be included in OH. Or should it not, if there’s no proper place. Right now I’m thinking if somekind of “tools” section under addons would exist. Like binding, io, ui and voice. Because in this binding a thing is not anykind of device. It’s only one part of your device. In this case a server.

Unrelated question: Have you give any thought or consideration of making this more generic and let someone tail any arbitrary log

Yes I have. In LogReader topic there’s conversation about supporting journalctl. That way unix users with journald could have the whole server monitored with OH. So yes, in future this can support multiple logging variations.

No, I think it would be just a run of the mill binding or it would be under Misc.The distinction isn’t so much the fact that your Thing doesn’t represent a physical device, neither do the Astro, Weather, etc bindings. The fact that the Thing represents a single OH server is not a significant distinction in my mind at least.

So my question was about more than just supporting journalctl. I’m actually thinking about something along the lines of:

  • Binding tails any arbitrary log/text file
  • Regular Expression to select those lines I care about
  • Transformation to extract information I care about from the line that matches the REGEX
  • Extracted information is used to sendCommand or postUpdate to a given Item

I’m really thinking of something along the existing MQTT 1.x binding except instead of subscribing to a topic I’m processing lines from a log file.

Maybe this is getting a bit too much off topic but these kind of ideas are always welcome.

No, I haven’t got this far in my thoughts. But this is something to really think through. Opens up possibilities. Thanks!