Which Item updated my Group Item?

Good Morning together,
Actually I´m working on some procedures to detect opening windows during alarm state. Some windows may be open all the time (bathroom upstairs for example). But the change of one of these items from CLOSED to OPEN should be detected.
I wanted to safe my time, so I put all contact items to a group item. The rule is fired by following:

when Item groupWindow received update

I can see in the logfile, that the trigger of the rule is working when I move some Window Items of this group.
I can NOT use a trigger like following syntax, because I want detect only changed. Some Windows may be kept open all the time.

when Item groupWindow changed from CLOSED to OPEN

After triggering the rule, I need to know which Items inside the group changed their status. Here is my problem……
I tried the often explained solution with the procedure like:

... groupWindow.members.sortBy[lastUpdate].last...

But this returns every time the same item – no matter, which items changed its status.
I assume, my task is needed by many of you guys. How did you solved that problem?
Thanks and have a nice Sunday.

Since this will only work if all your group items are persistet, you should check if persistence is working on all items.
If so, it might be necessary to give persistence a moment to catch up, like so:

Thread::sleep(100) // give persistence time to save the update
//get which players playlist should be changed
val ThePlayList = gPlayerPlayList.members.filter[s|s.lastUpdate() != null].sortBy[lastUpdate()].last as NumberItem

Works 100% reliable in my setup.

Hi Oli,

thanks for your ideas.
I think, I got it now. I have more than one persistence services running. Now I point directly to MAPDB.
First try of changing my code are looking very well.