Question about code in page/cell's attributes

  • Platform information:
    Operating System: Raspbian GNU/Linux 10 (buster)
    Kernel: Linux 5.10.63-v7l+
    • openHAB version: 3.1.0
      *Docker version 20.10.10, build b485636

Hello,

In the Page Configure Cells, I can set a value depending of the state of 1 element ex:
=items.xyzAddress06_O8EclChemine.state === ‘ON’ ? ‘Activate’ : ‘’
what I want in the Page Configure Cells, if one the items in a group has the satus On, I want to set the value to Active.

Thank you in advance for your help
Pino

You can do this the same way you do it for a regular item, you just have to properly configure your group item first. Normally group items do not have a state, but the aggregation functions are a system that lets you have a group item with a state that depends on the states of the member items.

If you go the edit page for the group item you will see a section titled Group Settings. This lets you define the formula for how the group item should set its state based on the states of the member items.

Once you have this set up for the group item you just use the same kind of formula you posted above but subsitute the group item name.

Thanks Justin for the explications. It works!