OK, I’ve been struggling with an automation that I knew was going to be a challenge. The funny thing is, the end result is quite basic and simple, but it’s sort of overwhelmed me trying to figure it out.
Here’s the basics:
- I have an RGB Hue bulb
- I have a quad button MOES zigbee controller that can trigger automations
The quad controller is labeled “Bright” on button 1, “Dim” on button 2, and “Blue” on button 3.
For the bulb, brightness of 130 is bright, 17 is dim, and 120 is blue. I figured that’s enough to figure out what the current state is.
Desired operations:
If the light is OFF, activate the appropriate scene based on the button. This part is easy.
If the light is ON, activate the scene if it’s DIFFERENT than the current scene. In other words:
If the lamp is bright, and button 2 is pressed, make it dim
If the lamp is bright, and button 3 is pressed, make it blue
And if the lamp is bright, and button 1 is pressed (bright) then turn it off. Basically a toggle.
And so on for the other buttons too.
Here’s the logic I have been trying:
For activating scenes if the bulb is off, that’s done and easy (choose based on a template ID).
If the bulb is on:
If button 1 is pressed, check the brightness and if it’s 130 (bright) then turn the light off
If button 2 is pressed, and the brightness is NOT 17 then set the “dim” scene
if button 3 is pressed, and the brightness is NOT 120 then set the “blue” scene
and so on… but this seems like a bad way to do this (?)
I think it’s just a logic thing but it’s not coming to me at the moment. If the above is right, then I am a little stuck on how to actually check the brightness value.
Do I use a “numeric_state” somehow, or a template? And what’s with the “above” and “below” but no “equals”? Maybe a template can be used to match a brightness value exactly?
I’ve been looking at templates but it’s unclear to me what I need to do to use the brightness as a condition to decide what to do.
Thanks for any advice here!
Dennis