How to detect repeated (same) Button Push in Rule Machine?

Seems kinda basic, but searching the Forum for answers led me nowhere...

I'm wondering how best to trigger an RM rule a 2nd, 3rd, etc. time in response to subsequent presses of the same button on a Virtual Button device. The rule triggers as expect when, say, Button 1 gets pressed, so long as it wasn't the last button pressed.

EXAMPLE
RM Trigger: IF (Button 1 = Pressed) THEN ... do things
User presses Button 2, rule remains dormant.
User pressed Button 1, rule fires.
User presses Button 1 again, rule stays dormant.

I have a number of workarounds in mind that could be employed to force this setup to work, but I'd very much like to keep things as simple as possible.

Curious to hear how others have approached this scenario.

Should we modify the Virtual Button device driver, to include a new attribute that gets modified (like a timestamp) each and every time a button gets pressed? And/or expose "Last Activity" as a custom attribute that RM can use as Trigger?

THANKS - Libra

If you want to trigger on every button push (or whatever event) for a specific button number, this is exactly what the "Button" trigger type already does:

This is a bit easier to set up in Button Controller (an app built for this purpose) instead if you have lots of buttons on one device, assuming you don't need any RM-only features, but if none of that applies, either way really works.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.