Set a group item state from one member state within the group

Hi there,

I am using openHAB 3 and was wondering if it is possible to set a state of a group item by the state of one concrete member of this group.

In my use case I have multi-sensors from different vendors. Mainly I am interested in the temperature values, but the sensors often also provide e.g. humidity, battery level, …
My strategy is always to create a group item for a sensor, that is tagged for the semantic model. Than I can access all values from the sensor via the group item within the pages by clicking on the group item. The group item itself has also a state, normally “NULL” or “UNDEF”. Now I wanted to route only the temperature value to the group, so that this value is shown on top level. I tried different things, but I was not able to get this running.
I am using textual definitions for my items.

Here is an example:

Group:Number:Temperature gAqaraSensor4 "Aqara Sensor Gefrierschrank" <temperature> (gAbstellkammer) ["Sensor"]
Number:Temperature aqaraSensor4Temperatur "Temperatur Gefrierschrank [%s °C]" <temperature> (gAqaraSensor4) {channel="deconz:temperaturesensor:zbaqsens4temp:temperature"}
Number:Pressure aqaraSensor4Luftdruck "Luftdruck Gefrierschrank" (gAqaraSensor4) {channel="deconz:pressuresensor:zbaqsens4press:pressure"}
Number:Dimensionless aqaraSensor4Luftfeuchtigkeit "Luftfeuchtigkeit Gefrierschrank" <humidity> (gAqaraSensor4) {channel="deconz:humiditysensor:zbaqsens4hum:humidity"}
Number aqaraSensor4Batterie "Batterie Gefrierschrank" <battery> (gAqaraSensor4) {channel="deconz:pressuresensor:zbaqsens4press:battery_level"}
Switch aqaraSensor4Alarm "Niedriger Batteriestatus Gefrierschrank" <alarm> (gAqaraSensor4, gWarnung) {channel="deconz:pressuresensor:zbaqsens4press:battery_low"}

This is what it looks like in the UI:

Is there a way to do this?


Group Item state can be derived from member states by choice of aggregation function. There isn’t one to do that.

The use case is really about presentation - you already know the temperature and are not processing or “adding value” in any way.

One circumvention for your use case would be a custom widget that looks like a group but shows your given Item state.
I don’t know how you’d make that in MainUI. Someone may have something similar to represent a Thermostat made of a small collection of individual Items.


Thanks for your answer.

The proposed workaround sounds very laborious especially, when you never implemented a custom widget before. :frowning:
I was hoping there is an more easy solution for this, because I can imagine I am not the only one, who has this use case. :slight_smile: