'variables' use in triggers

Is there a way to use a variable in triggers for "Motion sensor active and stays for " .. rather than a constant ?

Rule machine should be able to as a required expression then use the variable as a trigger. At least that's what it looks like to me. Whats the use case?

You’d like to use a trigger such as:

“Motion sensor active and stays active for %variable% minutes”?

If so, not as far as I can see.

Variable substitution is possible in actions, but apparently not in triggers.

1 Like

Yeah.. that's what I was seeing..

i wonder why it is not possible to variable substitution in triggers!

My use case is..
I have multiple sensors.. and i have 3 time variables, low-time, medium time and long time..

For some sensors, i want the motion triggers sensor to stay active for low time, some are medium and some long.. (in different rules)

And then in action, i want to use the same corresponding variable ..
The main thing is the low time value is different based on whether system Is armed or not and or whether I am working from home or not (a switch named WFH is on or not)

So if a contact sensor or motion sensor remains active for 30 seconds (armed) or 90 seconds (disarmed) .. different things happen..

So i don't want to trigger if system is armed and motion stops in 35 seconds.. only if the motion is more than 90 seconds

Another completely different use case is to see if any contact sensor(door) has been open for 5 minutes, when disarmed , or 30 seconds when armed away.. so i can come back and close the door and then leave.. and i have to drive back only 30 seconds and not 5 minutes..

Maybe @bravenel could consider it in one of the future updates of RM..

1 Like

I've tried to request a similar thing:

Download the Hubitat app