Some basic OH2 questions from an old OH1.x user

Hi all, these feel like such basic questions but I’m not finding anything in the documentation that clears things up…

I’m used to using a plain old text editor to define items, sitemaps, rules, persistence etc… But with the PaperUI it detects the YahooWeather “thing” and subsequently I can create “items” for temp and humidity etc…

It appears items are not stored in a file any more? But it sounds like I can still define items in text files and use those. What is the recommended method? Possibly text files is the ideal approach for an old OH1.x user…

Another mystery to me is how persistence is setup now. In the PaperUI I can install the RRD4j persistence addon but then what? Through the UI it doesn’t appear I can do any more, do I need to revert to create a persistence text file with the update frequency and all that?

And item “groups”… I’m assuming these can’t be configured through the PaperUI either.

I know it’s still early days and the documentation is expanding on a daily basis so forgive me if I’m asking something that is actually explained somewhere.

The PaperUI has a “Configuration > System” area that lets me define items like locale and default persistence service. I have edited these and saved. I then found a runtime.cfg file in the conf/services folder on my windows machine. This config file contains pretty much the same configuration options as what is in the PaperUI, but my values are not reflected.

This tells me that what I set in the PaperUI is not saved to the cfg files. If so then what takes precedence?

I believe the cfg files take precedence.

Also, there should be a cfg file for each binding if you take a cfg file approach, e.g. mqtt.cfg

If you save the data in a cfg file, the Paper UI will read & display the data but you will not be able to edit that info in the Paper UI.

Thanks @MikeD, some testing seems to indicate that the area that the setting was last changed is used. I changed the regional setting to NZ in the runtime.cfg file and the PaperUI showed this change. I change the region to ZW in the PaperUI and this setting seemed to stick but the runtime.cfg file still showed NZ. I just opened and saved the cfg file and then the PaperUI was back to showing NZ again having read it from the file.

This appears quite confusing…

For now I think I’m just going to stick with trying to do everything through file based configuration.

I am also doing most of my configuration using files, with the exception of setting up “things”. These are easier to set up in the Paper UI.

I use PaperUI for discovered Things only, item configuration i do (for consitency sake) all in items files.

I believe this file is only taken into consideration for the first startup of openhab2 to configure all that stuff that PaperUI shows you. Everything after that is subsequently stored in json files (/var/lib/openhab2/jsondb) and backed up automatically according to the settings in PaperUI (Configuration -> System -> Json storage).

Now creating items i do all in items files, for OH1 bindings, everything is the same as in OH1, for OH2 bindings, items are linked to thing channels now, like so:

Number  FibaroMotion_BatteryLevel                     "Batterie [%s %%]"                 { channel="zwave:device:e9291f51:node3:battery-level"}

You’ll find the according channel names on the things in PaperUI (Configuration -> Things)

Everything done in PaperUI gets saved to a JSON database.

Everything saved in text files in conf get read in and I believe also saved to the JSON DB. Updates to the files cause updates to the DB. OH itself runs off of the DB.

Ultimately find what is best for you. Most old OH 1.x users are probably more comfortable using mostly text based configuration and only using PaperUI for a small set of things for which it is well suited, in particular automatica discovery of Things. Some bindings, most notably zwave, do not easily support the creation of Things in .things files and must use PaperUI or Habmin for Thing discovery. But all your Items can be defined and linked to those Things in text files.

I answered this in another thread. The tl;dr is it is pretty much identical OH 1 except for the main configuration file which in its own cfg file and no longer in openhab.cfg, and you can set the default persistence through PaperUI or runtime.cfg.

Yes, just as you did in OH 1.x. This has not yet changed in OH 2.\

I’m not 100% suire the answer is no. That used to be the case but I think they fixed it before the stable release.

Changes made in PaperUI get saved in the JSON DB only. The cfg, items, rules, etc files do not get updated when you make changes through PaperUI or Habmin.

The cfg files take precedence. For a concrete example, if you install a binding through PaperUI and then add a different binding in addons.cfg the one installed through PaperUI will be uninstalled.

I do believe that runtime.cfg is only read when OH restarts so you might need to do a restart to see those changes reflected. This would explain what you saw with the regional setting. If you restarted OH, the value in runtime.cfg would be the one that gets used.

Thanks mate that cleared up a few things!