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