Trying to Turn On/Off multiple lights at once

Hi guys, just started using and learning about openHAB. As per title, I want one button to turn on/off multiple lights. I’ve grouped them in my lights.items config, and added a Switch in my sitemap, but it isn’t working in Basic UI. The switches come up, I can click on All Off/ All On but it doesn’t physically turn my bulbs on/off. Can someone please double check my code and see what I’ve messed up? Thanks in advance!

//This is the Lights Item File


	//Group Light Switches
Group:Switch:OR(ON,OFF) gLights "All Lights"
Group:Switch:OR(ON,OFF) gHallwayLights "Hallway Lights"
Group:Switch:OR(ON,OFF) gOfficeLights "Office Lights"

	//Hall Light
Switch Toggle_Hall_Light "Hall Light Switch" (gHallwayLights, gLights) { channel="hue:0210:0017882c8f5e:2:color" }
Dimmer Dimmer_Hall_Light "Hall Light Dimmer" { channel="hue:0210:0017882c8f5e:2:color" }
Color Color_Hall_Light "Hall Light Color" { channel="hue:0210:0017882c8f5e:2:color" }
Dimmer ColorTemp_Hall_Light "Hall Light Color Temp" { channel="hue:0210:0017882c8f5e:2:color_temperature" }

	//Office Light
Switch Toggle_Office_Light "Office Light Switch" (gOfficeLights, gLights) { channel="hue:0210:0017882c8f5e:3:color" }
Dimmer Dimmer_Office_Light "Office Light Dimmer" { channel="hue:0210:0017882c8f5e:3:color" }
Color Color_Office_Light "Office Light Color" { channel="hue:0210:0017882c8f5e:3:color" }
Dimmer ColorTemp_Office_Light "Office Light Color Temp" { channel="hue:0210:0017882c8f5e:3:color_temperature" }

	//Office Desklamp
Switch Toggle_Office_Desklamp "Office Desklamp Switch" (gOfficeLights, gLights) { channel="hue:0210:0017882c8f5e:1:color" }
Dimmer Dimmer_Office_Desklamp "Office Desklamp Dimmer" { channel="hue:0210:0017882c8f5e:1:color" }
Color Color_Office_Desklamp "Office Desklamp Color" { channel="hue:0210:0017882c8f5e:1:color" }
Dimmer ColorTemp_Office_Desklamp "Office Desklamp Color Temp" { channel="hue:0210:0017882c8f5e:1:color_temperature" }


//This is the Sitemap


sitemap home label="Smart Home Automation"
{
	Frame label="Network Devices"
	{
		Switch item=Presence_Sony_Xperia_X label="Sony Xperia X"
		Switch item=Presence_Samsung_Galaxy_J7_Prime label="Samsung Galaxy J7 Prime"
	}
		
	Frame label="Hallway"
	{
		Switch item=Toggle_Hall_Light
		Slider item=Dimmer_Hall_Light
		Colorpicker item=Color_Hall_Light icon="colorwheel"
		Slider item=ColorTemp_Hall_Light
	}

	Frame label="Office"
	{
		Switch item=Toggle_Office_Light
		Slider item=Dimmer_Office_Light
		Colorpicker item=Color_Office_Light icon="colorwheel"
		Slider item=ColorTemp_Office_Light

		Switch item=Toggle_Office_Desklamp
		Slider item=Dimmer_Office_Desklamp
		Colorpicker item=Color_Office_Desklamp icon="colorwheel"
		Slider item=ColorTemp_Office_Desklamp
	}

	Frame label="Lighting System"
	{
		Switch item=gLights mappings=[OFF="All Off", ON="All On"]
		Switch item=gOfficeLights mappings=[OFF="All Off", ON="All On"]
	}

}
1 Like

I don’t have hue but i noticed you bind your switch items to a color chanell:

Switch Toggle_Office_Desklamp "Office Desklamp Switch" (gOfficeLights, gLights) { channel="hue:0210:0017882c8f5e:1:color" }

would’nt you need a “switch_dimmer” chanell (or the hue equivalent) to actually turn the light on?
AFAIR a switch group item can only hold/send switch values (ON/OFF) so that might be your issue.

Hi, thanks for your reply. For this model Hue, there is only the color channel, no switch channel. I didn’t know this either until I Googled.

Nevertheless, I just restarted my server and the lighting All Off/All On buttons are working! Wow, just a restart and it worked! Is this a known bug lol.

Thanks anyways.