OH2 Binding install issues

I’m starting to take the dive into migrating from 1 to 2 (again). I built out a test OH2 debian box using the apt method. I started following the migrating from 1 to 2 tutorial. I edited addons.cfg and added my list of bindings and actions. I see in the logs that only some of them installed.

I hopped over to paperUI to get a GUI view of what was installed. This is where I realize the naming issue and installed one or two via paperui hoping they would add to the addons.cfg file, they didn’t and I guess I wasn’t surprised.

At this point, my setup seems hosed up. I commented out the bindings in the addons.cfg file and they were removed according to the log. Paper UI, however, still shows them as installed. I checked Karaf and it confirms they are NOT installed. I tried installing one back via Karaf and then uninstalling it via PaperUI and it just spins and nothing outputs in the log.

I’m a little frustrated as it seems that the “simplicity” of OH 1 config is now spread in multiple different places and directions that can conflict.

Maybe somebody can set me straight on the best approach as there appear to be 3 somewhat exclusive paths?

I totally agree with you.
I have similar problems at the moment, trying to setup my devices in oh2.

Here are some steps that sometoimes help me to clean up the mess:

  • restart openhab
  • karaf: smarthome:items clear
  • karaf: smarthome:things clear
  • Ctrl+F5 to reload PaperUI without caching.

To be honest, I am not sure these steps actually work. :neutral_face:

I got frustrated and shut it all down for now. I’ll try to take a peek later. I definitely restarted and made sure to clear the browser cache. I didn’t do the karaf commands.

Unfortunately, the community support for 1 is pretty much gone so I just have to bite this bullet and get off. Too bad as my current setup does a TON and has been bulletproof. I suspect I’m in for some pain (like this).

I know this is a preference question but what would the most reliable method be. I won’t be futzing with it often. I get my automation setup and running and rarely ever tweak it.

OK, I put 30 miles on the snowmobile and I feel better… well, my brain does, not the rest of my muscles.

I fired the vm back up, started the service and low and behold paperui matched karaf. There was a binding and an action still installed, I uninstalled them from paperui and it succeeded as expected.

With a little testing I have concluded:

If you put something in addons.cfg, it will be installed at service start.
If you uninstall the addon using karaf or paperui, it will reinstall at service start.
A systemctl restart openhab2.service isn’t as good as a stop/start.

I guess there is a use case for all of it. Just seems like things are getting more complicated instead of easier. Now there are multiple different forks of binding versions one must keep track of. I suppose the paperui fixes that… perhaps I’ll go that route.

At this point in time unfortunately OH 2 is indeed much more complicated than OH 1 ever was in this and other areas. So here is my understanding:

  • addons.cfg takes precidence. If you start using addons.cfg you need to continue as any bindings installed that do not exist in addons.cfg will be uninstalled and any binding not installed in addons.cfg will get installed. I don’t know how often this file is reloaded.

  • Changes made using the Karaf console and the admin UIs are equivalent and compatible. For example, you can install a binding using the console and PaperUI will relfect that install and visa versa.

  • Changes made via Karaf console or the admin UIs do not get saved to the text config files.

There are cases where it makes more sense to use addons.cfg (e.g. Docker, OH 1.x migrations, people who really like configuration by text files) but as PaperUI matures I suspect it will become the “recommended” configuration approach.

Yeah, I’ve been using PaperUI to install bindings and it has been working. Makes it easier than looking up what binding versions are available and making sure you put the 1 or not…