Amazed about JSR223 and Jython - Hue Groups Rule

Yes, I am familiar with this, but I was meaning the use of groups to organize the Items rather than flagging them with metadata. Groups are a nice bucket for holding Items.

I am sure that I have shown you examples in other discussions that we have had in other forum topics. There is also an example in Mode (Time of Day). Basically, if you are using classes to generate rules, you are doing something the hard way.

You mean all of an Item’s metadata at once?

This is why I was asking about using groups vs metadata, since groups seems to be a lot better way to do this.

For completeness though, you can do this with core.metadata, but your approaching it from the wrong side. To generate a list of all Items with a particular namespace, iterate through all Items in the ItemRegistry (not all metadata in the MetadataRegistry) and search their metadata for the namespace that you are looking for…

items_with_namespace = [item for item in itemRegistry.getAll() if get_metadata(item.name, "Treppe Gang Gruppe") is not None]