Toggle Scene Then Return to Mode-Set Lighting

I want to press a button to have my office lights change to a dimmed-scene then when the button is pressed again, change back to the Mode driven scene that should happen automatically throughout the day.

Background:
I have a Peloton next to my desk so the lighting condition for working out is very different than working at my desk. I have several Hue bulbs connected through a Hue Bridge in the office which I have the light temp set to change throughout the day. When I want to ride, I need the lights to dim so I don't get glare on the Peloton's screen.

I can get a button to active the Dimmed-Scene but I can only get the second press either to do nothing or turn the lights.

OK, so after a lot trial and error, this seems to be working... So the new question becomes, is this correct? Am I using the Else-If correctly?

I have a separate simple automation for when the switch is flipped to On.

I'm not sure you want the first "Activate Scenes: Peloton Time", that would be immediately overridden by the options in the IF-THEN-ELSE statements below. Aside from that, the IF-THEN-ELSE structure looks fine, though you might consider in this case to choose the Acitvate scenes per mode and just have one action, here's an example from my own setup:

I think from your original post you may have struck some similar issues to me, I am in the process of moving my lighting across to being directly connected to my new C-7 hub, rather than my Hue Bridge.
I tried using Motion / Mode lighting rather than RM, but struck issues when trying to have manual overrides when using buttons / switches, etc. I'm now using RM rules instead.

Thanks @sburke781!

Your way is much cleaner and faster to build.

Would you suggest I keep the Peloton ON scene as a separate Simple Rule or include it someone (maybe an Else-IF) in this RM Rule? I'm still learning how to use Hubitat so I'm yet to figure out best practices on automation.

1 Like

No worries, I'll take a look later today and let you know what I think

In this case I think it is cleaner to keep it in the same rule.

Change the trigger to be Peloton Switch "changed" and put an IF condition at the beginning to say if Peloton Switch is on, activate scene Peloton Time, else activate scenes per mode like my last screenshot.

OK Done! It works and thank you for the help!

Though, in my clicking to edit things the IF Off is first. It shouldn't matter which one is first right? Is it an etiquette thing for cleaner "code" to do the On first or does it matter at all?

1 Like

I don't think it would matter which one is first, though a final screenshot of your rule would probably help to be 100% sure.

I have been caught out with IF conditions in one or two rules where I was trying to update a variable but I suspect it was user error and not relevant here.

Screenshot attached. Thanks so much for all the help!

1 Like