Advice for using a bridge

I am currently developing a binding for controlling multiple LED modules (there are 8 colors/channels on each LED module). Each module has a specific ID and I can control every module via CAN (a simple data bus).
The binding is currently structured, that each module is one thing with 8 channel items. The module ID is written into the thing configuration.
So far so good.
But now I want to group modules. It is very exhausting setting up 4 things to control 4 light modules.
So I read on the binding documentation, that the preferred way of controlling multiple things (via the same protocol) is to use a Bridge.
I looked into the HUE and Milight bridges, but I can’t quite understand if this concept would fit my needs.
What I currently want, is to set a channel which then sets all other channels on the other modules.

My way of achieving this currently would be to create a bridge, which receives a list of IDs of the light modules, which then get instantiated as things. And when receiving a command, I would just send the command to all things in the “thing-list”.
Is this the right approach to do this? Did I understand everything correctly?
And also are there some good bindings which implement bridges in this way? I just can’t find a good example on how to use a bridge, but not as a gateway between different protocols.

If this would be correct, then I see possibilities in the future of scanning actively in the bridge for those light modules which then get dynamically added to the lightmodule-list.

This does not sound like something you should be doing in the binding. Sounds more like something a user would implement within openHAB using Groups or suchlike.

Mh I also thought about this.
But the use case of these light modules is very specific and there are always multiple light modules used together.
Later I have to add some more functionality like time-controlling etc. So I think it would be really neat to have a central controller for all of these light modules.

Do the mystery modules identify themselves as being part of a umm group? Is there something about protocol, addressing, or interconnection that makes a logical grouping?

If you “force” some kind of grouping or “hide” individual access to modules, you know what the first beta user will demand for their party mode :wink:

Yes they all connected via a hardwired bus-system. So all receive the same package frames but only the one with the matching ID interprets the package.

I know :confused: mh, maybe I should stick with the approach of handling everything in openhab groups.

1 Like

Oh, there’s no easy answer. In general, you’d try to avoid “adding value” in the binding simply on the basis of reinventing wheels. Also need to take care not to restrict user choices, you will not predict their demands I guarantee :wink:

On the other hand, your subsystem might include some mechanism allowing a kind of “broadcast” to a group of devices, rather than plodding through individual messages. Then you should take advantage of it.