Not being able to retarget a root item in the model seems to be an omission?

So as someone who’s literally on this third day of openHAB (starting with 3.0) I first created a Kitchen in the model.

Today, I bought a smart plug-in dimmer for a lamp in my living room and decided I probably should model a Home with my Kitchen and a Living Room in it. So I created a Home and a Living Room under it:

Then I clicked on the Kitchen to move it under the Home. But lo and behold, it was missing a “Direct Parent Groups” entry, probably because it didn’t have a parent. In this screenshot, “Direct Parent Groups” would be above “Direct Group Members” if it were available:
Screenshot 2020-10-26 at 22.44.35

Without this, I was not able to re-home my Kitchen under my newly created Home. However, I could do so trivially in the org.openhab.core.items.Item.json file:

   "Kitchen": {
    "class": "org.openhab.core.items.ManagedItemProvider$PersistedItem",
    "value": {
      "groupNames": [
        "Home"
      ],
      "itemType": "Group",
      "tags": [
        "Kitchen"
      ],
      "label": "Kitchen",
      "category": ""
    }
  }

and after restarting openHAB the model looked fine:
Screenshot 2020-10-26 at 22.22.47

So I am assuming not showing “Direct Parent Groups” for root objects is a mistake, that prevents one from being able to move them? It should be visible and allow one to select any group that doesn’t create a cycle (or whatever the constraints are for direct parent groups already). What do you think?

You might leap into the middle of this thread

Remember OH3 is a work in progress that you have decided to use.

You have two ways of doing this in the UI:

Either you go your child item, edit it and change the Parent Groups:

or, you go to the page of the parent group and click on Change in the “Direct Group Members” card - you can then select several items to add to or remove from the group.

I’m not particularly happy with that UI but for now it will have to do.

To add a Parent Group from the child Item’s page,

  1. open the Item’s page from the Items section
  2. Click on Edit
  3. You will find “Group Membership” in the middle right under “Semantic Class”

Okay, editing the item is a workaround.

That still leaves a big inconsistency in the model view for items that don’t have a parent, don’t you think? Forcing you to go to leave the Model view to go to Items to do something that’s available for every object in the Model view except the root ones seems like a missed opportunity for simplicity. All that’s needed is to have “Direct Parent Groups” there even if empty, just like you do for “Group Membership/Parent Group(s)” in the item view.

(It’s also inconsistent to use a plural with parenthesis in Items, in “Parent Group(s)”, versus in the Model where all those categories are plural even with a single item in it, but that’s more minor.)

I don’t think anyone here is arguing that it can and shouldn’t be better. But for now the above is how it works and will probably continue to do so for at least the time being. There is a ton of work being done right now and a lot of it is to fix stuff that is broken. Some of these usability issues are secondary in priority for now.

Oh, okay. Yes I don’t really mind. My workaround editing the JSON was fine by me too, but it’s nice to know I can also do that in the UI without restarting openHAB (I stopped it first because I don’t know if it watches the file; I’ll check that later). I just put it out there to get feedback on whether it’s a bug or not. And being new, I don’t know if I should file a bug or just discuss it here first :slight_smile:.