OH3 files or GUI

“Add Link to Item” and “create new Item” in things works her and “add new Item” also.

1 Like

OK. you can manage remotely then.

https://community.openhab.org/t/wiki-getting-started-with-oh3-rewriting-the-tutorial-6-model-your-home-with-items-link-channels/101008\

2 Likes

OK I have not used HABot

first link doesn’t open:
image
second, it looks like it is exactly what I was looking for, thanks a lot!

URL has added character. Here is the correct one.

Yes!
Better even, OH3 does no longer seem to recompile the rules when you change items that were in use in those rules, and even where it does, it’s blazingly fast.
If I’m not mistaken all of that is likely thanks to the next gen rules engine which replaced the old one as the default starting with OH3 (it was available before but not used for .rules files).

If you never ran on a RPi with rules taking on the order of 2-3 minutes to recompile, you cannot appreciate how much of an improvement that is !
(Hopefully my enthusiasm lasts, I haven’t tested much and am still wary of running into that situation again.)

Another plus I noticed is that items sourced from files (things, too? haven’t checked) are now marked with a lock icon in GUI so even to combine UI and files has become an option.
I still wouldn’t recommend to mix them except in special cases but it’s a lot safer/less prone to error to use now.

I did when I first started. When I hit the 7 minute mark to be fully loaded I decided it was time to move off the Pi.

1 Like

I now have a few new rules made in OH 3 UI and I like it a now. Thanks for the tip to copy the code from one rule to the other, it saves a lot of time.
In general, I think that the programming of the rules was solved very well and clearly.
My statement that less is possible here was based on my lack of understanding.

1 Like

Hi all,

before I start I have to give a big “Thanks” :ok_hand: to @ysc !!!
Just started playing around with OH3.0.0.M2 and the new MainUI is just awesome. Incredible work and IMO a big step for openhab.

I’m coming from a completely text-conf based setup in OH2.5. Never used PaperUI. I was always a big fan of a pure textual config because of different reasons like version control, speed of bulk modifications, structuring in different files and so… Don’t won’t to start the dissucion about pros and cons here.

With the new UI I already switched all the service configs and things to MainUI. Only I’m not sure how to handle items :thinking:

The metadata configuration is so easy in the new UI… love it…

This is what I’m missing or just didn’t find yet. I found the option to bulk import items but no option to edit them later on. Is there a code view for items as for things or metadata (@ysc)??

And what’s about further bulk options besides deleting with the “Select” feature for items? Is there something planned like “add to Group” e.g.?

Maybe someone has some input to get my head around this.

1 Like

(edit: just realized you’re on Milestone 2 so most of what I said below is too recent and not available…)

You have 3 ways to access this screen:

  • the Items page, the blue “+” button has a “Add Items from Textual Definition”.
  • the Developer Tools menu, you have a shortcut there.
  • the Developer Sidebar (if you have screen wide enough to display it, >1280px): you open it from the Developer Tools or with Shift+Alt+D from anywhere, and you’ll find shortcut buttons to create new stuff on the last tab. “Add items (textual)” is the one you want.

Then you can paste chunks of your .items files to recreate the items in the internal DB. There is no equivalent for things.

Yes.
Although to bulk add items to groups you can also go to the group itself, under “Direct Group Members” you have a “Change” button. This will transform the list into a items picker, you check or uncheck items accordingly and click “Apply”. It will ask you to confirm.

By the way, in case you missed it, you can now Ctrl+click in lists where you have bulk operations available to switch to select mode (or back to normal if you uncheck everything). So you don’t have to reach that tiny Select button hidden in the corner anymore.

1 Like

You must do that on a list item, not the background of the frame though.

Thanks for your fast reply.

Maybe I was not clear enough… I’m aware of this option and already used it. It is already there in M2. What I’m missing is a similar option for items already in JSONDB. If I edit a Thing I can use the Code tab to get the YAML representation of this thing and modify it there. This is what I couldn’t find for items.

Great :+1:

One of the challenges with Items is that there are actually three separate concepts involved which are all combined into one in .items files:

  • the Item definition which is everything up to the { } part
  • the Links to Channels/Profiles which are wholly managed separately
  • Item metadata which also is wholly managed separately and, unfortunately, the REST API makes it challenging to show all the metadata on a given Item.

So, even if there were a code view for the Item, it’s probably not going to contain everything you expect. You’d still have to create Links and modify metadata separately.

2 Likes

I saw a PR go by that allows regex style wildcards for metadata fetching. Not sure if that also applies to internal calls.

I’ve been using OH since i dont know when, but its been a while, i cant remember which betaof v1 i jumped in on… Anyway I still feel like my setup is work in progress and i probably spend far too much time tweaking an breaking stuff. I have a great advantage of only having the dog complaining if something doesn’t work.

So where am i getting to… i do find that i spend a lot of time changing things… e.g. that group setup doesn’t work, don’t like that naming convention now, wanna use this icon for this item type now… anyway, as you can imagine doing this is the GUI became tedious as it was item/thing by item/thing… so i moved over to files… this was a big enabler for how i make use of OH, but then cos i have OCD i like to break things down, so i still ended up with multiple files to modify and i had to ensure they all linked together properly…

I did go down the road of trying to have a single script (yes shell not perl, none of this new fangled stuff for me) that all the objects i wanted to create/delete and execute the REST api to do the work… Although this worked, it wasnt quick, and timings went astray occasionally (my bad for not checking RC from previous calls i expect)

So what I have ended up with is… a bit of a mess but it works great for my thought processes…

  • I create a thing/item script which when passed parameters creates a line item/stanza for a thinge/item
  • I have a master setup script (one for things, one for items) which holds and calls the above scripts and know which item/thing file to put the entries into…

so to add a new item i would just put an entry like the below in my setup file.

./heimansocket.sh  OPIMQTT  TumbleDryer         TumbleZZDryer          Garage        gZigBee

The effort this took as been well and truly paid back to me, and i can now… on a whim

  • remove all my item files knowing i can recreate them with a single command.
  • add a single item/thing by updating a file
  • Dont like the name for that group of devices, change it in one file…

Its certainly not perfect, but as i said i do like to tweak and modify constantly…

Anyway for me, the answer is, if things are relatively unchanging, and at some point that will be the case for me, i would go with the GUI, though somethings dont jump out as how to achieve them, but that’s probably just me. BUT if you want to constantly modify go with files…

P.S. I realise im a bit late to the party on this one :slight_smile:

I agree! I, too, constantly redo everything, having learned something new, I constantly try to apply it, but it requires a large-scale alteration. In addition, I have 3 servers, at home, in the garage and in the country. Having done something in one place, it is very easy to transfer it to other servers using the file option. In a graphical interface, this is more difficult to do.

What would be great is to be able to import and export the ui objects to files, including rules and things

That’s an ever-recurring request but it won’t happen.
In the past there simply was noone willing to build it, but now UI functionality has essentially outgrown the capabilities of the file format. So now it cannot even be done any more.

Why not? at the end of the day all the UI things / rules, etc are stored in a JsonDB, so as I see it its should be only a matter of export / import entries from the system db in json as it is stored internally. Or do I miss something?