Wait for Expression

The built-in device variable is normally set to the name of the triggering device, but if a timeout expires, it will be set to "timeout" (no quotes):

Typically, you would assign this to a "real" variable, which you can then use in conditions/expressions as needed. Here is one example: Rule to close garage door - #2 by bertabcd1234