Using a button on Zen32 keypad, to raise and lower dim levels on

I am totally new to the hub and catching up on programing. I was looking at the Rule machine, trying to figure out how to press and hold a button to raise or lower the dim level of a switch, and the stop when I release the button.

Someone had said to use the button held as "start level change" but I don't see that particular option. in the dropdown. I do see the "stop level change" that can be applied to the released, but not sure how to make it all work. I'm trying to find an example online of the rules.

The devices you are trying to manipulate in the rule ultimately need to support the "Start Level Change" and "Stop Level Change" commands. You'd check their device page for that. However, to run these commands from Rule Machine, you can create an rule action from Set Dimmers and Bulbs > Start raising dimmer level (or "Start lowering...") or Set Dimmers and Bulbs > Stop changing dimmer level. These actions in RM ultimately run these commands on the device. You shouldn't really see "startLevelChange" in the RM UI at all unless you ventured into custom commands, which you certainly could do but don't need to for these since they can be run as part of standard actions.

Also, since you're new to Rule Machine, I'm not sure how you have this rule set up, but it's worth noting a point that often confuses people: you almost always want to use the "Button Device" trigger type, which will give you separate actions sections for each button. You could then do the "Start raising dimmer level" action on, for example, button 1 held, and the "Stop hanging dimmer level" action on button 1 released. Do not use the similarly-named "Button" trigger, where this is not really possible to do in the same rule like you can with "Button Device."

Thanks for your reply. I see these options under the button device, which I quickly figured out that I want to use. It shows me more buttons then I seem to have on a 5 button Zen32 keypad.

For the held option, I see "Start raising dimmer level"

But how would I set it up, that pressing and holding it, would go up or down, vs. just raising?

I see a few other choices, like the Start Lowering dimmer level. I'm trying to emulate a 3 way dimming scenario, where I don't have a second switch to do so, only the keypad. Would this be Toggle Dimmer level?

"Toggle dimmer level" will turn the device on to the specified level if it's currently off, otherwise it wll turn it on. What you want is "Start raising dimmer level" (which will simulate holding or turning up on a "dumb" dimmer) or "Start lowering dimmer level" (which will simulate the reverse, lowering the level). I think that answers your question. You would want to run either of these actions when you hold the ZEN32 button. On release of the same button, you'll want to run the "Stop changing dimmer level" action so the fade up/down stops, just like it would if you let go of a "dumb" dimmer.

If you want a hold ("press and hold," if you will, but you won't get a separate "pushed" event--just "held" and then "released" if you truly hold the button, otherwise just "pushed" if you tap it) to either raise or lower the level, you'll have to implement some logic to do that yourself. How would it know when to do what? If you have a way to do that, you can implement that logic in your rule actions. For example, one of your "button held" actions sections could do something like:

IF (Bulb level > 90) THEN
  Start lowering dimmer level: Bulb 1
ELSE
  Start raising dimmer level: Bulb 1
END-IF

But if you ask me, that's going to get confusing. The device has tons of buttons (and button events), so I'd probably just pick one to raise and one to lower. :slight_smile: But, of course, anything is possible if you can write it...