Hello. I have a Zooz remote button switch I currently use to turn my living room lights on, off or to run a routine (if held down). I'd prefer to have the switch do the following:
- If button pressed up and current bulb brightness is 75% to 99%, increase to 100%
- If button pressed up and current bulb brightness is 50% to 75%, increase to 75%
- If button pressed up and current bulb brightness is 25% to 49%, increase to 50%
- If button pressed up and current bulb brightness is 0% to 24%, increase to 25%
- If button pressed down and current bulb brightness is 1% to 25%, decrease to 0%
- If button pressed down and current bulb brightness is 26% to 50%, decrease to 25%
- If button pressed down and current bulb brightness is 51% to 75%, decrease to 50%
- If button pressed down and current bulb brightness is 76% to 100%, decrease to 75%
Is there an easy way to do this without making eight seperate actions? I'm thinking it would be something similar to a Switch statement in C or any other programming language.
First, to get different actions with a tap (or hold or whatever) up versus down, which will likely be different button numbers depending on your driver, I would recommend starting with the Button Controller app instead of Rule Machine. They are quite similar, except Button Controller makes it easy to do different actions based on button event "triggers" without needing to create them yourself in Rule Machine. This also eliminates issues arising from needing to differentiate events (pushed, held, etc.) or button numbers inside your rule actions, which you'd need if they were all in the same rule. You could make two rules to make that part easier, but Button Controller would do something similar while at least keeping them together.
That being said...
In your actions (with either app, but I'd recommend Button Controller), you can do what you want using conditional actions, e.g., IF THEN
s. Here is what you described for the first four items:
You can probably figure out the pattern and apply it to your second Button Rule for the tap in the other direction.
Finally, while you didn't directly ask for this, your Zooz remote should also support "held" and "released" events for both up and down directions. You could use the held event with the "Start raising/lowering dimmers" action and the "released" event with "Stop changing dimmer" action, and then you'd get smooth dimming up/down just like you would from most real in-wall dimmers, even though this is a remote. If you prefer the other approach because you get an easy way to reach specific levels, that's fine too -- or you could combine these (if you aren't using held for anything else) since there are different events involved and no conflicts there.
Just wanted to followup and say I got this working after a bit of head scratching. Apparently, you cannot use the else button at the bottom of the button controller logic, you must click on the plus button and add an else condition.
Thanks for the help.