OH 2 has lots and lots of add-ons and right now (until issue 319 gets completed) the best way to preserve installed bindings through an upgrade is to “install” them through addons.cfg.
As I was writing the Text based section of the Migration tutorial I had a question that I never spent the time to go back and ask, until now.
What is the best way to discover the name of a binding that can be listed in addons.cfg?
I’ve been around OH long enough that I was able to intuitively guess for all of my bindings but something a little more concrete and repeatable for newcomers would be better.
If I browse the bindings in PaperUI I can see the name in small print under the title but that requires that I understand that I would need to remove the “binding-” part. Plus it seems a little broken to require PaperUI to configure addons.cfg.
If I list the bundles in Karaf I only get the long name, not the short one-word name I need for addons.cfg. And there is no command documented in the docs to get it (I’ll open an issue and add it if there is one).
It also looks like one could use the rest/extensions REST call but again it requires I know to remove the “binding-” part of the ID and unless I have something to pretty print the results (e.g. running through the REST API Doc extension) it is very difficult to find the IDs.
I’d like to make sure this ends up in the beginner docs and would like the opinions of beginners and experts alike.
This corresponds to what you also see in the Paper UI.
The naming convention is this:
<prefix>-<type>-<id>
where
prefix is ALWAYS “openhab” (this makes it easy to identify the features in Karaf, because there are also other non-openHAB related ones that can be ignored by the normal user)
type is the add-on type, e.g. “binding” or “ui”. You need this to decide where to put it in your addons.cfg. This is also used by the Paper UI to sort the add-ons on different tabs.
id is the identifier that you would have to use in addons.cfg, e.g. “hue”, “map”, etc.
Another remark: For https://github.com/openhab/openhab-distro/issues/319 I am currently working on a refactoring, which will cause changes done through the Paper UI to be reflected in the org.openhab.addons configuration within ConfigAdmin. So no need anymore to manually maintain the addons.cfg anymore with that, if you prefer to do it through the UI.
I upgraded today to the newest version of openhab and there are not listed any extensions in the paperui anymore.
It’s still all working, but i cannot see what is installed.
How can i fix it?
Is this build broken?
I tried the to list the installed addons in the console, but
Not necessarily.
What you have to do (either way) is:
Define your Things again (if you don’t use textual defined things) and
adapt your addons.cfg (if used) to have the “1” at the end for 1.9 bindings.
Don’t forget to save your conf and userdata folder and copy it back to your new installation.
I personally would do a fresh new install to get rid of all the old stuff (but that is only because I don’t have deeper insights into the operating system) and a new fresh install is done within - hmmmm - one or two hours
Or use openHABian … I don’t have any experience with that but from the comments it looks very stable.