Using any button event as a trigger

I have an ERIA button device with four buttons. Each button has a pushed, held, and released event. I want to use this device to control my hallway dimmer. I have a global variable in Rule Machine to set the intensity based on the current mode and time of day. The Button Controller App does not let me use this global variable, so I want to define the actions in Rule Machine instead of Button Controller. Press and Held of every button needs to be a trigger for the rule. In trying to set this up, there does not appear to be a way to have any change on any button be a trigger. The only thing I can figure out is to have eight "OR" statement (4 buttons with push and held each). Does any know a more simple way of doing this?

There are two ways to do this with Rule Machine, and I think this first way is exactly what you've discovered:

  1. Configure multiple trigger events with type "Button," one for each button number and event name (pushed, held, doubleTapped, or released). You can (really, have to) then use the same set of actions for all of these triggers.

But note that this will cause the actions to run when any event happens that matches a trigger. And unlike with many events, it would be difficult to use an IF in the actions to determine what event just happened given that it won't always result in a specific state (like you could with, say, "motion changed" and do an IF for "motion active" or "motion inactive"--doesn't really work for button event). I'm not sure this is what you want.

Or:

  1. Choose the "Button Device" trigger, and you'll get separate actions for each combination of the above. This is what most people probably do for buttons, and it's nearly identical to Button Controller. (The only downside is that if you want button 1 pushed and button 1 held, for example, to do the same, then you'll have to define the actions for each number and event name combination individually--but that's the same as Button Controller).

I'm assuming you may have intended to do the second rather than the first, though either can work (just not in exactly the same way).

1 Like

I just figured this out tonight and it might help.

For the "Trigger Events" add all the combinations of press, hold, etc for each of your buttons. ( as bertabcd1234 just suggested)

Select Trigger Events (ANY will trigger)

Device#1 button 1 pushed
Device#1 button 1 held
Device#1 button 2 pushed
Device#2 button held

Then do IF/else statements in your rules (within each IF/else statement you can have a nested AND for the mode & button#/action). In the example below you could add something like "AND Device #1 button 1 pushed" before the "ON".

IF (Mode is Dawn(F) [FALSE]
AND Device 1 Button 2 pushed) THEN
On: Kitchen - Relax
ELSE-IF (Mode is Dusk(F) [FALSE]) THEN
On: Kitchen - Bright
ELSE-IF (Mode is Evening(T) [TRUE]) THEN
On: Kitchen - Relax
ELSE-IF (Mode is Night(F) [FALSE]) THEN
On: Kitchen - Night
END-IF

Here is a link to the screenshot of the one I setup (just joined and can't upload images yet).

tinyurl (dot) com (forwardslash) hubitat-button-logic

I think you only get pushed on the Eria for buttons 1 & 4 because held is used for pairing/reset or something. I've had mine for months and can't remember exactly where I read that and the manual is loooooong gone. I have a new one coming Monday (with a user manual hopefully) and will look there.

Thanks everyone @bertabcd1234 and @steveb4455.

I have some rules trigger by the change in a global variable or mode. The trigger for these look like:

Variable report VARIABLE_NAME(current value) changed
and
Mode becomes changed

I was looking for something similar to this with buttons. It sounds like for buttons, I to chose between one very long trigger which will be mostly repeated in the action section, or several rules, each with a simple trigger and only the actions for that trigger.

@stephen_nutt, I have noticed that buttons 1 and 4 report only pushed. I did not know why, but I bet your are right on pairing.

Amazon came through early & my Eria Dimmer arrived a few minutes ago. Button 1 held does the Touchlink pairing directly to bulbs and Button 4 held pairs to the Zigbee hub so I assume both unavailable for our use.

Well, it turns out I was doing something not smart. I will share incase it helps someone else. This may be common knowledge, but I still have lots to learn.

I started my button rule with an existing motion sensor rule. For some lucking reason I can not recall, I decided to scratched the existing rule and start fresh. As soon as I selected a button device trigger in a new rule, the UI gave me the button layout like I had seen in the Button Controller App. This made writing the new rule as easy as using the Button Controller App and permitted me to use my global variable. All went well from that point.

An I missing something in this? I have a very similar automation I'm trying to setup but if I use a button for the trigger, it removes the option for a button to be an action.