OH3: How to Group Light Bulbs?

I’m doing a clean install of OH3 (was on OH2) and getting used to the new UI way of doing things. I’ve so far got my 3 x Light Bulb (things) added to my Model for a room, but:

  • how do you in the OH3 UI now make a group (for Power, Dimmer etc) so all 3 function together?


OK worked it out

  1. Got to Items
  2. Press “+”
  3. Use “Add Items from Textural Definition” & you can create stuff just like you would in your OH2 Items File.

If you want the three bulbs to act as one, you can create one item, through the UI or textually, and link that one item to all the of the lamp things

Then you don’t even need to make a group for the three items

But then you loose the ability to control the individual bulbs. They literally act as one. With a group, you can control the group and the individual bulbs.

Isn’t there a way to do this directly from the UI?

Yeah - worked it out as per the pic. You can group multiple similar “things’s channels” as one “item” that then gives you one control for all (or even individual control). I don’t think you can’t group an entire “thing” (with multiple channels) to one Item.

FYI - When I group an entire “Thing” with multiple “Channels”, the resultant “Item” does not present you one set of controls for the entire group, just the option to individually select each “Thing” from which you can operate the channels.

If I make a group for the same “Channel” across multiple “Things” then I can can control the entire group (or individually).

I have an alternative

  1. In semantics model create equipment class wallswitch

2)add points type light switch under

  1. edit the equipment item group settings. Base type switch. Aggregation what you prefer.

Then you gain a tile in the equipment UI with all your wall switches grouping each switch

You can see not all configured fully so not all showing light bulbs

1 Like

The solution suggested by jmone in post #7 works very well also for dimming hue color bulbs - you just need to set Members Base Type as Dimmer like this:

Does anyone know how to make the group work as a color item that can be used to control the whole group with one color picker card?

Having played around with the various options in the Members Base Type, e.g. Switch, Contact, Number, Dimmer, Rollershutter and DateTime, I think that actually a Color option would need to be added to the Members Base Type in order for a color picker card to be able to recognize the group.

Any thoughts on this? Or any suggestions for a workaround - could obviously just be done with a rule but it would be much more convenient to be able to control color lights directly through a group.

I’ve been wondering this too. It seems weird that Group:Color exists (or at least did in OH2) but not here

As you noted, the Group:Color doesn’t exist (basically color is not a type for a group). As such the Group doesn’t know how to deal with all the different color values that may be set on individual items and hence may contain a ‘null’ value which was not handled by the colorpicker control.

My workaround was to create a ‘ColorChanger’ item which runs a rule to update the group on change. As I use a naming convention for Items this allowed me to have a single ColorChanger rule that is in essence only two lines long:

// remove the 'Changer' from the triggeringItemName
val groupName = triggeringItemName.toString.substring(0, triggeringItemName.toString.length - 7)
sendCommand(groupName, newState.toString)

One thing to note is that the ColorChanger Item does need to be initialized with a value or the colorpicker control will not show.

@Sunny Can you explain the steps involved to creating that rule? I am not having any success with it

It’s relatively simple:

1). Create a global ‘ColorChanger’ group
2). Create a new point on the ‘equipment’ you want to allow color changing - this is just a regular Item with a ‘Color’ type and add it to the group created in step 1.
3). Create a rule - the trigger should be when a member of the group created in step 1 is changed.

The rule needs to know how to identify the actual Color item for the equipment. As I said I use a naming convention, so all I have to do is strip the word ‘Changer’ from the end of the triggering item name.

The items for my Kitchen Accent look like this:

