# Set the group state for mixed group items

**URL:** <https://community.openhab.org/t/set-the-group-state-for-mixed-group-items/128677>\
**Category:** Items & Sitemaps\
**Tags:** groups, openhab3\
**Created:** [November 12, 2021, 11:43am UTC](https://community.openhab.org/t/set-the-group-state-for-mixed-group-items/128677 "2021-11-12T11:43:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![EnricoS](https://community.openhab.org/letter_avatar_proxy/v4/letter/e/ecae2f/32.png) [@EnricoS](https://community.openhab.org/u/EnricoS)\
**Post date:** [November 12, 2021, 11:43am UTC](https://community.openhab.org/t/set-the-group-state-for-mixed-group-items/128677/1 "2021-11-12T11:43:50Z")

</div>

Hello everybody

I have a group for a light, which consist of items of different types.

```csv
Group gLight1
Switch LightPower (gLight1)
Number LightLevel (gLight1)
Dimmer LightColor (gLight1)

```

 ![grafik](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/f/5/f51e5578bd1b0ec136c2ddac289c4b970204c379.png)

In groups of different item types the state is always NULL. Thats not nice and I want to set the state to something more sensible like “ON”. I know the [doc](https://www.openhab.org/docs/configuration/items.html#derive-group-state-from-member-items) and how it works with groups of a specific type. Is there a way for groups like this one?

Thank you a lot  
Enrico

---

<div class="post-metadata">

**Author:** ![rossko57](https://community.openhab.org/user_avatar/community.openhab.org/rossko57/32/70263_2.png) [@rossko57](https://community.openhab.org/u/rossko57)\
**Post date:** [November 12, 2021, 12:09pm UTC](https://community.openhab.org/t/set-the-group-state-for-mixed-group-items/128677/2 "2021-11-12T12:09:56Z")

</div>

Have you tried it? You’ll have to give your Group both a type and an aggregation function. Some functions work with mixed type members, some just are not sensible e.g. averaging switches.  
I’d expect to be able to have a Switch type Group with mixed Switch and Dimmer members, not so sure about Number members.

---

<div class="post-metadata">

**Author:** ![EnricoS](https://community.openhab.org/letter_avatar_proxy/v4/letter/e/ecae2f/32.png) [@EnricoS](https://community.openhab.org/u/EnricoS)\
**Post date:** [November 12, 2021, 2:39pm UTC](https://community.openhab.org/t/set-the-group-state-for-mixed-group-items/128677/3 "2021-11-12T14:39:28Z")

</div>

Well, that works somehow. As a side effect OH tries to set/update the state itself from the group items. It does not use the switch item but any item, what means the state can be wrong. I need to overwrite the state via postUpdate().

I’ll keep an eye on this. Maybe it is a good solution.

---

<div class="post-metadata">

**Author:** ![rossko57](https://community.openhab.org/user_avatar/community.openhab.org/rossko57/32/70263_2.png) [@rossko57](https://community.openhab.org/u/rossko57)\
**Post date:** [November 12, 2021, 3:05pm UTC](https://community.openhab.org/t/set-the-group-state-for-mixed-group-items/128677/4 "2021-11-12T15:05:25Z")

</div>

I’ve no idea what you mean.  
The state of a Group type Item is calculated from is members by design.

If you want an Item you can change the state of at will, that’s just an Item. You can’t do that with a Group.
