Why does "light-on.png" does not work as a group-icon?

Second curious thing today :slight_smile: While trying to implement the second dimensions of groups in openHAB 1.83 I had big problems to even see the group “EG_Licht” at all in the GUI. There seemed to be no error in the code, and so I copied another line of code to test. This line had an other icon defined, and the very moment everything was OK.

As I could not explain the difference to myself (the png works with switches without any Problem,so the file is not corrupt) I copied “light-on.png” to “light.png” and tried again. “light.png” works fine for my “EG_Licht” group, “light-on.png” still does not.

Why???

For the group to report as “ON” or “OFF” all the items in the group need to be ON or OFF. Otherwise the status of the group is “-” so your icon will need to be named “light.png” for the unknown state “light-off” for OFF and light “light-on” for when the group is all ON.

Thanks for Reply! I never would have expected that the filenames are parsed for a “on” or “off” ending. But as far as I understand you, this would lead to a situations where the (wrong) icon should not be displayed (no “-on” icon as long as one light in the group is off). My situation was, that the whole group was not displayed (even no label) as long as I used a “-on” icon. Is this intended too?

Oh sorry I misunderstood your original question.

Can you post your sitemap?

Here you are:

sitemap mw19 label="Haussteuerung"
{
        Frame {
                Group item=gS label="Souterrain" icon="cellar"
                Group item=gEG label="Erdgeschoss" icon="groundfloor"
                Group item=gOG label="Obergeschoss" icon="firstfloor"
                Group item=gDG label="Dachgeschoss" icon="attic"
                Group item=gG label="Garten" icon="garden"
                Group item=gLicht_zentral label="Licht" icon="light" {
                        Switch item=LichtEGaus label="Licht EG" icon="light" mappings=["OFF"="aus"] }
                }

}


As you can see, the “gLicht_zentral” group is the first complete group-definition I moved from the items file to the sitemap after I read that this would be preferable. Following your first answer I would have expected to see the group-label “Licht EG” without the icon, as long as this was a “-on” icon. But the whole Group is missing then.

sitemap mw19 label="Haussteuerung" { Frame { Group item=gS label="Souterrain" icon="cellar" Group item=gEG label="Erdgeschoss" icon="groundfloor" Group item=gOG label="Obergeschoss" icon="firstfloor" Group item=gDG label="Dachgeschoss" icon="attic" Group item=gG label="Garten" icon="garden" Group item=gLicht_zentral label="Licht" icon="light" Switch item=LichtEGaus label="Licht EG" icon="light" mappings=["OFF"="aus"] } }

I don’t believe you can have a Switch Grouped underneath another Group. I could be wrong but


does not mention that as a correct use.

You are right, this is not mentioned in the example, but it works (as long as you do not use the wrong iconfile :-)). I got this from here: https://knx-user-forum.de/forum/supportforen/openhab/41309-zwei-lampen-im-gui-zusammen-fassen

And following a HTML-analogy I must say that I can understand a thread i read (sorry, cannot remember where) which stated that the sitemap is the presentation-definition, so everything that has to do with presentation should be done there. I started the other way round with groups defined in the sitemap and in the items-file, but think about moving all group-definitions to the sitema now to clean things up

A few things based on this thread:

  • You can specify how the states of the members of your Group are aggregated and how your Group is treated on the sitemap. For example:
    Group:Switch:OR(ON, OFF)  // If one member is ON the Group's state is ON
    Group:Switch:AND(ON, OFF) // If all members are ON the Group's state is ON
  • Groups are more than just a way to build up the sitemap. In fact, because you cannot customize anything about how the members of that Group are displayed they are actually pretty poor at defining your sitemap. But they are INCREDIBLY useful in Rules and Persistence. Search for “Design Pattern” and you will see several postings where I use Groups in these ways.

  • While it appears to work, your Group item=gLight_zentral label="Licht" icon="light" { line is a non-standard use. You can achieve the same thing (assuming what you have there is working the way I think it should) using:

    Text item=gLicht_zentral label="Licht" icon="light" {
      Switch item=LichtEGaus label="Licht EG" icon="light" mappings=["OFF"="aus"] 
    }

Note that with the above you are not limited to using a Group in order to define a subpanel. Any Item can be presented on the sitemap as a Text.