# Derive Group State from Member Items is delayed a lot =\> workaround

**URL:** <https://community.openhab.org/t/derive-group-state-from-member-items-is-delayed-a-lot-workaround/146210>\
**Category:** Items & Sitemaps\
**Tags:** item, openhab4, group-state\
**Created:** [April 20, 2023, 8:15am UTC](https://community.openhab.org/t/derive-group-state-from-member-items-is-delayed-a-lot-workaround/146210 "2023-04-20T08:15:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![helipus](https://community.openhab.org/letter_avatar_proxy/v4/letter/h/958977/32.png) [@helipus](https://community.openhab.org/u/helipus)\
**Post date:** [April 20, 2023, 8:15am UTC](https://community.openhab.org/t/derive-group-state-from-member-items-is-delayed-a-lot-workaround/146210/1 "2023-04-20T08:15:38Z")

</div>

Hi there,  
I always had a problem that my group items states derived from member items had been delayed a lot. This made all my rules very complicated.  
As this problem was getting a lot worse since I switched to OH4 I found some workarounds.  
I don’t like them because they use way more calculating power but they work and they may help others:

Instead of working in rule directly with the group item im know checking all the members of this group items:  
Code Examples: JavaScript Scripting (ECMAScript 2022+)  
The delayed version which sadly doesn’t work always:

```auto
if (items.getItem("groupitem").state === "OPEN") {
// do something
}

```

My solution:

```auto
if (items.getItem("groupitem").members.find(item => item.state === "OPEN") ) {
// do something
}

```

Or as a trigger vor a rule:  
The delayed version which sadly doesn’t work always:

```auto
triggers.ItemStateChangeTrigger(groupItem)

```

My solution:

```auto
triggers.GroupStateChangeTrigger("groupItem)

```

The concept is always to check the childs directly even if the functionaly is not even needed.

I really hope there will be a solution in the future that deriving the Group States from Member Items is not so delayed anymore.

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [April 20, 2023, 3:47pm UTC](https://community.openhab.org/t/derive-group-state-from-member-items-is-delayed-a-lot-workaround/146210/2 "2023-04-20T15:47:49Z")

</div>

> [@helipus](#):
>
> I always had a problem that my group items states derived from member items had been delayed a lot.

Have you ever filed an issue on this? Group aggregation functions should only take a few milliseconds. In my experience it has never been that much of a delay.

It can be the case that the state of the Group changed _after_ the rule triggered, especially if you are relying on updates to the Group Item to trigger the rule instead of changes.

What do you see in events.log?
