Any working tutorial for binding development?

Tags: #<Tag:0x00007fc1fd829508>

Hi All,
I wanted to try out some binding debugging/development. After some hours of frustration I’m writing to you.

https://www.youtube.com/watch?v=o2QjCGdZl7s
Outdated, there is no eclipse run configuration

https://www.openhab.org/docs/developer/ide/eclipse.html
Without additional bindings I can start app.bndrun, but an empty page asks for HTTP credentials. I tried with and without addons enabled at eclipse setup.

https://www.openhab.org/docs/developer/ide/eclipse.html
With additional binding (e.g. Astro) I can’t start app.bndrun because ‘org.eclipse.smarthome.core’ is missing (adding it as dependency does not help)

https://www.openhab.org/docs/developer/ide/intellij.html
Can’t install any UIs, dashboard dies after first access

https://community.openhab.org/t/howto-setup-intellij-for-binding-development/87135
404 on root path

There are some topics in the community about development, but the ideas there did not help (or I misunderstood the solutions). My last Eclipse usage was two years ago and it feels like I’ve never seen it before :sweat_smile:

Additional information:

  • OS X 10.15.2
  • openjdk version “1.8.0_232” (Amazon Coretto)
  • Apache Maven 3.6.3

Is there any working tutorial out there?

Hey @darkspirit510, I wrote the IntelliJ tutorial (so I can only speak for IntelliJ) only a couple of weeks ago when I was in the same situation like you (actually without any tutoriol for IntelliJ) - so I’m really interested in getting this to work!
Can you be a little bit more precise on what the problem is?

Actually this step is just installing the official openhab distribution on your machine (no development specific steps about it) - so this really should work, otherwise there would be tons of complaints.

I’d suggest you pick a IDE you’re familiar with and open a thread for any specific problems if you have trouble getting it to run - this collective thread here will be confusing.

The second IntelliJ link you posted was just the first version I posted in the forum before creating a PR for the official docs (the first link). The forum version included steps for building the openhab distribution locally in the IDE, which is not necessary anymore since version 2.5 was released officially.

Hi @pravussum

I know that this should be a simple “download two files, extract one, place the other in the correct directory”-task. I can see the typical selection overview of which mode to setup your openhab (expect, basic, etc).

I’m familar with intellij, but don’t have problems using Eclipse. I just can’t get it running and would like to understand why - no matter which IDE. Maybe it’s my mac (just switched from ubuntu a month ago).

Edit: I’ll start over from scratch this evening and post my results. I’ll try things on a windows machine, too. Maybe I just misconfigured my device.

The documentation for Eclipse correct. However due to the start of version 3.0 you need to do 2 things:

  1. in openhab-distro: git checkout 2.5.x and in the openhab-addons you need to do the same.
  2. It has PaperUI installed in the demo, but you need to go to http://localhost:8080/paperui/index.html Opening the root will give you the login dialog.
1 Like

Wow, thank you! I could checkout the branches, start the backend and found the bindings. I can start the backend now - but I can’t add bindings. I started with an existing one (in this case Tankerkoenig). Another hint for me? :relaxed:

PS: Did I just attend with bad timing or should this be added to the tutorial?


Edit: Problem solved. Had to manually copy the compiled binding to addons directory. Working now. Thank you!

It’s both unfortunate timing and it should be added to the documentation (I’m working on that). However you should be able to add bindings to the demo app as described in the openHAB eclipse ide documentation, (See also animation) without having to add the binding to the addons folder. If you only want to run the binding it’s not necessary to first import the binding to eclipse before following the steps to add the binding to the demo app.

1 Like