Group                      Grp_Lights_FF_KI_Accent                           "Kitchen Accent"                <light>          (Group_Kitchen)                                 ["Equipment"]                    {alexa="Lighting"}
Group:Switch:OR(ON,OFF)    Grp_Lights_FF_KI_Accent_Switch                    "On/Off"                        <switch>         (Grp_Lights_FF_KI_Accent)                       ["Switch"]                       {alexa="PowerController.powerState" [category="LIGHT"]}
Group:Dimmer:MAX           Grp_Lights_FF_KI_Accent_Brightness                "Brightness"                    <slider>         (Grp_Lights_FF_KI_Accent)                       ["Point"]                        {alexa="BrightnessController.brightness" [category="LIGHT"]}
Color                      Grp_Lights_FF_KI_Accent_ColorChanger              "KI Accent Color Changer"       <colorpicker>    (Grp_Lights_FF_KI_Accent, Grp_ColorChangers)    ["Point"]                        {alexa="ColorController.color" [category="LIGHT"]}
Group                      Grp_Lights_FF_KI_Accent_Color                     "Colour"                        <colorpicker>    (Grp_Lights_FF_KI_Accent)                       ["Point"]                        

As you will note all the items are groups except the ‘ColorChanger’ which with the rule in place is simply proxy to the ‘Color’ group. The Kitchen Accent is made up of a few different LED Strips and each of the strips items are members of the respective group.

As a caveat if you find the Color sliders are not being displayed, check that you are initializing the value of the ColorChanger (ie. it should not be NULL). Currently I use a startup rule to set all members of the Grp_ColorChangers to a predefined value.

I would add that if you change the color of the equipment by some other means the UI won’t update (ie. if I use the dedicated smartphone app to change the color of a member of the Kitchen Accent).

I have 2 color bulbs with HSB color models. Both channels of different things.

I try to add them as a group, like you…

In group together…

But when I try to set the item…

I just get the individual ones???

What do you want to happen? By default, the Group with no type will list its members, that’s its default widget.
You’ll want to change the widget in the Group Item metadata to get something else - not sure if you need to assign the Group a type, I think you only need that if you want a group state (which you might very well need for a colorpicker style widget).

What do you want to happen?

I’ve 3 HSB lights that work fine alone, I want a group control so I can control all 3 together, as that will be normal use. Only once in a while might i wish to access each alone.

I’m not really clear what to do here?

I pick on metadata on my group item and I get a list of namespaces (which colorpicker is not in)

So I type one? where to a find the color picker one?

I googled here;

So entered oh-colorpicker-item but my guess did nothing! :slight_smile:

I’m not too sure I know that going on in this part of config, not used it yet.

Can you give the ‘dummys’ explanation to me?


Entered it where? I think you want “default Standalone Widget”.

It may be the UI doesn’t offer it to you because your Group has no sub-type. In the Item properties, this is rather misleadingly called “members type” but really it sets the Group (sub) type.

Still not there…

Changed the group and the 2 items to be in sync on;

All 3 same,
Also for within the Widget;

Now NULL has gone from the status part, it’s blank as here;

But I have no control widget…?

Also, if i click that area nothing happens. I don’t even get the option for control each alone anymore?

I’m still missing something?

Each light is of Type… Color

I don’t see that as a base type for the Group, if that’s what you meant;

Is this not possible in the UI because you can’t make the base group type same as the items in the group, when it’s a color?

This is a UI problem, they accidentally omitted the Color type for Group selection. I thought this was fixed some time ago, but maybe not.

There are workarounds, you could define the Group using the old xxx.items file text syntax, and paste that into “Add Items from Textual Definition” to create the Group:Color type.

On reflection though, I don’t think that’s going to help in the long run. To be much use, the colorpicker UI widget wants a starting point, a valid state from the Group.
That’s okay, Groups have “aggregation functions” like MAX or AVG which will give the Group a state based on members states.
I don’t think that’s properly implemented for Group:Color

We can do a common Group:Dimmer with a brightness slider (even if members are Color types), or similar with master Switch, but that’s not what you asked for.

I don’t know what kind of lights you are dealing with here, but an alternative and very kludgy approach to using a Group is to create a new fourth “ordinary” Color type Item, and link it to all three of your binding channels (as well as keeping their original independent Items). This is @joriskofman suggestion above.

The state of this Item will be a bit indeterminate, but it should be usable with a UI colorpicker to transmit common commands to the three channels.