If the ‘Member of’ trigger works without an actual group defined, then we’ve got some work to do!

That was my first thought, but the Member of gIndoorLight triggered Rule is running and running without error. So the Group does appear to exist. So I’m with Scott, this is really weird.

That could be a symptom. The error means it can’t figure out what type light is in the forEach. That strongly hints that there is something wrong with gIndoorLight. But it works as a trigger and you even get the same error in the Rule triggered by the Group.

Out of ideas, let’s try stuff.

Copy “gIndoorLight” from the Rule trigger and replace the “gIndoorLight” on the forEach line. There is something about it that even at .rules loading time is seen as a problem. Maybe there’s a hidden character or something weird like that going on.

Ok, that solved it.
I created the group in an .items file and it started working.
I did test removing items from the group before and stopped getting updates, so the system seemed to know about the group in the “Member of”,

Hmmmm. @5iver, is it possible we have a regression in JSONDB stored Groups?

I have played around so much, so it might be something I did on the way that is just really out of the ordinary.

:roll_eyes: that would have been helpful info to start with! Please tell us more about what exactly you were doing to the group and it’s members.

When this was happening, it would have been interesting to see what this returned in the console…

items list gIndoorLight

Possible but unlikely… need more data to reproduce though.

Areas to explore - what happens if Items are members of non-existent Groups (how is rule trigger Member of populated - from Item records or Group?)
What happens if Items are made “members” of a non-Group type Item?

I think the most likely scenario is that I messed up the config when playing around. I now added the group in the UI instead of in the items file and it works fine now.
It did fool me that the Member of worked and not the other functions.
My take is that I somehow have managed to remove the group hence leaving the system with Items pointing to a group that did not exist.

Please dont spend time on this,

I really appreciate all your efforts, thanks.

Okay, just tried this in OH 2.4

Created an Item with membership of gBananas in an xxx.items file.
There is no such group.
Create a rule in xxx.rules file with trigger
Member of gBananas received command
Send command to test Item - rule runs :crazy_face:

Conclusion - Member of looks at Items “groupNames” property but does not validate the existence of an actual group.
Interesting quirk, nasty trap, not a bug I’d say - because at heart it’s finger trouble.

If you try to actually do something with a non-existent group, the error message tells you so in plain language. (we just didn’t believe it)


Interesting… out of curiosity and to help troubleshooting this one, what do you see with…

items list gBanana

I’m guessing nothing.


items list | grep gBanana

(gBananas in my case)
No items found for this pattern.

testSw (Type=SwitchItem, State=ON, Label=slide me, Category=null, Groups=[gBananas])

1 Like

Cool… so using the results of these can diagnose this. I do think this an issue that should be reported, but since it is for the old rule engine, there’s not much point.

I’l leave it you to explore a similar setup with uhh “managed rules”?

It’s been a very productive week. That’s two unexpected behaviors we’ve learned this week that even we never guessed at (the other being that a Group’s list of members get’s replaced when it’s Items are updating).

I’m trying to think of a way to exploit ghostly rule triggers now :wink:

Ahh, I did not catch that was the mechanism behind that null glitch. Makes more sense now.