[SOLVED] Basic-UI: Display of Group member items

  • Platform information:
    • Hardware: Raspberry Pi 2 B
    • OS: openHABianPi 4.14.34-v7+
    • openHAB version: 2

Dear all!
I have a question about the display of items in a group in Basic UI sitemaps:
When I display individual items in the sitemap file, the items show up with a nice icon.
When I display a group in the sitemap file, the group also shows up with a nice icon.
But when I click into the group that same meber items do not have an icon (and their label form the *.items file).

How could I modify the way group members are shown?

Regards, Sulla

My sitemap definition:

        Text label="Homematic" icon="qualityofservice" {
            Group item=Signal_Strength label="Homematic Group" icon="qualityofservice"
            Default item=Schalter_2_signal_strength label="Schalter 1" icon="qualityofservice"
            Default item=Schalter_2_signal_strength label="Schalter 2" icon="qualityofservice"
            Default item=CCT_controller_1_signal_strength label="CCT Controller 1" icon="qualityofservice"

and the output in basic UI looks like this: (top half: the definition above, lower half: when I click on the group)

Yes you can
You need to change your item definitions to include the icon and not include them in the sitemap

ItemType ItemName "Item Label" <ItemIcon> (ItemGroup) [ "ItemTag" ] { ItemBinding}

You can do the same for group items


Default item=itemName

The sitemap will pick up the label and icon from the item definition
I, myself put all the info in the item files and almost nothing in the sitemap as above (except mappings because these can only be defined in the sitemap)

Thank you! Yes, this partly works.
I put
into the item definition. Now Basic-UI displays that icon (also under group), but only the “full” icon, i.e. with all bars in black. Whereas when I define the icon “qualityofservice” in the sitemap, it displays a dynamic icon, i.e. some bars gray and some black, according to the signal level the device reports.
Can I also achieve that?

Yes you can, you need to define your group with a group function.
Also, you don’t need the "" in the icon name <> so it should be <qualityofservice>

Post you group item and items definitions and I’ll show you what to do for the group dynamic icon.

Hi vzorglub!

You are being very supportive! Thanks!
I’m really puzzled how you’re gonna solve that!

I originally defined the group via paper-UI (I had a group function of “MIN”), and this worked, i.e. the group itself hat the dynamic icon. However, I find paper-UI not to be as stable as text based configurations, so I just now moved to .items files, and this resulted now in the group also not having dynamic icons, just as the other items.

So, here come my defintions:
Items for the group:

Group:Number:MIN Signal_Strength "Signalstärke" <qualityofservice>

items for the members of the group:

Number Schalter_1_signal_strength        "Schalter 1 Signalstärke"        <qualityofservice> (Signal_Strength) { channel="homematic...:0#SIGNAL_STRENGTH" }
Number Schalter_2_signal_strength        "Schalter 2 Signalstärke"        <qualityofservice> (Signal_Strength) { channel="homematic...:0#SIGNAL_STRENGTH" }
Number CCT_controller_1_signal_strength  "CCT controller 1  Signalstärke" <qualityofservice> (Signal_Strength) { channel="homematic...:0#SIGNAL_STRENGTH" } 

and the relevant section of the sitemap looks like this:

sitemap home label="z'haus" {
   Frame {
      Text label="Homematic" icon="qualityofservice" {
            Group item=Signal_Strength label="Homematic Group"
            Default item=Schalter_1_signal_strength label="Schalter 1"
            Default item=Schalter_2_signal_strength label="Schalter 2"
            Default item=CCT_controller_1_signal_strength label="CCT Controller 1"

And this results in all non dynamic icons (if you compare with the first screenshot in the original post):

all right, I read through documentation a bit:

So I tried to resolve that using custom icons, even if when I define groups in Paper-UI insterad of text files that works out of the box…

I downloaded icons and put them into /etc/openhab2/icons/classic using

wget https://raw.githubusercontent.com/eclipse/smarthome/master/extensions/ui/iconset/org.eclipse.smarthome.ui.iconset.classic/icons/qualityofservice.svg

for qualityofservice-[0,1,2,3,4].svg and qualityofservice.svg

Still, it displays only the qualityofservice.svg icon with full bars. I assume it has something dodo with teh states not matching 0,1,2,3,4

I think I found the reason why it didn’t work.
Actually it worked as you suggested, Vincent. The Icons were dynamic.
It was just that homematic devices (or the binding) are tricky. They reported the signal strength as “NaN” for a reason I don’t know. I reloaded the state of the devices form the gateway again, and that synced the states to 1,2,3,4 and that caused the icons to be correctly dynamic.
Thanks for help anyway!

Sorry I was at work. Glad you found the solution, please mark the thread as solved. Thanks
Well done

I would simplify the sitemap to one item:

sitemap home label="z'haus" {
   Frame {
      Group item=Signal_Strength label="Homematic Group"