Comparing Dates for a group of items (Zigbee devices)

You have to filter out the Items whose state is NULL or UNDEF before the forEach. You can’t initialize a DateTime with the string “NULL” or “UNDEF”. So you are on the right track but NULL and UNDEF are Item states.

groupName.members.filter[ i | i.state != NULL && i.state != UNDEF].forEach...

And yes, the [ | ] defines a lambda. You can have as many lines of code in a lambda as you want.

Have you seen [Deprecated] Design Patterns: Generic Is Alive.