[SOLVED]Group:Switch:OR OH3 supported?

In OH 2.5 I vas able to display in a label, the number of active switches inside a group of switches with the following code line inside the .item file
Group:Switch:OR(ON, OFF) name_of_grup "label_of_group [%d]"

is it possible to create the same feature with metadata or something other in OH3 enviromet?

That was always a bit magical to me :slight_smile:

Is it the [%d] you are having trouble with?

Chatted about this with @ysc some weeks ago.
The pattern [%d] was somehow special with groups in oh2 but is not yet supported in oh3 MainUI.

No that part is fine for text inlabels.

I was trying to convert groups with active number of element.

Thanks for tour explanation hmerk, These feature was very usefull for example fast recognition on tamper and reed element on allarm system or know how many light was ON in my home.

I will be patient and wait for implementation =)

Thank you

I also used that feature quite a lot (numbers of doors/windows open, numbers of items offline, numbers of rooms with active presence…)

Any plans it will be supported , or should we think about a workaround…

Short term, no solution, long term, I don‘t know.

Maybe this is helping you:

Latest post . . . a workaround but I’m happy with it :slight_smile:

I found the way to make it works!
you have to procede these way:

In the semantic model page you have to EDIT the group (location or point or whateber it is) and go to

Group Settings

  • Members Base Type - None
  • Aggregation Function - None

and change to

  • Members Base Type - Switches or Contact or so on
  • Aggregation Function - One ON then ON else OFF

save changes

  1. then go back to your semantic model and go to the group edited previously and select
    Add Metadata
    State Description
    and insert the Label you want to display, for example

Active nodes %d/19

et voila’!! No textual definition needed