displayState on Group Item

Hello. I have a confusion with the following Group Item definition:

Group:Number:Illuminance:MAX        Helligkeit               "Helligkeit" <sun> (Haus) ["Measurement", "Illuminance"] { unit="lx", stateDescription=""[pattern="%d %unit%"] }
Number:Illuminance      HelligkeitOst           "Helligkeit Ost"   <sun> (Helligkeit)    ["Measurement", "Illuminance"]   { channel="knx:device:bridge:sensors:HelligkeitOst", unit="lx", stateDescription=""[pattern="%d %unit%"] }
Number:Illuminance      HelligkeitWest           "Helligkeit West"   <sun> (Helligkeit)    ["Measurement", "Illuminance"]   { channel="knx:device:bridge:sensors:HelligkeitWest", unit="lx", stateDescription=""[pattern="%d %unit%"] }
Number:Illuminance      HelligkeitSued          "Helligkeit Süd"   <sun> (Helligkeit)    ["Measurement", "Illuminance"]   { channel="knx:device:bridge:sensors:HelligkeitSued", unit="lx", stateDescription=""[pattern="%d %unit%"] }

As you can see, the group item Helligkeit has a state description pattern that should show the unit. But when I print the displayState in the UI then this gives me an empty string: items.Helligkeit.displayState

When I just print state instead, then OH prints the value with the unit, as I would with the use of displayState. Why is that? Is that a bug? This is on OH 5.1.0.

Because your group state is a quantity with a unit, that unit is automatically included in the state. So, the pattern you have defined in the state description results in a display state that is identical to the state. In that case, the display state will never be available in the widget expressions:

Oh I see, got it. Thanks!