Problems with Items/Things in Habmin/PaperUI

I will open an Issue on the docs github and see what the powers that be think.

Check out the OH1 to OH2 migration tutorial thread:
Migration Tutorial

Basically, in Paper UI you add the item from the Inbox. When you go to Configure>Things you’ll see the auto generated name for the channel (even though it is not automatically linked as you’ve turned off simple mode). Just highlight the generated channel name and paste it into your .items text file. Works really well and significantly (can never eliminate) the chances for error.

This is more or less what I did (though I found Karaf a bit easier to use). It took me the best part of an hour though, and I still made mistakes, so either I’m slower and clumsier than most, or it’s a bit painful.

Yes, slow and painful. Working on OH is a lot like waiting for your significant other to get ready for a party that started 45 minutes ago.

3 Likes

Personally, I recommend using the UI - especially for ZWave. Definition of things will not work well using text files (eg you will not be able to configure the device), so these will need to be managed through the UI anyway if you want to interact with the device. Management of items is subject to error if using the item files, although this is probably acheivable.

Personally I don’t see the drive to use the text files - I think the push to use them for migration from OH1 to OH2 may allow some reuse of OH1 files, although that’s really only true if you use the OH1 bindings as well.

To me the big benefit of text files is that they allow easier backup and editing, and this is a big drawcard. In this respect there is an alternative to the mapdb database which uses a text file format and can be easily edited, but it’s not currently part of OH2 - when this is added it should provide the best of both worlds as you can use the UI, and edit a text file if you wish.

Just my personal thoughts on a popular topic ;).

Don’t you have to use text files to create site maps to use in other UI’s (Basic, Classic)? Is there a way to reference an item configured in PaperUI in these site maps?

Wondering because I’m just starting moving things to text files.

