Will *binding*.cfg files be automatically created?

I try to configure oh2 completely via text.

I just edited addons.cfg like this:

binding = netatmo,kodi

and get the following output in openhab.log.

2017-01-24 12:08:55.646 [WARN ] [ore.service.AbstractWatchQueueReader] - Could not process config file '.#addons.cfg': java.io.FileNotFoundException: /etc/openhab2/services/.#addons.cfg (Datei oder
 Verzeichnis nicht gefunden)

If I understand the comment in the addons.cfg correct, there should automatically be cfg files created for both bindings.
But I don’t even see, if the bindings got installed.

When changing the config to just “onkyo”, I get this:

2017-01-24 12:11:42.917 [WARN ] [ore.service.AbstractWatchQueueReader] - Could not process config file '.#addons.cfg': java.io.FileNotFoundException: /etc/openhab2/services/.#addons.cfg (Datei oder
 Verzeichnis nicht gefunden)
2017-01-24 12:12:08.198 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-binding-netatmo'
2017-01-24 12:12:14.095 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-binding-kodi'

Now I got a few questions:

  1. Shouldn’t there be some log like “Installed ‘openhab-binding-…’”?
  2. Should the cfg files be created manually or automatically?
  3. What does “Could not process config file ‘.#addons.cfg’” mean?
    This file does not exist.

It looks like you may have a cached version of addons.cfg that may be causing OH some problems. What editor do you use?

Look to see if you have .#addons.cfg file using ls -a in the services folder. If it exists delete it. See if that helps. You file should be just addons.cfg but lots of text editors will save versions of the file as you type like this and if your editor crashes you can recover your unsaved changes. But if you don’t clean up these cache files they stick around. And since this one starts with a ‘.’ it doesn’t show up in a normal ls and since it ends in ‘.cfg’ OH is trying to load it.

You might need to restart.

Yes, when a binding gets installed a default .cfg file should be created. There are a few bindings that have no config parameters in which case no .cfg file is created. I also don’t think the .cfg files for BasicUI and ClassicUI are created automatically.

You are right!

I am using mcedit (midnight commander).
As soon as I start editing the file is creates this temporary file. :sweat_smile:

I guess it does no harm as long as I can tolerate these lines inside the log.

Maybe I just tried addons that do not support auto-creation of the cfg files. :slight_smile:
Restarting did not help.

I will try other bindings.


There was recently a bug where a failure to parse a cfg file caused OH to no longer load any files. If that hasn’t been fixed then these cache files could be the source of your problems.

I’m pretty certain one or both of those bindings do generate .cfg files (could be wrong, I don’t use either of them).

Look in PaperUI or the Karaf console to see if they are indeed listed as installed.


I tried (un)installing the bindings via karaf console, to make sure my editor was not interfering.
No .cfg was created.

Then I did a search in the openhab-addon repo, to see what addon would create such a file.

The only one I found were this was mentioned is openhab-ui-cometvisu.

I installed it and the cometvisu.cfg was created.
feature:install openhab-ui-cometvisu

So I guess there is no problem.
This feature just seems to be not used that much.

Anyway, thanks for your help. :+1:

ESH/OH2 bindings usually do not require any cfg files, therefore they won’t create any of those. What would you expect to configure in there for Netatmo and Kodi?

I expect to configure ip, user/password fpr kodi or netatmo:refreshtoken etc.
Just like the old openhab.cfg.

I know I can configure this via PaperUI, but I wanted to try to configure everything manually via config files.
This seems to be better organized for me and the better way to backup and migrate my config later.

I think the documentation should be updated acording to your statement.

see: http://docs.openhab.org/configuration/items.html#binding-configuration

When you install a binding through PaperUI it will automatically create a .cfg file in conf/services/ for the appropriate binding. Inside these files are a predefined set of variables which are required for the binding to operate.

This is definitely not happening for many bindings.
I cannot even find an example for the netatmo.cfg. :frowning:

The quote you cited from the documentation should be changed to indicate that add-ons that have their own configuration should install a default .cfg file so they can be configured via files. Any OH2/ESH binding that cannot be configured without the UI, only for lack of a .cfg file, should be fixed. Could you open issues?

Regarding 1.x add-ons, only the subset that are known to work under OH2 install a default .cfg file if they need one and a feature has been defined for them (like openhab-binding-mqtt1). If a feature has been added for them, they can be installed via OH2’s add-on installation capabilities. Other 1.x add-ons that are still handled as JAR files won’t affect the existence of any services/xxx.cfg file, so you might have to create your own manually until features are defined for them.

The 1.x add-on documentation is in the process of being upgraded to show instructions relevant for OH2 users. As long as this link remains valid, you can browse to the add-ons’ README.md files to see the documentation upgrade in progress. Comments welcome!

Anyone please correct me if I’ve misstated anything above. Thanks!

Great, @rlkoshak. Do you see anything wrong, unhelpful or could be improved in my take above?

I see nothing at all wrong and will probably copy a lot of the above verbatim. Thanks for pinging, I didn’t see your reply when I created the issue.

1 Like

Like this?

Should I create separate issues for each binding with this problems?
Should I create separate issues for “missing cfg file” and “missing dosumentation”?

Please first consider my comment here. :smile: