Openhab2 - Using a configuration file

Hi,

iam working on a Openhab2 binding and want to use a configuration file to set some properties.
If iam not mistaken the configuration files are stored in
distribution/src/assemble/resources/addons/conf/services

What do i have to do to use the configurations in this file ?

greetings Philip

Note that the files have moved to https://github.com/openhab/openhab-distro/tree/master/features/openhab-demo-resources/src/main/resources/services
and you will require the new IDE setup.

You need to register some OSGi component that requires the configuration. From all 2.0 bindings so far, I am only aware of the Sonos binding that requires this so far:
https://github.com/eclipse/smarthome/blob/master/extensions/binding/org.eclipse.smarthome.binding.sonos/OSGI-INF/SonosHandlerFactory.xml#L12 (note the “configuration-policy” option) and
smarthome/extensions/binding/org.eclipse.smarthome.binding.sonos/src/main/java/org/eclipse/smarthome/binding/sonos/internal/SonosHandlerFactory.java at master · eclipse-archived/smarthome · GitHub

You should ask yourself whether you really need a global configuration option or if your setting might not be better a configuration value on a Bridge or a Thing.