Dimming specific lights only on a button press


#1

Hi everyone,

I did some searching on the forum and the wiki but unfortunately could not find an answer to my problem.

I am looking for a way to control/dim specific lights in a room when pressing a button.
Background: I have about 8 different bulbs in my room, and a variety of different light recipes (Work-lighting, TV lights, reading, etc.). Not every light recipe uses all those 8 lights. The reading light for example only sees 2 bulbs being turned on, and the others turned off.

What I want to be able to do now is link all bulbs in the room to a remote, but when pressing the “dim” button, I want the dimming only to apply to the lamps that are currently on, instead of all the lights.

Is there a way to achieve that?


#2

I’m not sure about the first part (didn’t understand) but this part yes very possible,
What you need to do is,
When the button is pushed,
Check and save all the devices that are ON (into a variable)
After that
Only dim the lights that are saved to that variable…

Let me write a draft… BRB


#3

Something like this…


#4

Super, Thanks.

I knew it would have to do something with capturing variables, but I was totally out of breadth on how to implement it. I am currently at work but will try to make this work for my own setup tonight and report back.

Thanks so much ike!


#5

Great…
There is another way of doing it without variables BUT not a good way of writing a code…

Let me know if you have any questions…


#6

Dry run done, works beautifully. When I have time over the weekend I will populate the other buttons using the same technique. Thanks for the help!


#7

My pleasure…
Have fun:)