Binding compatibilty

Hello,

I made some changes to my binding. I deployed it locally, where I run openHAB 3.3.0, however the binding update is developed with 4.0.0 snapshot. If I upload the JAR File to Marketplace I get the following error if I install it via the Marketplace:

The marketplace bundle was successfully installed but doesn't start: Could not resolve module: org.openhab.binding.sonnen [255]
  Unresolved requirement: Import-Package: com.google.gson; version="[2.9.0,3.0.0)"

How do I make it offically compatible to an older version?

Try this:

1 Like

Ok, I was able to compile it with the given options. I deployed the new JAR-File. When I install it, I dont see any more error in openhab log, however the Thing is not appearing in the menue.

As said using openHAB 3.3.0, do I need to adjust the parameters anyhow?

You probably also need to add a binding.xml file for the older versions as it no longer exists in OH 4:

Yup, I forgot that part. Make sure both binding and addon xml files are there.

Ok, sorry guys, where do I need to place the binding.xml and what is the content of it?

You place it in src/main/resources/OH-INF/binding/binding.xml

See the 3.4.x branch for examples like this Astro Binding binding.xml.

1 Like

Thanks, I can conform that it works now.

1 Like

Another option for anyone looking at this, you can make these changes to your binding and it sets this all automatically.

It probably does render your CI build results useless for newer versions.
All openHAB APIs could be removed in newer versions and it will still build successfully. :upside_down_face:

Oh it’s definitely not the “best option” but seeing as it does effectively the same thing as putting it on the CLI there’s no real difference. This just makes the CLI shorter. I opened up an issue here…

…to do something more permanent/stable/etc for the marketplace releases going forward.