'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:

similar question, i am posting values to be logged externally, on change, such as:
http://somewebsite.com/collectdata.php?device=%device%&value=%value%&time=%now%
so if a temperature change occurs it sends the device name and its value.

However, the device has more than one (child?) parameter (temperature, humidity)
How do i get the parameter name into the equation. I have tried:

  • %parameter%
  • %type%
  • %name%
  • %child%
  • %humidity%
  • %temperature%

but these all transpire as "null" so i know of no way to notify what parameter the value received is related to. There must be a list of legal variables somewhere, but, like a few others, unable to find this documentation.

thanks