PaperUI, HABmin or text file based configuration

I’ve been putting off upgrading from 1.x to 2.x over and over again.
I think one of the main reasons for this is that I couldn’t find a solid answer as to which is the best approach to configuring OpenHAB 2.x

I tried using the text only, but felt I was missing out on some of the cool new features of 2.x
I tried using PaperUI, loved the auto-discover, but at the same time felt a bit eerie about not having a human readable file with my things, items, etc
I know the way PaperUI stores the configuration has changed at least once since 2.0, and if memory serves for the better.

My main bindings are:
Philips HUE

Being a 1.x user, I’m not afraid of using text files.
On the other hand, being able to use the auto-discover feature was a nice addition.

I doubt there’s a set-in-stone best answer, and a big part is personal preference.
But could someone give me a list of pro’s and cons of either approach?

1 Like

I come from 1.x too.
I only use the paper UI to discover things

The paperUI will provide you with a channel ID which you can use in the text files like a binding:

Nest thermostat thing:

Nest Thermostat items:

String             House_NestHVACMode                    "NEST Mode [MAP(]"      <boiler>      (Thermostats)                                                                                  { channel="nest:thermostat:bca14bfe:dCd2AOytHIiKRTYPM00jxva1Q3Ryl-jm:mode" }
String             House_NestHeatingONOFF                "Heating ON/OFF [MAP(]"    <radiator>    (Thermostats)                                                                                  { channel="nest:thermostat:bca14bfe:dCd2AOytHIiKRTYPM00jxva1Q3Ryl-jm:state", mqtt=">[mybroker:House/Kitchen/Boiler:state:*:MAP(]" }
Number:Temperature House_NestAmbientTemperature          "Ambient Temperature [%.1f %unit%]"         <temperature> (Thermostats, Temperatures)                                           [ "CurrentTemperature" ] { channel="nest:thermostat:bca14bfe:dCd2AOytHIiKRTYPM00jxva1Q3Ryl-jm:temperature" }
Number             House_NestHumidity                    "Humidity [%d %%]"                          <humidity>    (Humidity)                                                                                     { channel="nest:thermostat:bca14bfe:dCd2AOytHIiKRTYPM00jxva1Q3Ryl-jm:humidity" }
Number:Temperature House_NestTargetTemperature           "Target Temperature [%.1f %unit%]"  <temperature> (Thermostats)                                                                                              { channel="nest:thermostat:bca14bfe:dCd2AOytHIiKRTYPM00jxva1Q3Ryl-jm:set_point", mqtt=">[mybroker:House/Nest/TargetTemperature:state:*:default]" }

Everything is stored in a JSON formatted file. It is human readable and editable. If you are running an apt-get installed you can look at them in /var/lib/openhab2/jsondb.

Personally I use PaperUI for Things and text files for everything else. This lets me take advantage of autodiscovery but lets me more easily take advantage of OH 1.x bindings and features like tags which cannot be managed in PaperUI.

Since you are using Z-Wave and HTTP, I would recommend the same. The Z-Wave 2.3 binding does not yet support creating Things in .things files though I believe that is coming soon. HTTP is a 1.x binding so any Items you have that use it will have to be in .items files anyway.

So, since you are forced to JSONDB for ZWave anyway, and .items files for HTTP anyway, just be consistent and manage all your Things in JSONDB and all your Items in .items files.

1 Like

To clarify my confusion. If you add to things using paperui then there is no need for the things file?

Correct. Anything done through the REST API (i.e. everything done through PaperUI or Habmin) and anything done through the Karaf Console and therefore any Thing that is autodiscovered will only be saved to the JSONDB.

You only need .things files if you want to manually define things yourself.

The same goes for Items.

This wasn’t the case in 2.0 was it?
If I remeber correctly the format used back then wasn’t human readable.
In any case, good to hear it’s now using JSON.

As for using the PaperUI only to define Things, that’s one combination I havn’t tried yet.
I’ll give it a go.
Thank you both for your advice!

Originally it was using mapdb. But I think they switched to jsondb before the release of 2.0. If not it was certainly changed over by the release of 2.1.

1 Like

Thank you @rlkoshak for pointing that out. I’ve only ever used 2+ but liked being able to backup my config for updates etc (using docker for my openhab now) and after looking in the jsondb you mentioned I can see I have actually been backing up the files that WOULD have stored my auto-configed things all along! This changes everything! LOL
Now I’m throwing away my .things file and going paperUI for that but sticking to files for the rest! :smiley:

Also glad to know where the PaperUI config is for backup /restore purposes.