Trying to control multiple dimmers with one slider

Indeed. And even if the Group worked it will send the commands out in sequence so either way performance will be a pain.

First you might be able to get the Group approach to work if you define your group as follows:

Group:Dimmer:AVG gLight_BG_hal_12_Dimmer

This gives OH the hint that you want to treat this Group as if it were a Dimmer Item. Of course make sure not to put non-dimmers into this group. Also note that the value of this Dimmer Group will be the average of all the members. There are other options you can use (see this) but I think AVG is appropriate in this context, though MIN or MAX make sense too. I’ve never done this with a Dimmer so I don’t know what it would default to.

NOTE: I’ve found it useful to distinguish Groups from Items by prepending a g to their name

Next, @tommycw10’s approach is pretty much what I would do but you can use the fact that you have a Group to your advantage and make the rule simpler:

rule "dim them all"
when
    Item All_Hue_Lights received command // trigger on the virtual switch
then
    gLight_BG_Hal_12_Dimmer.members.forEach[ dmr | dmr.sendCommand(All_Hue_Lights.state) ]
end

Finally, and this should work in theory (what a wonder place that Theory is) but I’ve not tried it myself. You can use Timers to add some parallel processing so the lights will get sent their commands in parallel. Honestly in this context I’m not sure if this will work or not as I don’t think its the rule that is the bottleneck. Anyway, it is probably too much overhead to create a timer for each sendCommand so I would group them.

1 create some subgroups and put three to five of your dimmers in each subgroup. Put each subgroup into Light_BTG_Hal_12_Dimmer. Do not put ANY actual dimmers into Light_BTG_Hal_12_Dimmer.

Dimmer All_Hue_Lights // virtual dimmer to trigger the rule, put this on your sitemap
Group Light_BG_Hal_12_Dimmer // parent group
Group Light_BG_Hal_12_Dimmer1 (Light_BG_Hal_12_Dimmer) // child group
Group Light_BG_Hal_12_Dimmer2 (Light_BG_Hal_12_Dimmer) // child group
Group Light_BG_Hal_12_Dimmer3 (Light_BG_Hal_12_Dimmer) // child group

Dimmer Light_BG_hal_12hue1 (Light_BG_hal_12_Dimmer1, BG_Hal,Lights,Lights_BG) {hue="7"}
Dimmer Light_BG_hal_12hue2 (Light_BG_hal_12_Dimmer1, BG_Hal,Lights,Lights_BG) {hue="13"}
Dimmer Light_BG_hal_12hue3 (Light_BG_hal_12_Dimmer1, BG_Hal,Lights,Lights_BG) {hue="10"}
Dimmer Light_BG_hal_12hue4 (Light_BG_hal_12_Dimmer1, BG_Hal,Lights,Lights_BG) {hue="9"}
Dimmer Light_BG_hal_12hue5 (Light_BG_hal_12_Dimmer2, BG_Hal,Lights,Lights_BG) {hue="15"}
Dimmer Light_BG_hal_12hue6 (Light_BG_hal_12_Dimmer2, BG_Hal,Lights,Lights_BG) {hue="8"}
Dimmer Light_BG_hal_12hue7 (Light_BG_hal_12_Dimmer2, BG_Hal,Lights,Lights_BG) {hue="11"}
Dimmer Light_BG_hal_12hue8 (Light_BG_hal_12_Dimmer2, BG_Hal,Lights,Lights_BG) {hue="12"}
Dimmer Light_BG_hal_12hue9 (Light_BG_hal_12_Dimmer3, BG_Hal,Lights,Lights_BG) {hue="14"}
Dimmer Light_BG_hal_12hue10 (Light_BG_hal_12_Dimmer3, BG_Hal,Lights,Lights_BG) {hue="16"}
Dimmer Light_BG_hal_12hue11 (Light_BG_hal_12_Dimmer3, BG_Hal,Lights,Lights_BG) {hue="18"}
Dimmer Light_BG_hal_12hue12 (Light_BG_hal_12_Dimmer3, BG_Hal,Lights,Lights_BG) {hue="17"}

2 change the above rule’s body to this:

