# Programing a Samsung button

My guest room has three Hue lights, two on nightstands next to the bed, and one on a table. I want to offer my guests the use of a Samsung button to make it easy to turn the lights off from the comfort of the bed.

I set up the button, so one-click toggles off/on or on the lights. That works well until one light is out of sync so that one light is in on and the others are off. I can expect my guest to turn at least one light off before jumping into bed. When the guest clicks the button, each light will change from its current state to its opposite state. We end up with always at least one light on and can't get to an all off state.

I'm stumped how to write a rule, so with the click of the Samsung button, the lights that are on turn off, and leave the turned off light off. Ideally, the next click would have all the lights in sync and turned on.

I have two nightstands, each with a button and a lamp. What I did was one click toggles the "local" (nearest) lamp, double-click turns on both lamps, click+hold turns off both lamps. That way you can easily get back in sync. It works well for us.

I do something like this with RM4.

I had exactly the same synch issue.

Basically, you're going to need to do a conditional rule:

If Guest 1, Guest 2, Guest Table ANY off
then
Turnon: Guest 1, Guest 2, Guest Table
Else
TurnOff: Guest 1, Guest 2, Guest Table
End If

Basically, this will force a synch of the lights on the first press, and turn them off on the second press.

If they get out of synch, you may have to press twice to get them "in synch" or three times to cycle through to "all on".

You could probably spend some time thinking through the logic, and making a more complex if then else if and so on to figure out all the possible states and force the issue, but I subscribe to the KISS principle whenever possible.

S.

1 Like

Exactly what we did here: single click is the "local" light, double click is the other light, long press is both. Works like a charm, and is easy to explain to visitors.

1 Like