Beginner Guide how to handle Things and Items

Can anyone answer/explain this ? @chris maybe?

I can explain some of it, as I did ran into this problem, with quite a few items.
I had some PaperUI generated items. I moved them to items files insted, but forgot to delete the generated items in PaperUI. OpenHab complaint loud and clear about this.
Somehow I managed to make a total mess, since I afterwards couldn´t delete those PaperUI generated items in PaperUI. I had no trashcan in PaperUI, and I had to try all sorts of things. Eventually I managed to clear all items using Karaf console. At next boot up all was good again.
This thread…

All this problems changed my way of doing things. So from then, I only do items file. No more generated items on my system, ever again :slight_smile:

An alternative way you could have cleaned it up is by stopping OH and removing the Items from the jsondb files manually. You do need to remove them from both the items and the links file. If you forget the linked then the items still stick around.

Always stop OH before editing jsondb manually to avoid oh from overwriting your changes. I’m also not sure if OH reads from jsondb all the time it only at startup so your changes made while oh is running may not be seen until as restart anyway.

If you want to wipe out all of your PaperUI created items you can just delete the whole files.

Which was exactly what I forgot, (remove the items).
When I discovered that, I went back to PaperUI to remove the items. But without an trashcan it wasn´t possible to do. (I did ask about about the missing trashcan as well).
In my opinion this is an unfortunate situation, since there is no GUI way of fixing this error, even though that would be the most obvious for anyone, since it was created from the GUI. It should always be possible to remove an item and a link. (except when the items is made from item file ofcouse). PaperUI should be able to tell the difference.
I did look at the jsondb file as well, but I honestly wasn´t sure how to handle this. Using karaf to clear all items probably was the best way of doing it, since they will be build again at next startup.

But I think that is why the trash dissappeared. You Now have the item defined as an items file so paper ui assumes it cannot manage it. Remember that the text configs always take precedence. So the fact that you had these items defined in text configs masked the fact that they were also defined in jsondb.

as far as paperui was concerned the Item only existed in the items file.

While I agree it should have been handled better, right now Paperui doesn’t have the information necessary to handle this problem. It needs to be handled at a lower level.

I am runing Openhab in docker, wich i really like:grinning:.
So i thought, it is a good idea to work with thing- and item files.

In my configuration i only take care on the conf folder, the userdata folder can be rebuild easily.

Is there a tutorial or any information how to deal with “things” in paper UI and items in files with docker?

Do i have to make a backup before i restart my openhab container? This was no problem with things in files.?

Greetings

It should be no different than a “normal” install

But when I had this problem, I had items defined both in PaperUI and in items files using the same name and at the same time. This was when the trashcan dissapeared. And because the trashcan dissapeared, I had no easy way to fix this problem anymore. (ie - I could not remove the item from PaperUI, not even when having removed the items from the items file first). I kinda ended up in a loop, where only jsondb or karaf could save me.

Which is why I prefere having items files since then and in the future.

Correct. And since the text files take precedence, as far as PaperUI was concerned the item was only defined in the text file. Hence the trash can went away.

Something below PaperUI would need to be fixed to tell PaperUI that it is defined in both places.

I am certain it’s an error case that was never considered and probably worth an issue at ESH.

Not so fast. There are lots of configs and such that get saved to userdata too. Everything you do in paperui gets saved there. So, you will have to reinstall all your addons and remake all your OH settings and recreate all your auto discovered and paperui created Things.

I highly recommend mounting userdata as a volume as does the Dockerhub readme and the OH docs. Docker | openHAB

@mstormi
Unfortunately the links in the OH docs seems to be dead.

OH docs - link

I don’t know how you came across that link but it’s not official. The official docs are in https://www.openhab.org/docs/configuration/ and links work there (as far as I can tell).

1 Like

@mstormi Markus, thank you very much for your quick response.
And the new link.

That link is copied from your post :

1 Like

6+ month old and explicitly tagged as temporary (“preview”)
I would expect anybody to check official docs first.

3 Likes

Hi i want to revive this post asking how are things know, and if anything change.
I’m starting with openhab, moving from samsung smarthings, and i start using paperui I already have a problem whitn and item i delete in wrong way, so i have my log files complaing all the time (but that is for another post)
So I what to create item sitemaps, rules, etcfrom the gui, but seems uncomplete for a lots of sings, likes rules and site maps. So i was considering star writing in files. Is this the best way, it work correctly with 2.0 bindings?
Thanks.

See https://www.openhab.org/docs/configuration/#versatility for a full description of all the configuration options. Pay special attention to the “Recommendations for new users” section.

1 Like

so there is not one interfece to control everything?, thats a problem. is there a plan tu resolve this? to unify?