Bindings are uninstalled after restart even without addons.cfg

Hi all,

I am really struggeling on the automatic uninstallation of bindings.

Every time I restart openHab 2.1, all my 1.x (e.g. fs201) bindings are automatically uninstalled.

I read anywhere in the forum that I should remove addons.cfg, what I did. However, even thereafter all 1.x bindings are uninstalled automatically.

I would like to omit to create an explicit list of plug-ins in the addons.cfg file.

Does anyone have an idea?

Kind regards
André

You shouldn’t remove it completely, but rather comment out the binding = line in /etc/openhab2/services/addons.cfg
Check /var/lib/openhab2/config/org/openhab/addons.config & /var/lib/openhab2/etc/org.openhab.addons.cfg also

There is a nasty bug that may leave stale info behind.

Stop OH2, delete the addons.config, comment out binding = line in addons.cfg and restart OH2
Note: Don’t delete /var/lib/openhab2/etc/org.openhab.addons.cfg since it won’t be recreated by OH2 upon startup, rather comment out or remove the binding = line from that file.

Can you explain the addon.cfg?

I´m on 2.2 snapshot.

When do i have to fill in something in “binding =” inside the addons.cfg? I which case would this be recommended?

In which case should i leave it empty (comment out) ?

I don’t have a proper explanation for this :slight_smile:

I usually define everything manually (somewhat of a control freak), so for every binding, every ui, every transformation etc that I use, I hard code the config within the /etc/openhab2/services/addons.cfg. In this way, when I perform my /etc/openhab2/ backups, I know that I kept my selected addons.

Normally, you don’t have to do this. You could leave all options commented out (even the package) and let openHAB manage these settings.

I believe that when you install an addon from PaperUI, the info is kept in
/var/lib/openhab2/etc/org.openhab.addons.cfg
and
/var/lib/openhab2/config/org/openhab/addons.config

I am not sure why 2 destinations… :slight_smile:

The disadvantage of using manually defined addons in the cfg is that every addon that is not listed in there will be uninstalled when you restart OH2.
(so everytime you install an addon from PaperUI, you need to remember to update your addons.cfg and include the new one that you just added)

Let’s say you have already defined within addons.cfg some binding=mqtt1, knx1, astro and on top of that, you want to install the ntp binding addon.
If you install it from PaperUI and forger to update your addons.cfg file, the ntp binding will be uninstalled the next time you restart OH2. Note: after you install the addon and while OH2 is running, it will update the 2 files in /var/lib/openhab2/.... but… afterwards… (after restart)…

The files /var/lib/openhab2/etc/org.openhab.addons.cfg and /var/lib/openhab2/config/org/openhab/addons.config will be updated upon OH2 restart to reflect ONLY whatever you have manually defined in addons.cfg and you will get:

2017-07-12 19:10:24.722 [ExtensionEvent            ] - Extension 'binding-ntp' has been uninstalled.

Note1: for manually deployed *.jar files in /usr/share/openhab2/addons/ folder, the above do not apply. You shouldn’t add anything in the binding = line when using manually deployed bindings. They will be loaded anyway.

Note2: If you edit your addons.cfg and add an addon (e.g. binding) name there, it will be installed immediately (without having to use PaperUI) and it will remain valid after restart also.

Note3: If you edit your addons.cfg and remove a manually listed addon, it will be uninstalled (almost) immediately