All Lights ON / OFF Controls

Running RPi 3B+ with version 2.5.10-1

I got the basic lights and temp sensors around the house working several years ago.
Now I would like to be able to turn On and Off all the lights at once. Wife security request.

I have been working through the Demo files to get this to work. I currently have 2 buttons, for now, one for All On and one for All Off. I have gotten them to toggle on the Basic UI screen and display changes in the log file.

2020-11-14 20:01:34.931 [vent.ItemStateChangedEvent] - Garage_Humidity changed from 21.0 to 21.1

2020-11-14 20:01:35.217 [ome.event.ItemCommandEvent] - Item ‘Lights’ received command OFF

2020-11-14 20:01:35.514 [ome.event.ItemCommandEvent] - Item ‘Lights’ received command ON

2020-11-14 20:01:35.814 [ome.event.ItemCommandEvent] - Item ‘Lights’ received command OFF

2020-11-14 20:01:36.130 [ome.event.ItemCommandEvent] - Item ‘Lights’ received command ON

2020-11-14 20:01:36.429 [ome.event.ItemCommandEvent] - Item ‘Lights’ received command OFF

2020-11-14 20:01:36.727 [ome.event.ItemCommandEvent] - Item ‘Lights’ received command ON

2020-11-14 20:01:37.033 [ome.event.ItemCommandEvent] - Item ‘Lights’ received command OFF

2020-11-14 20:01:37.328 [ome.event.ItemCommandEvent] - Item ‘Lights’ received command ON

Unfortunately, I haven’t been able to get the lights to respond to these two buttons. They work fine with the individual On/Off buttons.

Here is what i have in the site map to display the two buttons.

		Frame label="Master Lights" {
	Text label="On / Off" icon="firstfloor" {
		Switch item=Lights mappings=[OFF="All Off"]
		Switch item=Lights mappings=[ON="All On"]
	}

And have been playing with these two lines below to try and get this to work.

//==================================================================

Group:Switch:OR(ON, OFF) Lights “All Lights [(%d)]”

//Group:Switch:OR(ON, OFF) gLight “Light” (Home) [“Lighting”, “Switchable”]

//==================================================================

I have been searching through the forums and online for Ideas to get this to work. Once I get this working, I plan on using a motion sensor to turn on the lights when any of the doors are approached. I’m still learning and reading the docs. Can anyone suggest what I’m missing?

Thank you in advance!!

John Frankforther

Can we see your Items configuration(s) for the individual lights? Presumably they are part of your Lights group?


For example, my Items setup looks like this:

Group:Switch:OR(ON,OFF) gLights

Switch sLivingRoomTallLight "Living Room Tall Light" (gLights) { channel="mqtt:topic:swLivingRoomTallLight:switch" }
Switch sLivingRoomShortLight "Living Room Short Light" (gLights) { channel="mqtt:topic:swLivingRoomShortLight:switch" }
Switch sBedroomDeskLight "Bedroom Desk Light" (gLights) { channel="mqtt:topic:swBedroomDeskLight:switch" }

All the switches are part of the gLights group, by virtue of the (gLights) bit in their configuration.

//Office
Switch MF_Office_Light “Ceiling Light” (MF_Office, gLight) [“Lighting”, “Switchable”] {channel=“mqtt:topic:b7f97f79:OL01”}

// Dining Room
Switch MF_Dining_Light “Light” (MF_Dining, gLight) [“Lighting”, “Switchable”] {channel=“tplinksmarthome:hs200:F912A2:switch”}

// Living Room
Switch MF_LivingRoom_ETL “Left End Table” (MF_LivingRoom, gLight) [“Lighting”, “Switchable”] {channel=“tplinksmarthome:hs105:8A3F8A:switch”}

Switch MF_LivingRoom_ETR “Right End Table” (MF_LivingRoom, gLight) [“Lighting”, “Switchable”] {channel=“tplinksmarthome:hs105:2607EC:switch”}

Switch MF_LivingRoom_Both “Both End Tables” (MF_LivingRoom, gLight) [“Lighting”, “Switchable”] {channel=“tplinksmarthome:hs105:2607EC:switch, tplinksmarthome:hs105:8A3F8A:switch”}

//==================================================================

Group:Switch:OR(ON, OFF) Lights “All Lights [(%d)]”

//Group:Switch:OR(ON, OFF) gLight “Light” (Home) [“Lighting”, “Switchable”]

Right, so all your Items are members of gLight, but you’ve commented out the gLight group configuration and your first post showed you trying to switch the Lights group which none of your Items are a member of.

Switch item=Lights mappings=[OFF="All Off"]
Switch item=Lights mappings=[ON="All On"]

So are you saying that I need to change Lights to gLights in the two statements?

Yes, because at the moment you have all your device Items setup as a member of gLight

Those two statements are in the sitemap file. I changed them,and the lights still don’t turn an off.
Now I get errors in the log file when I click the on/off buttons.

2020-11-15 08:10:46.500 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP POST request at ‘items/gLights’ for the unknown item ‘gLights’.

2020-11-15 08:10:47.182 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP POST request at ‘items/gLights’ for the unknown item ‘gLights’.

2020-11-15 08:10:47.760 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP POST request at ‘items/gLights’ for the unknown item ‘gLights’.

2020-11-15 08:10:48.299 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP POST request at ‘items/gLights’ for the unknown item ‘gLights’.

2020-11-15 08:10:49.477 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP POST request at ‘items/gLights’ for the unknown item ‘gLights’.

2020-11-15 08:10:50.072 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP POST request at ‘items/gLights’ for the unknown item ‘gLights’.

Yes, you also need to un-comment your gLight definition.

From

//Group:Switch:OR(ON, OFF) gLight “Light” (Home) [“Lighting”, “Switchable”]

To

Group:Switch:OR(ON, OFF) gLight "Light" (Home) ["Lighting", "Switchable"]

Note the definition of your group is gLight, no plural!

1 Like

opus !!! That was it. I had been working on this late last night and added the “S” by mistake.
Thanks you both for your help!!