Help with a rule - lighting for button presses

I'm pulling my hair out. This is probably easy for some, so I'm putting this out there. I have a button. Maybe I'm complicating it. Running it with ABC button controller. I want the button to react to single tap and double tap.
Single tap turns on the work lights (Brightening bench lighting to 100%, leaves the office lights on).
Double tap turns off the office lights and changes the bench lighting to blue.
By way of a virtual switch, I created two rules that will not allow the work light and blue light button presses to be on at the same time. so one on the other off. But I don't know how to create a rule that will cover if I just simply double tap (let's say) and turn off the blue lights. When both vs are off, I just want it to go to a default of 20% with the den lights on. But I also have to keep in mind that the lights will turn off when both vs are off and motion is inactive, Suggestions welcome.

I've read this post 5 or 6 times and I can't figure out what exactly you're trying to do...

I'm being thrown by "20% with the den lights on" -- where did the den lights come from? Office and Bench I get, but how did "den" get involved?

I'm seeing:
A button = single and double tap capable
Office = dimmable, not color
Bench = dimmable, color, blue for sure, but changes from ?? to blue
Den lights = ???
default of 20% = ? on what light? Office? Bench? or Den?

vs = virtual switch(s)
Motion? How did motion drop in :slight_smile:
the lights?? all three?

1 Like

Does Office = Den ??

Oh my gosh .. .sorry guys. I was off to bed when I wrote this because work started two hours early for me this morning.
I'll better explain ... my DEN has a WORKBENCH. So ... two osram strips labeled Workbench and the den light switch for the main lighting.
I have two Virtual switches on/off
VS - workbench
VS - Office Quiet

So the button is set up like this
Single tap toggle on and off workbench
double tap toggle on and off Office quiet

I can't post the rules because I'm not at home, but I'll explain what I haven't been able to make happen.
If I single tap for work lights and don't single tap again to turn off but, instead double tap for quiet lights then I want the quiet lights to activate (den light off, strips to blue). Work lights just adjusts the strips up to 100% white light. Den light then stays on. I would rather not have to cycle through the on/off at any given time to make that happen. I did create two rules that if the work light VS is on then the quiet light turns off and vise versa to that both switches can't be on at the same time. But, I'm having a difficult time getting the rules to work. i also have a rule that does not allow the lights to turn on if the quiet lights VS is on. If the quiet lights are on and I want it to go back to the normal non-bright default lights, then I would perform the tap of the current status. The rules are sending me all over. There has GOT to be an easier way to do this.
I hope this clarifies it a bit. It's so hard to explain. If I'm in quiet and tap to turn it off, then the lights won't go back to the default. Default being 20% led's with den switch on. The strips stay blue, but the den lights turn back on.

Can you just list out the different combinations you want to achieve? I think that would be easier to follow.

1 Like

Ok ... I just can't wrap my head around it. Let me think about this and post something later. I think I'm over complicating it because there are so many scenarios that I want to cover. I think that some rules can cover more than one task. Let me figure out how to put this into words that make sense when I'm sitting at my desk in my office/den. I'll do it in a way that will map each vision.

I'm just thinking what are your desired scenes. From your last description I'm only seeing 3: Work, Quiet, and Default. Let's take the interaction between them out for now and just simplify down to the combinations of light settings. Once we understand that, it will be easier to define how to change between them.

This is all in my den
Default - light switch on, two lightify strips on at 20%
Work - 2 lightify strips up to 100%, light switch on. Light switch does not turn off because VS worklights is on.
Quiet - 2 lightify stirps to 100%, color blue, light switch off. Light switch does not turn on becuaes vs quietlights is on.

Quiet is double tap - button is st up to toggle the vs on/off (quiet)
Work light is singel tap - button is set up to toggle the vs on/off (work)

If i don't cycle through like if work is on, and I don't turn it off before i single tap to turn on work lights, the strips might stay blue or the lights turn off with motion.

I created two rules that turn off the other VS if one turns on. so both VS's can't be on at the same time.

I just want it to run smoothly without having to cycle through. the off rule on false, each can be set to go back to default, but behavior has been not what I want. I'm positive that the normal on and off rules affect this, so I wrote in that if any of the vs's were on, not to perform on or off depending on which rule is triggering, but the behavior is still not all there. I can post all of the rules later, to clarify what's controlling them. It's become so complicated and there are a lot of rules. I think I could start over from scratch if that would make this effort successful.

Sounds to me like you are caught up in the way you approached it with virtual switches. By that, I'm not saying that you won't need virtual switches, but that you got stuck on thinking about it that way. A bit of the implementation tail wagging the design dog.

I echo what @destructure00 said in his post. You start out and end up in Default. One Tap to take you to Work, and a Double Tap to take you to Quiet. What to take you back to Default? You've got 3 states, so you need 3 distinct triggers (or sequencing).

1 Like

I LOVE IT! Haha! I set up the button to toggle on/off. So the button goes back to default state if you hit the active button press a second time. I ended up setting up the virtual switches because the rules for on and off kept triggering and changing the lights to the default setting. So those rules don't fire unless the virtual switches are off. So, yes. it's blown up into this blob of rules. Like patchwork. The original rule turns on the strip lights with the office light switch at the same time. But they turn off with different triggers. I really complicated it and now wrapping my head round this running smoothly is almost impossible because I can't get my brain to take a different path to solve this.

If you enumerate your 3 scenes (really 4 if you include off), you end up with 12 possible change scenarios:

Off -> Default
Off -> Quiet
Off -> Work
Default -> Off
Default -> Quiet
Default -> Work
Quiet -> Off
Quiet -> Default
Quiet -> Work
Work -> Off
Work -> Default
Work -> Quiet

Handling all of this solely with virtual switches would be overly complicated.

@bravenel would capture and restore settings in RM help with this at all? I haven't used them so I'm not sure how they work.

Maybe. Suppose you have a triggered rule triggered by a button press. Its condition tests Private Boolean (instead of using virtual switch). It's true part captures the light state, and sets a new light state, and flips Private Boolean. Then then next button press fires the false part, restores the previous state, and again flips Private Boolean. That allows one button to toggle between two conditions, without knowing what one of them is.

So, for example, Default to Work, and next push Work Back to Default. Or, same rule goes from Quiet to Work, and next push goes back to Quiet.

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.