val newState = All_Hue_Lights.state // grab it once so we don't slow down below grabbing it over and over
Light_BTG_Hal_12_Dimmer.members.forEach[grp | 
    createTimer(now.plusMillis(1), [| grp.members.forEach[dmr | dmr.sendCommand(newState)])
]

The way this works is you iterate over all the members of Light_BTG_Hal_12_Dimmer (which are all Groups themselves). For each subgroup we create a timer that will immediately start executing in the background. When that timer starts executing we iterate over all the members of that subgroup and send the Dimmer the new command.

Some words of warning:

  • there is some overhead to creating a thread. This may actually make things worse, not better. You can fine tune it though by adding more Items to fewer subgroups or more subgroups with fewer items each. The nice thing is you can do all of this in your items file.
  • I don’t own a Hue hub, I know nothing about Hue and I have no idea if this will disturb, damage, or destroy your hub. Most devices can manage fast messages like this but YMMV. Proceed with caution.
  • I just typed this in. Expect typos.
2 Likes

Thanks Tom and Rich for all the help,

I have got it working thanks to you. :beers:

cheers!

Did you use the timer idea and how well did it work?

I tried the timer idea, but unfortunately it didn’t work, I’m going to try again tomorrow and see if I can get that working.
Without the timer all dimmers react within a second.

Like I said, I think it will work in theory but have never tried it and love to get confirmation that it works, or that it doesn’t work. You might need to schedule the timer for now.plusMillis(10) or 100 or something just in case 1 is too fast or something.

Hmm,
guys, I think there is something wrong with OH web Interface:
I had exactly same issue - wanted to control two Z-Wave dimmers with one slider.
So what I did:
In items file I defined two z-wave items:
Dimmer DimmedLight_Living1 (GF_Living, DimmedLight_Living) { zwave=“14:command=SWITCH_MULTILEVEL”}
Dimmer DimmedLight_Living2 (GF_Living, DimmedLight_Living) { zwave=“10:command=SWITCH_MULTILEVEL” }

And obviously I have defined a group:
Group:Slider:AVG DimmedLight_Living

As the result when I update state of item DimmedLight_Living from MQTT Binding, both dimmers react to this immediately and dim to right value.

But for some strange reason when I create sitemap item with
Slider item=DimmedLight_Living
And click on it in the web interface, it sets dimmers to 5% and that’s it. No control anymore. The funny story is that in the OH App for iphone it works again.
So I guess we just need to fix web slider to make it work without any rules.

`

Inspired by this thread I tried to work on a simpler solution for a group dimmer (in my case for Hue lights).
No rules necessary for this. Just starting with the group dimmer definition as above:

 // Dimmer All_Hue_Lights   
        Group:Dimmer:AVG EG_Lichter_Dimmer

Add for each light that you want to put in to this central dimmer the group “EG_Lichter_Dimmer”:
Hues have the “dimmer” item that needs to be used for this. This Hue light belongs to EG_Lichter_Dimmer group (the group that is relevant for the central dimmer) and to another group called EG_Beleuchtung.

Dimmer Hue1_Dimmer "HUE Sofa Dimmer"       (EG_Lichter_Dimmer, EG_Beleuchtung)

Put the group Dimmer into you sitemap as slider item:

 Slider item=EG_Lichter_Dimmer label="Dimmer Wohnzimmer [%.1f]" icon="hue"

This looks as a simple dimmer like this:

I have 4 other Hues and one Living Color light attached to this central dimmer this way without any latency.
Maybe this is useful to others.

Bernd

7 Likes

Yes. This works very well. I used this to control my blinds in a group. I can set all the blinds in the bay window and still control them individually if I want. No latency.

Hi Bernd,

I´ve tried your solution but I didn´t get it working. I want to get it working in HabPanel and I could successfully control each hue light (switch and dimmer), but either the Group:Switch nor the Group:Dimmer is working. Here is my item-configuration:

Group           gLightHallway           (Hallway)
Group           gLightHallwaySwitch     (gLightHallway)
Group           gLightHallwayDimmer     (gLightHallway)

Group:Switch:OR(ON, OFF)        gLightHallwaySwitch     "Schalter Flur-Licht"   <light>         (Home)
Group:Dimmer:AVG                gLightHallwayDimmer     "Dimmer Flur-Licht"     <light>         (Home)

// Hue ambiance spot 1
Switch  Light1_Toggle           "Licht Spot1"   <light> (Hallway,gLight,gLightHallwaySwitch)       { channel="hue:0220:0014854214f6:bulb1:brightness" }
Dimmer  Light1_Dimm             "Licht Spot1"   <light> (Hallway,gLight,gLightHallwayDimmer)       { channel="hue:0220:0014854214f6:bulb1:brightness" }

// Hue ambiance spot 2
Switch  Light2_Toggle           "Licht Spot2"   <light> (Hallway,gLight,gLightHallwaySwitch)       { channel="hue:0220:0014854214f6:bulb2:brightness" }
Dimmer  Light2_Dimm             "Licht Spot2"   <light> (Hallway,gLight,gLightHallwayDimmer)       { channel="hue:0220:0014854214f6:bulb2:brightness" }

How could I fix this?

1 Like

Be more specific.

Couldn’t see much difference to my setup. Except for the dimmer and switch items I’m using the hue color channel not the brightness channel.

Do you get any error messages when using the group dimmer / or switch?

Hi Rich,

As you could see in my item file I set up a Group:Switch “gLightHallwaySwitch” and a Group:Dimmer “gLightHallwayDimmer” and these switch and dimmer I connected in HabPanel with a switch/slider. I´ve done it the same way as I connected in HabPanel a switch/dimmer with “Light1_Toggle”/“Light1_Dimm” and so on.

I could use the switch/dimmer for “Light1*” and further to control the lights and it works, but not for “gLightHallway*” to control all switches/dimmers and thats the reason I asked for help :).

Hi Bernd,

That´s the point: I dind´t see any errors - I could see the switch state or dim level changes but no changes from the hue.

If you see the Group and the members of the Group changing in events.log then the problem is with the Hue binding. I know many people have problems with too many commands are sent to Hue all at once. Perhaps that is what is happening.

As an aside, You don’t nee the Switch Group or Toggle Items. You can send ON/OFF commands to Dimmers and you can put Dimmers on your HABpanel as if they were a switch.

And as Bernd indicates, you could just use the Color channel and ColorItems and send ON/OFF or PercentType commands to them and put them on your HABPanel as a Switch, or a Dimmer, or a Color. You should never need to create multiple Items to represent the same light.

This doesn’t address your specific problem but it will save you some extra work and extra Items in the long run.

I didn´t see any changes of the members of the group - only the Group:Switch for example with a new state. But anyway: I discarded all of the settings and set up again with only one light and a fresh group and finally it works. I didn´t know my mistakes - maybe I set up doubled or what ever. Thanks a lot for your help.

Not sure If I’m right… but you are defining the group twice here. First with “Group gLightHallwayDimmer” and then a second time with “Group:Dimmer:AVG …” I think the last one should be enough.

Here’s what I did to get it to work in the items file. Channels below were added by the Paper UI. I’m using the HABPanel:

Group Home “Our Home”

Group GF “Ground Floor” (Home)
Group FF “First Floor” (Home)

Group GF_Basement “Basement” (Home, GF)
Group GF_Bedroom “Bedroom” (Home, GF)
Group FF_MasterBedroom “Master Bedroom” <bedroom_red> (Home, FF)
Group FF_KidsRoom “Kids Room” <girl_3> (Home, FF)
Group FF_Bathroom “Bathroom” (Home, FF)
Group FF_FamilyRoom “Family Room” <parents_2_4> (Home, FF)

Switch GF_Basement_Light “Light” (GF_Basement, gLight) {channel=""}
Switch GF_Bedroom_Light “Light” (GF_Bedroom, gLight) {channel=""}
Switch FF_MasterBedroom_Light “Light” (FF_MasterBedroom, gLight) {channel=""}
Switch FF_KidsRoom_Light “Light” (FF_KidsRoom, gLight) {channel=""}
Switch FF_Bathroom_Light “Light” (FF_Bathroom, gLight) {channel=""}
Switch FF_FamilyRoom_Light “Family Room” (FF_FamilyRoom, gLight) {channel=“hue:0100:00178817df5b:3:brightness”, channel=“hue:0100:00178817df5b:2:brightness”, channel=“hue:0100:00178817df5b:1:brightness”}
Switch FF_FamilyRoom_corner “Corner Lamp” (FF_FamilyRoom, gLight) {channel=“hue:0100:00178817df5b:3:brightness”}
Switch FF_FamilyRoom_stand “Lamp Stand” (FF_FamilyRoom, gLight) {channel=“hue:0100:00178817df5b:2:brightness”}
Switch FF_FamilyRoom_door “Door Light” (FF_FamilyRoom, gLight) {channel=“hue:0100:00178817df5b:1:brightness”}

Dimmer FF_FamilyRoom_Slider “Family Slider” (FF_FamilyRoom, gLight) {channel=“hue:0100:00178817df5b:3:brightness”, channel=“hue:0100:00178817df5b:2:brightness”, channel=“hue:0100:00178817df5b:1:brightness”}

Group:Switch:OR(ON, OFF) gLight “Light” (Home)

I then used a Slider in HABPanel and was able to reference this dimmer object.

Check out this solution. Works fine for me (OH2.4 M7)

Hello,

maybe you should figure out that this new feature is only available since version 2.4…
But it works fine for switches and dimmers.

e.g.

Switch   KuecheD1_Switch                "Küche Decke"            (Kueche)               {channel="tradfri:0100:gwb8d7af2b578d:65545:brightness", channel="tradfri:0100:gwb8d7af2b578d:65546:brightness", channel="tradfri:0100:gwb8d7af2b578d:65548:brightness", channel="tradfri:0100:gwb8d7af2b578d:65547:brightness" [profile="follow"]}

Don’t forget to define a profile (in my case"follow"

For a dimmer:

Dimmer   Lampe_Tisch_Brightness         "Tisch Helligkeit"      (Tisch)           {channel="tradfri:0220:gwb8d7af2b578d:65542:brightness", channel="tradfri:0220:gwb8d7af2b578d:65543:brightness" [profile="follow"]}

or even for color temperature:

Dimmer   Lampe_Tisch_ColorTemperature   "Tisch Farbtemperatur"  (Tisch)           {channel="tradfri:0220:gwb8d7af2b578d:65542:color_temperature", channel="tradfri:0220:gwb8d7af2b578d:65543:color_temperature" [profile="follow"]}
3 Likes

Thanks for the info that the feature is only available since OH2.4.
I wasn’t aware about this.
:+1: