Workaround for the previous post limitation.
By using a custom list widget, slight modification of @rlkoshak example custom list widget for presence, setting the actionAnalyzerItems field is not required any more.
uid: listWidget-presence
tags:
- list
- presence
props:
parameters:
- description: The label for the widget
label: Person
name: title
required: false
type: TEXT
- context: item
description: The presence switch Item
label: Item
name: item
required: false
type: TEXT
parameterGroups: []
timestamp: Aug 17, 2021, 10:37:02 PM
component: oh-list-item
config:
icon: f7:person_circle
iconColor: '=(items[props.item].state == "ON") ? "green" : "red"'
color: '=(items[props.item].state == "ON") ? "yellow" : "gray"'
title: =props.title
item: =props.item
badgeColor: '=(items[props.item].state === "ON") ? "green" : "red"'
badge: '=(items[props.item].state === "ON") ? "IN CASA" : "FUORI"'
action: analyzer
actionAnalyzerItems: =[props.item]
The last line is tricky. I was naively trying
actionAnalyzerItems:
- =props.item
but it didn’t work. I found in another rlkosk example that the right syntax was the one that i showed in the working yaml.
Once this widget is saved under the developer tools , a simple items definition such as
Switch Pres_Silvana "Pres Silvana [%s]" <presence> (gEquip_PresPD) ["Status","Presence"] {channel="xxx",
listWidget="widget:listWidget-presence"[title="Silvana" ]
}
allows me to define the widget in the items file