[SOLVED] On/Off Switch for a group of Hue bulbs

Hi,

I’m a newbie and have been trying and searching a lot over the weekend with limited success as it relates to the challenge below: 3 Hue 210 bulbs in a lamp with 3 fixtures which should be controlled all at once, i.e. I want to control the lamp, not the individual bulbs.

According to the Hue binding documentation, every device supports On/Off via a switch channel, so I created a switch channel for each bulb and a group like I did for color and color_temperature. Setting the color via colorpicker ((incl turn on/off) works, as does the color_temperature slider. But what doesn’t work is the separate switch. Can anyone shed some light what I’m doing wrong?

My Sitemap

sitemap wohnung label="Home" {
    Frame label="Living Room" {
        Colorpicker item=ColorWheel 
        Slider item=ColorTemperature
        Switch item=ColorSwitch
    }
}

My Items

Group ColorWheel
Group ColorTemperature
Group ColorSwitch

Color ColorWheel1 (ColorWheel) {channel="hue:0210:001788215454:7:color"}
Color ColorWheel2 (ColorWheel) {channel="hue:0210:001788215454:8:color"}
Color ColorWheel3 (ColorWheel) {channel="hue:0210:001788215454:13:color"}

Dimmer ColorTemperature1 (ColorTemperature) {channel="hue:0210:001788215454:7:color_temperature"}
Dimmer ColorTemperature2 (ColorTemperature) {channel="hue:0210:001788215454:8:color_temperature"}
Dimmer ColorTemperature3 (ColorTemperature) {channel="hue:0210:001788215454:13:color_temperature"}

Switch ColorSwitch1 (ColorSwitch) {channel="hue:0210:001788215454:7:switch"}
Switch ColorSwitch1 (ColorSwitch) {channel="hue:0210:001788215454:8:switch"}
Switch ColorSwitch2 (ColorSwitch) {channel="hue:0210:001788215454:13:switch"}

Thanks a bunch!

Stefan

Hey there!

What exactly doesn’t work? Visualisation of your group status of your switches?

I would use this group definition:

Group:Switch:OR(ON,OFF) ColorSwitch "All Lamps [(%d)]" <light>

(Text and icon are optional)

It probably doesn’t work because you have 2 items with the same name:

Switch ColorSwitch1 (ColorSwitch) {channel="hue:0210:001788215454:7:switch"}
Switch ColorSwitch1 (ColorSwitch) {channel="hue:0210:001788215454:8:switch"}
Switch ColorSwitch2 (ColorSwitch) {channel="hue:0210:001788215454:13:switch"}

Thanks, both for your fast responses. I corrected the typo, amended the group as suggested, and even commented out everything else, to reduce it to the bare minimum, see below. On the UI the switch works, but it doesn’t control the bulbs, the %d counter also stays at zero (which seems logical)

Sitemap:

sitemap wohnung label="Home" {
    Frame label="Living Room" {
        // Colorpicker item=ColorWheel 
        // Slider item=ColorTemperature
        Switch item=ColorSwitch
    }
}

Items:

// Group ColorWheel
// Group ColorTemperature
// Group ColorSwitch 
Group:Switch:OR(ON,OFF) ColorSwitch "All Lamps [(%d)]" <light>

// Color ColorWheel1 (ColorWheel) {channel="hue:0210:001788215454:7:color"}
// Color ColorWheel2 (ColorWheel) {channel="hue:0210:001788215454:8:color"}
// Color ColorWheel3 (ColorWheel) {channel="hue:0210:001788215454:13:color"}

// Dimmer ColorTemperature1 (ColorTemperature) {channel="hue:0210:001788215454:7:color_temperature"}
// Dimmer ColorTemperature2 (ColorTemperature) {channel="hue:0210:001788215454:8:color_temperature"}
// Dimmer ColorTemperature3 (ColorTemperature) {channel="hue:0210:001788215454:13:color_temperature"}

Switch ColorSwitch1 (ColorSwitch) {channel="hue:0210:001788215454:7:switch"}
Switch ColorSwitch2 (ColorSwitch) {channel="hue:0210:001788215454:8:switch"}
Switch ColorSwitch3 (ColorSwitch) {channel="hue:0210:001788215454:13:switch"}

Try that:

Group:Switch ColorSwitch "All Lamps [(%d)]" <light>

Same result: the bulbs don’t go on/off. I set them on/off via the Hue app to be able to check, However, the %d parameter is now empty , shows (-), whereas before it was showing (0)

What happens in the logs when you switch the group in the UI?

with Group:Switch:OR(ON,OFF) ColorSwitch “Alle Lampen [(%d)]”

2018-11-19 11:34:15.740 [ome.event.ItemCommandEvent] - Item ‘ColorSwitch’ received command ON
2018-11-19 11:34:15.756 [ome.event.ItemCommandEvent] - Item ‘ColorSwitch1’ received command ON
2018-11-19 11:34:15.763 [ome.event.ItemCommandEvent] - Item ‘ColorSwitch2’ received command ON
2018-11-19 11:34:15.775 [ome.event.ItemCommandEvent] - Item ‘ColorSwitch3’ received command ON
2018-11-19 11:34:15.809 [vent.ItemStateChangedEvent] - ColorSwitch1 changed from OFF to ON
2018-11-19 11:34:15.816 [vent.ItemStateChangedEvent] - ColorSwitch2 changed from OFF to ON
2018-11-19 11:34:15.822 [vent.ItemStateChangedEvent] - ColorSwitch3 changed from OFF to ON

with Group:Switch ColorSwitch “All Lamps [(%d)]”

2018-11-19 11:34:59.561 [ome.event.ItemCommandEvent] - Item ‘ColorSwitch’ received command ON
2018-11-19 11:34:59.589 [ome.event.ItemCommandEvent] - Item ‘ColorSwitch1’ received command ON
2018-11-19 11:34:59.612 [ome.event.ItemCommandEvent] - Item ‘ColorSwitch2’ received command ON
2018-11-19 11:34:59.625 [ome.event.ItemCommandEvent] - Item ‘ColorSwitch3’ received command ON
2018-11-19 11:34:59.657 [vent.ItemStateChangedEvent] - ColorSwitch1 changed from NULL to ON
2018-11-19 11:34:59.663 [GroupItemStateChangedEvent] - ColorSwitch changed from ON to UNDEF through ColorSwitch1
2018-11-19 11:34:59.667 [vent.ItemStateChangedEvent] - ColorSwitch2 changed from NULL to ON
2018-11-19 11:34:59.671 [GroupItemStateChangedEvent] - ColorSwitch changed from UNDEF to ON through ColorSwitch3
2018-11-19 11:34:59.677 [vent.ItemStateChangedEvent] - ColorSwitch3 changed from NULL to ON

what’s interesting is that without the OR the group does not seem to propagate the state change to ColorSwitch2

That’s normal. The OR only sets the state of the group according to the members states.
The bulbs are receiving the commands

Make sure that the bulb are set to a brightness and color that you can see.
Put 1 bulb switch in the sitemap. Turn it ON and OFF. Does that work?

Same thing, whether I have 1,2 or 3 bulbs in the group (both variants of the group). However, as I was looking at the logs I noticed that the system was complaining about a possible mismatch between the sitemap name and the sitemap file name, so I corrected this. The sitemap file is now called “default.sitemap” and the sitemap itself is called “sitemap”. Yet it still does not work, the only thing that has changed is that the %d parameter now shows the correct number of bulbs in both group variants. I tried both group variants with 1,2 or 3 bulbs respectively, have switched them on before, one bulb set to red, the second one to blue and the third to white, all clearly visible colours/brightness. Log file says they get the off command, but the lamps continue to shine happily :confused:

default.sitemap:

sitemap default label="Home" {
    Frame label="Living Room" {
        // Colorpicker item=ColorWheel 
        // Slider item=ColorTemperature
        Switch item=ColorSwitch
    }
}

hue.items:

// Group ColorWheel
// Group ColorTemperature
// Group ColorSwitch 
Group:Switch ColorSwitch "All Lamps [(%d)]" <light>
// Group:Switch:OR(ON,OFF) ColorSwitch "All Lamps [(%d)]" <light>

// Color ColorWheel1 (ColorWheel) {channel="hue:0210:001788215454:7:color"}
// Color ColorWheel2 (ColorWheel) {channel="hue:0210:001788215454:8:color"}
// Color ColorWheel3 (ColorWheel) {channel="hue:0210:001788215454:13:color"}

// Dimmer ColorTemperature1 (ColorTemperature) {channel="hue:0210:001788215454:7:color_temperature"}
// Dimmer ColorTemperature2 (ColorTemperature) {channel="hue:0210:001788215454:8:color_temperature"}
// Dimmer ColorTemperature3 (ColorTemperature) {channel="hue:0210:001788215454:13:color_temperature"}

Switch ColorSwitch1 (ColorSwitch) {channel="hue:0210:001788215454:7:switch"}
// Switch ColorSwitch2 (ColorSwitch) {channel="hue:0210:001788215454:8:switch"}
// Switch ColorSwitch3 (ColorSwitch) {channel="hue:0210:001788215454:13:switch"}

log files:

with Group:Switch:OR(ON,OFF) ColorSwitch "All Lamps [(%d)]" <light>

2018-11-19 11:52:58.014 [ome.event.ItemCommandEvent] - Item 'ColorSwitch' received command OFF
2018-11-19 11:52:58.025 [ome.event.ItemCommandEvent] - Item 'ColorSwitch1' received command OFF
2018-11-19 11:52:58.070 [vent.ItemStateChangedEvent] - ColorSwitch1 changed from ON to OFF


with Group:Switch ColorSwitch "All Lamps [(%d)]" <light>

2018-11-19 11:59:17.858 [ome.event.ItemCommandEvent] - Item 'ColorSwitch' received command OFF
2018-11-19 11:59:17.873 [ome.event.ItemCommandEvent] - Item 'ColorSwitch1' received command OFF
2018-11-19 11:59:17.889 [vent.ItemStateChangedEvent] - ColorSwitch1 changed from ON to OFF

What about that?

sitemap default label="Home" {
    Frame label="Living Room" {
        // Colorpicker item=ColorWheel 
        // Slider item=ColorTemperature
        Switch item=ColorSwitch1
    }
}

Does that switch bulb 1 on and off?
1 Like

The Group does all it is supposed to; sending it a command ON sends a command ON to it’s members. It’s not a group problem if members don’t respond to ON.

Simplify to a sitemap switch representing just one member. Does that work? I don’t know anything about hue, so I don’t know how that should be configured.

EDIT - ah, what @vzorglub said while I was typing :slight_smile:

Guys, thanks so much for your assistance and time to look into it, I really appreciate it!

I simplified it to the max, renamed groups and bulbs for greater clarity (Simplicity?)…but it doesn’t work. I’ll try a reboot (even though this is not Windows :-), maybe that helps

default.sitemap:

sitemap default label="Home" {
    Frame label="Living Room" {
        Switch item=with_or
        Switch item=without_or
    }
}

default.items:

Group:Switch:OR(ON,OFF) with_or "With OR [(%d)]" 
Switch Bulb_with_or     (with_or)       {channel="hue:0210:001788215454:7:switch"}

Group:Switch without_or "Without OR [(%d) bulbs]"
Switch Bulb_without_or  (without_or)    {channel="hue:0210:001788215454:7:switch"}

log files:

2018-11-19 12:36:04.693 [ome.event.ItemCommandEvent] - Item 'with_or' received command OFF
2018-11-19 12:36:04.716 [ome.event.ItemCommandEvent] - Item 'Bulb_with_or' received command OFF
2018-11-19 12:36:04.735 [vent.ItemStateChangedEvent] - Bulb_with_or changed from ON to OFF

2018-11-19 12:36:06.165 [ome.event.ItemCommandEvent] - Item 'without_or' received command OFF
2018-11-19 12:36:06.178 [ome.event.ItemCommandEvent] - Item 'Bulb_without_or' received command OFF
2018-11-19 12:36:06.202 [vent.ItemStateChangedEvent] - Bulb_without_or changed from ON to OFF

Okay, so it’s nothing to do with groups. Your device does not respond to an ON/OFF command to the Item. You can see autoupdate changing the state in the log, so you kno the command is getting there.

Some hue configuring problem I guess.

1 Like

Trying a different approach: I switched off the lamp via a hue switch (hardware, that works :slight_smile: ). Log files show me that the color channel went from 300,99,100 (red, on) to 300,99,0 (red, off), 257,98,100 (blue, on) to 257,98,0 (blue, off) and 84,47,100 (white, on) to 84,47,0 (white, off).
Is there a way that I can send input to the color channel myself, using variables or anything like that and mimic an on/off behavior? And then use a switch with mappings somehow on top of the item/the group?

This frustrates me - seems such an obvious thing one want to do: turn on/off a lamp with several bulbs with 1 click

1 Like

According to the Hue binding, the switch channel is supported only on thing types 0000 and 0010.
You are using it with a led type 0210.

Anyway, I also have 3 Hue leds and I control them with a single switch, using color channel:

Switch Livingroom_Light_Switch  "Livingroom Light" <light> (gNight_Mode_OFF, Lights, Livingroom) ["Switchable"] {channel="hue:0210:00178840fd2f:1:color", channel="hue:0210:00178840fd2f:2:color", channel="hue:0210:00178840fd2f:3:color"}

But then something is wrong with the documentation if switch really isn’t supported, at least how I read it. There is a matrix in the middle of the doc page that states:

The following matrix lists the capabilities (channels) for each type:

Thing type On/Off Brightness Color Color Temperature
0000 X
0010 X
0100 X X
0110 X X
0200 X X
0210 X X X
0220 X X X

According to the X for On/off in row 0210 the switch should be working if I’m reading it correctly.

But thanks for your snippet, Mihai, I’ll try that.

Indeed, bu there is another table below:

Channels

All devices support some of the following channels:

Channel Type ID Item Type Description Thing types supporting this channel
switch Switch This channel supports switching the device on and off. 0000, 0010
color Color This channel supports full color control with hue, saturation and brightness values. 0200, 0210

Yup, it was the "SOME of the following " that made me think that it works, as it did not say “the following devices support these channels”…and yes, I know it sounds pedantic, but really, it made me spend 3 hours now trying to figure it out

Try that:

sitemap default label="Home" {
    Frame label="Living Room" {
        // Colorpicker item=ColorWheel 
        // Slider item=ColorTemperature
        Switch item=ColorTemperature
    }
}

hue.items:

// Group ColorWheel
Group ColorTemperature
// Group ColorSwitch 
//Group:Switch ColorSwitch "All Lamps [(%d)]" <light>
// Group:Switch:OR(ON,OFF) ColorSwitch "All Lamps [(%d)]" <light>

// Color ColorWheel1 (ColorWheel) {channel="hue:0210:001788215454:7:color"}
// Color ColorWheel2 (ColorWheel) {channel="hue:0210:001788215454:8:color"}
// Color ColorWheel3 (ColorWheel) {channel="hue:0210:001788215454:13:color"}

Dimmer ColorTemperature1 (ColorTemperature) {channel="hue:0210:001788215454:7:color_temperature"}
Dimmer ColorTemperature2 (ColorTemperature) {channel="hue:0210:001788215454:8:color_temperature"}
Dimmer ColorTemperature3 (ColorTemperature) {channel="hue:0210:001788215454:13:color_temperature"}

//Switch ColorSwitch1 (ColorSwitch) {channel="hue:0210:001788215454:7:switch"}
// Switch ColorSwitch2 (ColorSwitch) {channel="hue:0210:001788215454:8:switch"}
// Switch ColorSwitch3 (ColorSwitch) {channel="hue:0210:001788215454:13:switch"}
2 Likes