[SOLVED] Multiple Polling - thing handler

Dynamic groups are a bit difficult and generally not worth the effort - so I’d seriously caution you before going down that path.

What you are going to need is a class that implements ChannelGroupTypeProvider as an OSGI component. This will provide your group definitions and provides your code with method to add/remove group types. You’ll need to inject this component into your thing handler and pass it to the thing (to add or remove groups).

Your thing then will dynamically generate groups by adding/removing them from your ChannelGroupTypeProvider by ChannelGroupTypeUID that you create.

Your thing then creates channels with the appropriate ChannelGroupTypeUID that matches the one you add to your channel group type provider implementation.

Should all work then.

I think harmony addon has an example (the sony one does but it’s way too complicated for a good example)

EDIT: actually I’d look at the Homematic one - it looks cleaner

Ill have a look thanks.
All that just to change the name of the group :frowning: