HowTo: Manage OpenHab 2 configurations

but… from what I understand, this story with the pid: is a temporary measure
I believe that they are working towards a more robust solution where there will be checks in the code to “clean up” stale configs without any user intervention.

Anyway, we are in the “managing OH2 configurations” HowTo thread, so people can find this stuff here in theory.

(and I didn’t do a very good job of explaining them… I can do better :wink:)

1 Like

in case this is about a binidng that has an OH1 and OH2 version, for the pid process should I take pid:org.openhab.mqtt1 of pid:org.openhab.mqtt for the version 1 binding config? Same for MODBUS for example

org.openhab.mqtt
The github issue was closed a long time ago, this should not be needed anymore.

How can I enable Simple Mode via configuration files?

  1. Why would you WANT to when most everybody here recommends NOT enabling it? It causes more issues than it solves.

  2. It is a PaperUI setting, The PAperUI access OH through the OH API so you cannot enable simple mode outside the PaperUI.

1 Like

The setting can be stored in the “runtime.cfg” ( last entry in file), to be found in folder openhab2/services/
Note that such change is read only on the next startup of openhab.

2 Likes

Create a filename org.eclipse.smarthome.links.cfg with autoLinks=true inside userdata/etc directory. For openhabian it is /var/lib/openhab2/etc/.

Other way is to use openhab console (one which you log in at port 8101):

config:edit org.eclipse.smarthome.links
config:set autoLinks true
config:update

You can also use config:property-list or config:property-get autoLinks to retrieve current setting. It is worth to note that above way be scripted through SSH interface without a need to have physical access to disk. (my way goes one level lower than solution proposed by @opus)

2 Likes

Though that way is not guaranteed to survive an upgrade process. In general, the files in that folder are not guaranteed to not become replaced on an upgrade, which is why runtime.cfg exists in the first place.

In practice those files often do not get replaced after you’ve edited them which raises a wholly different problem. Your edited file will not receive the updated contents as part of the upgrade.

In general, using runtime.cfg is the preferred approach.

2 Likes

Thank you, I found it at runtime.cfg.
However I’m curious where the configuration of autoLinks when I configure it via PaperUI.
I see that in runtime.cfg #org.eclipse.smarthome.links:autoLinks=false although I already enabled simplemode in PaperUI.

PaperUI does not store its settings in the runtime.cfg file, however when openhab is started that files read. The line you see is commented out by the “#” at the beginning.

I think it might be arguable. The runtime.cfg is translated to OSGi Configuration Admin layer which is persisted in userdata folder. See that the syntax of runtime.cfg is <config-id>:<property>=<value> for a reason.
On my local setup I see that this setting is retained over restart when I changed it over paperui. You can try with config:list|grep autoLinks.

1 Like