TOGGLE ALL Lights & Sockets [SOLVED]

hi everyone trying to get a few buttons working on my HABPANNEL (DONT LAUGH)

BUTTONS : All Lights & ALL Sockets

Goal press the button and it turns ON all lights and press the button again it turns them OFF same for sockets

I’m still new to all this and would prefere to configure this using PaperUI

Progress: I CAN TURN ALL LIGHTS OFF USING THE BUTTON BUT CANT TURN THEM BACK OFF AS I CANT FIND A TOGGLE OPTION

Please give as much detail as possible so I might understand

You need to create a Group and add to it the Items that you want to be controlled
Go to PaperUI -> Configuration -> System -> Item Linking -> Disable "Simple Mode"
Then in PaperUI -> Configuration -> Items -> Add a new Switch (edit: Group) Type with name "gLights"
Back in the Items list -> Select each Item that you want to make a member in the new Group and add the Group name in the “Parent groups” section at the bottom

Use this new “gLights” Switch in your HABPanel (using a Switch widget)

Same story for your Sockets (another Group called “gSockets” with the appropriate members)

Pressing ON (or OFF) on the Group will send the command to all its members.

1 Like

Thank you Dim Worked Like a charm should I still be able to turn each light on independent as well as all together

1 Like

Of course yes.
Each individual Item will continue to work as a standalone functional unit and you can control it independently of the Group.
When you control the Group, all the members will get the same command (e.g. ON or OFF)
When you control the individual Items, the other Group members are not affected.
The State of the Group will change to reflect the state of the Items when you use a type and a function for the Group.
Check more on Group states here: http://docs.openhab.org/configuration/items.html#group-type
(think about the Group as a “special” Item type that aggregates other Items)

note: this step from my previous post is wrong. It should be "Add a new Group Type with name "gLights"
It will also work as a regular Item but it’s better to use the Group type in PaperUI (since you will be able to define a Group Type and a Group Function like this)

All correct as stated by @Dim, however in case sockets are used that do only toggle ( i. e. The socket does not differentiate between on and off) switching those sockets individually will result in a false behaviour when the group switch is used.

1 Like

I’m using tp link sockets hs100 They report the state of the plug

I have just added two bulbs and a hue Bridge