Question: difference of addon config files

Hi, I have a question.

Whats the difference between

Config/services/addon.cfg

And

Userdata/config/org/openhab/addons.config

I mean before 5.2 my bindings were listed in the addon.cfg file.

With some update of openhab the both files look like defaults. Nothing special, the addons.config all commented, like default.

Last week I wanted install a binding from the addon store. Then all bindings where removed and openhab wasn’t usable..

I had a backup, so no problem. But what could gone wrong? I don’t have logs.

I’m afraid of installing a binding anymore.

Can I type my bindings in one of the files to prevent this removal?

I hope you understand what I want to tell :grinning_face_with_smiling_eyes:

Greets

Take a look here:

Only addons.cfg should be edited manually, addons.config gets populated automatically.

OK, thxs

My addons.cfg is default, I have several bindings installed. (where is this stored?)

When I install another Binding with mainui addonstore all other bindings get removed..

This is strange..

I’ll try it again tomorrow morning.

What if I type all addons in the addons.cfg file and hit save? Will openHab use this file then?

Greets

Yes. addons.cfg overrides everything else.

Do not touch userdata/config/org/openhab/addons.config - just ignore it.

Whenever you modified and saved addons.cfg openhab will enforce it - install everything in it, and uninstall everything that’s not in it.

If you installed anything via the mainui, when you saved addons.cfg they (mainui installed addons) will be uninstalled - unless they’re also listed in addons.cfg.

If you want to use MainUI to install bindings, everything in addons.cfg needs to be commented out (put a # on each line).

Now you can install addons through MainUI.
You cannot use both! Either addons.cfg OR MainUI.

My first post was wrong.

What I saw is addons.configold, there my addons are listed..

The actual addons.config look like default setting.

I never touched addons.cfg and addons.config

I try tomorrow morning.. Thanks for your explanation.

One final little detail not mentioned here is the mechanism on how addons.cfg is used to populate addons.config.

First, the contents of addons.config is what OH will use to determine which add-ons to install. So what ever is in that file is what OH is going to conform to.

When you edit addons.cfg, the contents of addons.cfg gets copied over addons.config. Then OH reads addons.config and installs/uninstalls add-ons as necessary to conform.

When you install an add-on through MainUI, OH itself modifies addons.config (but never addons.cfg; OH never modifies any files in $OH_CONF). However, if you have stuff in addons.cfg, the next time OH reads addons.cfg and transfers it to addons.config, it will remove what you did through MainUI.

This is the technical reason why you cannot both use the UI and use addons.cfg at the same time.

Thx Rich.

My addon.config looks like this actually

:org.apache.felix.configadmin.revision:=L"10"
core-config-discovery-addon="usb,ip,sddp,upnp,mdns"
service.bundleLocation="?openhab"
service.pid="org.openhab.addons"

I have in sum 35 addons installed.. 2 jars in addons folder..

bindings, automation, persistence etc

Why isn’t this in addons.config? Something wrong here?

This is addons.configold

I think an update did this.

:org.apache.felix.configadmin.revision:=L"83"
automation="jsscripting"
binding="solarforecast,ipcamera,samsungtv,ephemeris,renault,tankerkoenig,avmfritz,network,smaenergymeter,zoneminder,mqtt,squeezebox,plex,tr064,telegram,radiobrowser,solarman,tellstick,openweathermap,astro,modbus,http,networkupstools,tradfri,tuya"
core-config-discovery-addon="usb,ip,sddp,upnp,mdns"
package="standard"
persistence="rrd4j,mapdb"
service.bundleLocation="?openhab"
service.pid="org.openhab.addons"
transformation="regex,xpath,jsonpath,map"
ui="basic"
voice="marytts"

Greets

You have 35 add-ons you want to be installed/were installed? Or you actually have 35 installed and addons.config isn’t showing you everything that is actually installed?

Note, jar and kar files in the addons folder will not show up here.

If the former, all I can say is something modified that file somehow (modifications made to addons.cfg?). How? :person_shrugging: Not enough information to say.

But I can say that if you make sure addons.cfg is completely commented out with no uncommented lines and if you replace addons.config with that backed up file that should restore all the add-ons installed the way they were before.

I have 35 addons installed right now.

The /var/lib/openhab/config/org/openhab/addons.config shows nothing. See above.

The Config/services/addons.cfg is untouched.. All commented.

All bindings installed via mainUI.

I wanted to install a binding (jellyfin) with mainui, like all the other bindings, and all bindings were instantly removed. My house was unusable :grinning_face_with_smiling_eyes:

I had a snapshot and rolled back..

Tomorrow morning I take a new snapshot and try again to install jellyfin Binding.

My openhab runs since openhab2.. Just upgrade, no new install in between :flexed_biceps:

This

But for how long? That file is not read all the time. If you reboot openHAB does it remove the add-ons?

As far as I know nothing has changed with this file and the parts of OH that process it between 5.1 and 5.2.

so, I stopped openHab, deleted the addons.config, changed a binding in addons.configold to see if it works, renamed to addons.config and restarted openHab.

all good now.. the changed binding got applied. one removed, one installed.

I think this was my fault. maybe deleted this file after upgrade or something.. cant remember.

But now I know how this all works.

Thank you guys..