Developing OH 3.0 Bindings

Is there already guidance who to move to OH3 Binding Development

  • Correct setup of the IDE (Eclipse)
  • Conversion of bindings
  • What’s new?
  • What’s deprecated?
  • Formal requirements (like: get rid of Apache Commons etc.)

I saw a post discussing the bindings conversion, but can’t find it again (@hilbrand?)


Thanks, that was what I‘m looking for👍

I’m trying to move my development from 2.5.x to 3.0. When installing Eclipse after selecting 3.0 for development, addons, and core, I’m getting the following exception on the task (master).

I’m not sure how to resolve this. Do I need to delete the existing fork that I was using for 2.5.x, then fork openhab-addons?

Adding push URI:
Creating local branch master
java.lang.Exception: org.eclipse.jgit.api.errors.RefNotFoundException: Ref refs/remotes/origin/master cannot be resolved
  at org.eclipse.oomph.setup.git.impl.GitCloneTaskImpl.perform(
  at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.doPerformNeededSetupTasks(
  at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.access$1(
  at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer$WorkspaceUtil$

It might be outdated, the master branch was renamed to main, that’s what @Kai already posted.

Hmm. Then how will that work if the Eclipse installer is expecting master?

I guess Eclipse installer has to be updated.

Yes the eclipse setup needs to be updated. What you can do is just install development, that still uses master. And after eclipse has finished then on the command line go to the git directory and:

git clone<your GitHub id>/openhab-addons.git

(or use the http version).

  • Note: If you have an old fork it might still be named openhab2-addons. You can rename that on GitHub (preferable before you clone)

To get the new main from the openhab-addons repo, followed by:

git remote add upstream
git fetch upstream

Make sure to install with with Java 11 and Java 11 selected during setup.


Thanks @hilbrand. I’ll give that a try.

@hilbrand That worked. I was able to get Eclipse installed using openHAB Development and openHAB Core. I then cloned my openhab-addons repo and fetched the main branch from upstream. I imported a few bindings. So far so good.

I tried building using maven, but ran into an issue. Any idea how to resolve this?

mark@S5 MINGW64 ~/openhab3/git/openhab-addons/bundles/org.openhab.binding.bigassfan (main)
$ java -version
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.8+10, mixed mode)

mark@S5 MINGW64 ~/openhab3/git/openhab-addons/bundles/org.openhab.binding.bigassfan (main)
$ mvn install
[INFO] Scanning for projects...
[WARNING] Error injecting:
java.lang.TypeNotPresentException: Type not present
    at (
    at (
    at (
    at (
    at (
    at$ (
    at$Provision.provision (
    at org.eclipse.sisu.bean.BeanScheduler$CycleActivator.onProvision (
    at$Provision.provision (
    at (
    at (
    at (

BTW, I tried building a bundle in openHAB core, and I get the same error.

Here’s the last part of the exception. Do I need a different revision of Java 11, or perhaps something other than OpenJDK?

Caused by: java.lang.UnsupportedClassVersionError: org/openhab/tools/analysis/report/SummaryReportLifecycleParticipant has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
    at java.lang.ClassLoader.defineClass1 (Native Method)
    at java.lang.ClassLoader.defineClass (
    at (
    at (
    at$100 (
    at$ (
    at$ (

Ok, even though I installed Java 11, my JAVA_HOME is still pointing to Java 8. I’ll try to resolve that and see if it fixes the problem.

Edit 2:
Looks like that was the issue. All good now.

1 Like

Hi @hilbrand
I installed Java SE 11, set Win10 @JAVA_HOME@ to JDK 11, checked mvn runs on Java 11, installed Eclipse 2020-09 selecting Java 11 and just Development, waited Eclipse finish install, then cloned my fork of openhab-addons, set remote upstream+fetched it and then moved to main branch.
Then added astro and openwebnet bindings to pom.xml, added astro and openwebnet bundles to app.bndrun. Then when I click resolve I get this error:

    Resolution failed. Capabilities satisfying the following requirements could not be found:
          ⇒ osgi.identity: (osgi.identity=openwebnet4j)
              ⇒ [openwebnet4j version=0.3.0]
                  ⇒ osgi.wiring.package: (&(>=3.15.0)(!(version>=4.0.0))))
        [jakarta.activation-api version=1.2.1]
          ⇒ osgi.wiring.package: (&(osgi.wiring.package=com.sun.activation.registries))

It looks like openwebnet4j (required by openwebnet) it looks for, but it cannot be resolved by bnd.

Any hint?

EDIT: I also wrongly added openwebnet4j bundle to app.bndrun. If remove it, then resolve completes correctly requiring nrjavaserial 5.2.1 which provides

I just pulled the latest snapshot of openHAB3 to continue development of our Bosch binding ( There seems to be a new login mechanism in place. Is there some information somewhere how to create an administrator account or is there a default administrator account I can use to access the settings via the UI? Previously it was not necessary to login to add/update things, items, etc.

First access to the new UI will ask you to setup your admin account.

Thanks for the information @hmerk!

The problem was probably that I reused the userdata folder from the previous version instead of clearing it. I will try it with a clean installation.