Check for Condition After Wait Question

Can I get some suggestions on the correct way to implement a set of “safety” rules for opening/closing the Garage door please? My code is shown below, and I can’t seem to work out the syntax/details of the IF condition marked as “What is the condition here???” How can I check that the button was pushed?

Does using the Button as a trigger cause this app to be triggered multiple times (e.g., recursively?, circularly?) ... which doesn't seem like a good idea.

Trigger: Garage Door Open/Close button 3 pushed
Actions for Garage Door Open/Close
// Pause to avoid a rapid double-push 
Delay 0:00:01

// Send Warning to Dashboard
Set GarageWarnText to 'WARNING: Press again (with 2-secs) to Close or Open Door '

// Wait for the next button push within 2-seconds
Wait for event: Garage Door Open/Close button 3 pushed
 --> timeout: 0:00:02

// If a button push occurs within 2 seconds then open/close the door, otherwise abort
IF (Garage Door Open/Close button 3 = Pushed [What is the condition here???]) THEN
	// Activate Garage Door Switch/Relay
	On: K-Z10 Garage Door Open Close SR
	Delay 0:00:02
	Off: K-Z10 Garage Door Open Close SR
	Set GarageWarnText to 'Garage Door is ??? '

Can you post an actual screen shot of the rule? Easier to follow...

Yes. But this can be avoided by using the built-in variable "private boolean." Here's a kind of clumsy example:

It sounds like you are looking for the fact that the %device% variable gets set to timeout if the timeout expired. See the "Wait for events" section in the Rule 5.1 docs for a bit more:

Or, to summarize, you'll need to set a local (or hub) string variable to %device% since you can't use %device% directly in a condition. Then you can use the value of this variable in a condition, specifically by checking whether it is equal to "timeout" or not.


bertabcd1234 ... Thanks for the rapid responses ... Do You ever sleep? :grinning:

I'll cogitate on your responses and report back. BTW ... I have read the RM documentation a few times. But there are still some (plenty of?) things that I am still trying to understand.

Update report on my Garage Door Opener RM ... no change from my side as yet. Still not forgotten though. Still cogitating :thinking:

In the meantime my Hubitat/Konnected alarm system has gone live! Computer and Android control working well. Fire 7 Tablet control development ongoing.

1 Like

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