Yes - at the moment this is correct - there is no way to edit sitemaps through the UI (in HABmin-1 for OH1, this was possible, but I never ported this editor to OH2 as it is planned that there will be a new sitemap REST API and therefore this shouldn’t be needed (one day!).

This is the json addon you wrote that I saw you discussing in another thread? This sounds perfect!

Yes - it’s this PR -:

For me the big push is that the UIs at this point in time can’t do it all. Your Habmin comes the closest but, as far as I can tell and I could be wrong (I seem to usually be wrong on this stuff these days) I can’t create a sitemap that will work with Classic/Basic UI. PaperUI is even more limited. As a result we are stuck in a bifurcated paradigm where some stuff we have to do in the UI and other stuff we have to do in text files. then we are left with a precedence problem. For example, if I configure the Nest binding in PaperUI and I have a nest.cfg, which takes precedence?

Over all it is confusing and based on the numerous threads on this forum, the current UI/text files approach violates user expectations for how it should work and it is causing lots of people lots of problems. As it stands right now, the most consistent approach is through text based. And that is why I recommend it for most things (not zwave of course for the reasons you have already mentioned). Actually I recommend more of a hybrid approach where you manage bindings and Things from the GUIs and everything else from text files. It provides some sense of consistency while allowing full use of autodiscovered Things.

From a personal perspective I like the ability to use change control (i.e. easily see how a file has changed over time) which is difficult to do with a DB based config. I’m also more comfortable editing rules in Designer than through a browser page, but I’m more than willing to give all that up once we have at least one admin UI that does it all. But my main concerns are based on the problems others are having understanding how the UIs and text files interact with each other to create a full config.

And I’ve said it before, I think a lot of people’s problems would be mitigated if the default UI for OH2 were Habmin rather than PaperUI. It is more complex, but it is more complete and has fewer areas where user expectations are violated.

So the tl;dr is: I’m not against the UIs, I’m not even agains the DB configs. But the UIs as they exist right now are causing users more problems than they solve.

@chris yes, that’s what I meant. Looks great!

Given that there’s no GUI editor for sitemaps at the moment, I think this is pretty much the only thing that can be done (other than using only text files of course). Personally, I think this is also a good approach :slight_smile: .

Hi all.
I’m a complete newbie here. Installed OH2 yesterday (using repository packages on a Debian server) and I’ve spent most of the day today trying to understand the concepts and tools of this beast. I’ve read numerous threads in this forum with other users that seem as confused as I am. I’ve ended up doing some configuration in PaperUI, some in text files using Designer, some using habpanel and some using habmin. So now I’ve got some Things in text files (which I can’t seem to edit in any way from PaperUI) and some Things in the database (created from PaperUI). I think the thing that is needed most here is some kind of official recommendation. What is the correct and future proof way of creating a Thing, an Item etc. What I’m most afraid for is that I’ll build my configuration up in a way that suddenly is obsoleted and I’ll have to start over from scratch again.

If I understand the discussion above the best way is to create most of the stuff using text files, with the exception of Z-Wave. Is that correct? Is it a good idea to only use Paper UI for installation of bindings, manage Z-Wave through habmin and do everything else using Designer?

I’d also like to note that this seems like a very nice and helpful community. The stupid newbie questions I’ve asked in the forum this far have all got quick and good answers!

Unfortunately OH is in a period of transition right now. We have a mix of OH 1 bindings and OH 2 bindings. For the older 1.9 version bindings the only way to use them is through text files. For the 2 version bindings you have the option of creating and managing Things and Items from text files or through PaperUI.

Eventually PaperUI and/or Habmin will become fully capable and at that time these UIs will become the “official recommended approach.” But until that occurs what you have done thus far is perfectly fine. Do not worry too much about breaking changes to your config at this point. The config is pretty stable and the database is stored in a JSON database so you can, if needed, go in and fix things yourself. And likely if there are any such changes from this point forward, there will be a script or something that will be developed shortly after the change, if not published with the change, to migrate your config.

There have been a lot of changes since last October. So a lot of the discussion above has become OBE. For example, the old MapDB that used to store the config changes made in PaperUI has been replaced by a JSON Database. The upgrade process has been fixed so upgrades no longer wipe out your bindings, requiring them to be reinstalled. And many more improvements.

So, at this point I think you will find that many/perhaps most new comers use PaperUI for all OH 2 things and Designer/text files for all 1.9 bindings stuff and the sitemap.

I personally am a little bit of a special case as I run OH inside Docker. And this means that every time I upgrade I need to wipe out some of my config anyway in order to force the add-ons to update as well. As a result I do the following:

  • I use PaperUI to manage autodiscovered Things.
  • I use text files for everything else.

As a result I can, if needed, completely wipe out my userdata folder and restart openHAB and I’m back to where I started with minimal effort.

However, now that the configs are stored in a human readable and editable form I will probably change my approach some in the near future. Once there are 2.0 versions of all the core bindings I use I will change to using PaperUI for all Things and Items, perhaps even for writing Rules.

So, in short, there really isn’t a best practice right now.

There are no stupid questions here. Home automation is hard and OH is complex. We are happy to help!

1 Like

Thanks a lot for good explanation! It kinda seems I’m entering a very fast moving boat here, I guess I’ll learn to ignore any information that is more than a month old :innocent:

One thing I’ve yet failed to configure is the persistence, all guides I’ve stumbled upon seems to use text files for this. Any good pointers on how to do?

I think persistence is another area that requires the use of text files. However, if you follow this you will only need to set persistence up once and they you can forget about it.

Persistence is one of those things that tend to be forgotten about when talking about these higher level topics. Its important though and shouldn’t be.

Since you are looking at persistence right now, I’ll go ahead and point you to the InfluxDB+Grafana Tutorial if you have any interest at all in generating charts in the future. There is charting built in to OH but it is very much what-you-see-is-what-you-get with no real ability to customize it. Grafana has full customization abilities.

2 Likes

First question: Is there a way of splitting threads in this forum? Feels like we’re leaving the topic now, don’t want to hijack the thread…

Anyway, I still don’t get how to get the data to my database. I thought I’d try with mysql. So i installed the mysql and jdbc mysql persistance bindings, created an empty mysql database, set up a user and put the username and password into jdbc.config and mysql.config. And made a minimal mysql.persistance with the below contents and then restarted entire openhab. But the database is still very empty. Don’t really know what’s supposed to happen…

Strategies {
everyMinute : “0 * * * * ?”
default = everyChange
}

Items {
* : strategy = everyChange, everyDay, restoreOnStartup
}

There used to be. Can’t figure out how to do it now. You can create a new thread and post a link to it here.

Errors in the log?

I don’t think it will create tables for Items until those Items need to be saved (in this case changed). Have any of your Items changed after the reboot?

I’ll warn that MySQL and Maria DB are the two most frequently occurring problem persistence engines I’ve seen on this forum. I don’t know why but but it seems to cause a lot of people problems.

Can’t really understand why I didn’t look there earlier, but yep, there were errors in the log. Starting another thread about this now…

Tnx, this explained a lot !