[SOLVED] Getting rid of orphan items

In this post I describe the nightmare that I have been going through the last week or so with trying to set up a working persistence with SQLite.

The details can be found in that post but in short, when I rename my MQTT item from Temperature to Diningroom_Temperature, OH2 stops logging the MQTT temperature to the SQLite database. As soon as I rename it back to Temperature, it starts logging again.

There is only one line in my *.item file as such:

Number Diningroom_Temperature "Dining Room Air Temperature [%.1f °C]" {channel="mqtt:broker:topic:diningroom:temperature" }

What is interesting is that PAPER UI shows as if there were two lines:

openhab_temp

Even more suspicious is that PAPER UI is also showing the humidity of the ESP8266 sensor logging to MQTT but I have not added a line to my items file for humidity:

openhab_temp2

There appears to be a parallel world of items, other than those stored in my items file in /etc/openhab2/items. Can this be? Surely if I clear the cache this should not happen?

If I connect to http://localhost:8080/rest/items?recursive=true I can see:

  • Diningroom_Temperature
  • Temperature
  • Humidity

Only the first is recorded in m items file. This must be the origin of my problems with my SQLite persistence not working for Diningroom_Temperature. Any clues as to why I’m getting Temperature and Humidity showing up in PAPER UI even though there is no line in my items file? How can I get rid of them?

SOLVED: My suspicion that there is a parallel life for items was ture (although I’m not sure how its handled).

It turns out that under Configuration ->Things in PAPER UI you have to unlink the item in the relative channel and delete the item from there. So, I deleted the Temperature item and re-linked the things temperature channel to Diningroom_Temperature. All of a sudden, there is line added to my items table in SQLite database and Diningroom_Temperature is finally being persisted. Phew! It took me hours to work this out and the solution was so simple …

I must admit the documentation is not clear on this parallel universe of items. I had always assumed that if you have only one item in your *.items file then you should only see one item appearing in the PAPER UI. Of course my assumption was wrong. Hope others find this useful.

These “parallel” worlds are started by creating items via file AND via PaperUI (and probably automatically there because of the “SimpleMode” set to true). It is suggested to NOT mix file created items with PaperUI created ones. The former can NOT be edited/deleted/changed by PaperUI!

I agree. Ii is OK to have the UI discover Things but creating text ones when required for other bindings. Those would not overlap.

What is unclear about this ?
It states (and even explains) to not mix GUI and files, doesn’t it ?

2 Likes

It seems many users these days need a handholding video. Text, apparently does not matter.

I personally hate video-only documentation. You need to pause & type out things manually.

And I hate writing docs … but what I hate even more is to write docs and then have someone be too lazy to read them and post here instead. That’s really obliterating my efforts.

3 Likes

Ok, admittedly I may have skimmed that page in particular. Apologies for annoying people. It wasn’t my intention :slight_smile:

However, the text does also says For Things and Items, both methods can be used side-by-side , e.g. a Thing can be discovered and created by Paper UI and the Items that link to that very same Thing (that Thing’s Channels, actually) can be manually defined in a .items configuration file.

I thought this legitimised using both in parallel. Anyway, problem solved and in the process I have learnt something new that I can pass on :slight_smile:

No you didn’t read that at all in the first place.
And even if you HAD read it (or now that you have read it after my response),
what the heck is unclear or misunderstandable about that ?
Text says “you can use PaperUI for things and files for items”.
It does not say “you can use PaperUI and files for items”.

2 Likes