I am trying to define a custom widget which displays all items on a group using oh-repeater. If user clicks one of the displayed items it should change the state of a different item which name is built based on the clicked item and the suffix “_Ack”.
I tried different thing but always ending up in a message that their is an illegal character in the path. How do I construct the action item name, so that it works?
2023-03-23 14:55:14.879 [WARN ] [org.eclipse.jetty.server.HttpChannel] - /rest/items/[object%20Object]
java.lang.IllegalArgumentException: Illegal character in path at index 34: http://openhabian:8080/rest/items/[object%20Object]
Code of the widget:
uid: alarm_sensors
tags:
- in test
- in use
props:
parameters:
- description: Title
label: Title Text
name: title
required: false
type: TEXT
- description: Icon to show
label: the icon
name: icon
required: false
type: TEXT
- context: item
description: An item to control
label: The Group Item
name: item
required: false
type: TEXT
parameterGroups: []
timestamp: Mar 23, 2023, 11:29:39 AM
component: f7-card
config:
title: =props.title
slots:
default:
- component: oh-list
slots:
default:
- component: oh-repeater
config:
fragment: true
for: i
sourceType: itemsInGroup
groupItem: =props.item
slots:
default:
- component: oh-list-item
config:
icon: =props.icon
iconColor: '=items[loop.i.name].state === "ON" || items[loop.i.name].state > 0 ? "green" : "gray"'
title: =loop.i.label
item: =loop.i.name
badge: =(loop.i.state == "ON")?(items[loop.i.name + "_Ack"].state ==='ON'?"Ack":"Alarm"):"OK"
badgeColor: =items[loop.i.name + "_Ack"].state ==='ON'?"orange":(loop.i.state == "ON"?"red":"green")
action: toggle
actionCommand: ON
actionCommandAlt: OFF
actionItem: '=items[loop.i.name + "_Ack"]'