PaperUI and Generated JSON files

I have created ‘things’, ‘channels’, and ‘items’ via the PaperUI. For the SONOFF Dual, this process has been done, deleted, and redone a number of times. Apparently the PaperUI requires some information during initial ‘thing’ creation that is never displayed again, during subsequent edits. This isn’t very helpful when you go to create your 2nd, 3rd, etc ‘things’ for additional SONOFF Dual devices. Trying for naming consistency across my implementation.

So, I decided to go to the JSON to find the values I used for those entries not displayed during edits. What I found was that every time I created the ‘thing’ an entry was created in the JSON file. Even after I deleted, via PaperUI, the ‘thing’, ‘channel’, and ‘item’, entries still exist in this file for every time I created these items in the past. They never go away.

SO, my question…how do you clean up this file? How does OH2 know which entries are active and which are old and unused? For someone trying to learn OH, this is crazy frustrating.

Any and all guidance appreciated. TIA.

Sounds like you are using OH2 and still have “Simple Mode” selected, which autocreates and links Items to channels. This rapidly ecomes a nuisance once you have progressed beyond “hello world”, which you have.

Yes, it is easy to leave orphaned links when manually deleting.

Thank you very much for that link…I will follow the path of shutdown OH and edit the JSON to clear this up. All of my work was via PaperUI, so I was surprised to find orphaned links.

After almost 1 year (two of us), we have not found any comprehensive documentation on creating ‘things’ and ‘channels’ for OH2 and our SONOFF Dual devices. Any chance you can provide guidance?? We’d REALLY prefer to go the file route rather than PaperUI. We are command line types here.

Thanks again.

Each binding is different.

As rossko57 indicated, each binding has it’s own set of properties and configuration parameters. The syntax file format is documented at Things | openHAB.

When it comes to Things, many developers do not want to have to directly support .things files because, frankly, it’s a huge time sink that completely goes away when users just use automatic discovery and the REST API (e.g. UI) to manage Things. You can’t mess up the syntax when the Thing is automatically discovered. You can’t miss a parameter when using the UI. Malformed JSON will be rejected when using the REST API.

And there are some bindings where there are some things that simply cannot be done when using .things files (e.g. setting Zwave device configuration parameters).

Note, you can initiate scans, review, and accept Things from the Inbox through the REST API or the Karaf console. You don’t have to use the UI to manage Things even with automatic discovery.

So far I’ve only used PaperUI, but I’ve discovered all sorts of orphaned things in the things file. Also many of my things are nearly identical and copying / pasting in the files would be much easier. I did just find some better docs in the OH3 arena. Thanks guys.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.