Where does Paper UI save the items?

I have setup some items and mapped them to things in paperUI. But I want to look at them in script form and move them to my conf files. I’m assuming paperUI saves them as a file somewhere but I can’t find them.

Ben

They are save in the OpenHAB JSON database. You should be able to read the information using the REST API I believe.

1 Like

Is there a file where they are stored or a method to extract that json with all information about all the items?

/var/lib/openhab2/jsondb. Look for a file named something with items.

Edit: On Debian based systems.

1 Like

One caveat with using the REST API. That will give you all the Items no matter how they are defined (i.e. those defined in .items files too). If you only want those Items defined through PaperUI, automatically created via Simple Mode, created using the Karaf console, or Items created in Rules, you want to look at the JSONDB files directly.

Note, the Links and the Metadata are saved in separate files (it should be apparent which files based on the file names).

For manually installed OH instances, the folder is $OH_USERDATA/jsondb where $OH_USERDATA is the userdata folder under where ever you unzipped openHAB to.

2 Likes

You will be able to identify which items are defined in the JSONDB instead of files because they will have the editable flag set to true.
If you have the jq tool (which you can easily install on many Linux distributions and probably on other OSes too), you can filter the API output like this:

$ curl http://ip:8080/rest/items | jq '.[] | select(.editable == true)'

jq select() examples

3 Likes

I know that Simple Mode has gone away in OH 3. But in 2.5, aren’t the Items created by Simple Mode also set with editable=false? That was my understanding based on what happens when some users try to add them to Groups or change them through PaperUI after disabling Simple Mode.

I can’t check because I don’t use OH2 nor items files anymore :slight_smile: - but I remember some weird bug with Simple Mode where if you remove items but keep the links, they would still exist as “zombies” and then they would have "editable": false. (Please don’t take this as face value, it’s only from memory).

1 Like

Does your UI work with OH 2.5?

It used to, but not anymore.

1 Like