Run a rule when a variable has been a value for so many seconds?

I use RadioRA2 keypads and I was trying to create functionality where a double press on a keypad button triggers something else. I did this by creating a variable for the button, and another rule stating whenever the button is pressed, increase that variable by 1. I then have another rule saying when that variable hits 2, run my scene/rule I want, and then set the variable to 0 again.

This works great, but I need to create a rule to account for the cases where the button is only pressed once. Is it possible to do this in Hubitat? I'm basically looking for a trigger that does the following:

  • If variable "door_keypad3" has been = "1" for at least 3 seconds,

So that I can then have the action be to set the variable back to 0? Basically meaning the user has to press the button twice within 3 seconds to trigger the rule.

Edit: I can't delete but I think I figured it out by just creating a rule that says whenever the variable is greater than 0 to then set the variable to 0 but with a delay of 2 seconds. Seems to be working great.

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