Help needed to set the title from the group description

Based on several examples in this forum I created my own (simple) widget.
All works fine. But I want to use the item.label of the used group as the title for my widget.
How can I achieve this?

title: =props.ItemGroup.label

does not work
Have somebody an idea?

below the code for the widget

uid: Solar_battery_status
tags:
  - Solar
props:
  parameters:
    - context: item
      description: Group that holds all the Battery items to display
      label: Group with the Battery items
      name: ItemGroup
      required: true
      type: TEXT
      filterCriteria:
        - value: Group
          name: type
    - default: Solarbattery
      description: Title used for the widget to the left of the colon.
      label: Title
      name: title
      required: false
      type: TEXT
  parameterGroups: []
timestamp: Sep 12, 2024, 11:55:37 AM
component: oh-list-card
config:
  subtitle: =items.[props.ItemGroup].state
  title: =props.title
slots:
  default:
    - component: oh-repeater
      config:
        for: item
        fragment: true
        groupItem: =props.ItemGroup
        sourceType: itemsInGroup
      slots:
        default:
          - component: oh-list-item
            config:
              action: analyzer
              actionAnalyzerItems: =loop.item.name
              badge: "=(items[loop.item.name].displayState === undefined) ?
                items[loop.item.name].state :
                items[loop.item.name].displayState"
              item: =loop.item.name
              title: =loop.item.label

I asume, this was the code I used
https://community.openhab.org/t/help-with-a-battery-widget/134849

You cannot. This is a long standing limitation of the widget expressions. The basic information about an item that is passed to the widget is only the type of item and the state (and additional information about the state such as unit and converted values where appropriate).

The only way to get the full description of an item, including it’s label, is to get that item from a call to the API and only the oh-repeater does that.

It is possible therefore to build an widget based around an oh-repeater that only returns the one item of interested, but 99% of the time, it is easier just to include a label parameter in the widget and set it manually when you add the widget to a page.

1 Like

Hi Justin
sorry for late answer. I was out with the family.
Thanks for your answer. In this case I have to set the title with an Item
This feature maybe comes in the future.
Have a nice day

BR