Item Groups - can you use transformation on them

Item Group Transformation - possible

I’m trying to use proper-case (Off vs. OFF) on HabPanel dummy items tied to groups. Is there a way to transform group items? If so, can you provide the syntax for it please . . .

Group:Switch:AND(ON,OFF) gInternet				"Internet Up [(%d)]"									(Groups)
Group:Switch:AND(ON,OFF) gPort25				"Port 25 & 587 Up [(%d)]" 								(Groups)
Group:Switch:AND(OFF,ON) Heat					"Heat detection [(%d)]" 							(Groups)
Group:Switch:AND(OFF,ON) FloodFurnace			"Flood Furnace detection [(%d)]"					(Groups)
Group:Switch:AND(OFF,ON) FloodSump				"Flood Sump detection [(%d)]"						(Groups)
Group:Switch:AND(OFF,ON) FloodLaundry			"Flood Laundry detection [(%d)]"					(Groups)

Best, Jay

See https://www.openhab.org/docs/configuration/items.html#state-presentation for how to apply transformations to Items. A Group Item is an Item so everything you read about Items also apply to Groups.

Group:Switch:AND(ON,OFF) gInternet “Internet Up [MAP(trans.map):%s]”

See https://www.openhab.org/docs/configuration/transformations.html for more about transformations and https://www.openhab.org/addons/transformations/map/ for how to use the MAP transformation.

In HABPanel, I think there is a check box that will tell it to use the label defined on the Item.

Why not map ON to “Up” or “online” etc.

Thanks guys! I used both of your suggestions.

What threw me was the %d which was counting the items which I wasn’t even using after all so making it a %s worked for what I needed it for.

Best, Jay

Hello all,

just tried to achieve this over the MainUI ( 4.1.0.M4), but I dont have an option to select transformation for a group Items via ui. That only is possible when I have linked a thing channel…

Is that not possible via mainui?

You don’t have that option for an Item either. It’s important to understand the parts of the flow:

Thing: represents the device
Channel: represents a single sensor or actuator on the device
Link: connects a Channel to an Item
Profile: works at the Link to modify or otherwise manipulate the state updates flowing from the Channel to the Item and commands from the Item to the Channel
Items: represents the sensor or actuator within OH

The transform Profile can only be applied at the Link. But that isn’t the only place a transform can be applied.

To apply a transform at the Item level you use the State Description metadata’s Pattern field. In .items files you’ll use the label field. See Items | openHAB. This works for any type of Item, inclduing Groups.

You can also apply a transformation on some Thing Channels and within rules.

many thanks @rlkoshak ! Now I understood and got it working using transformation within the state description of an item.