Passing an expression defined "variable" to "Condition must be sustained for"

Hi Patrick!

I’ve been using the trick you showed me, where I can make use of the expressions section of a reactor sensor to assign a variable which I can then make use of in conditions logic that reference that variable.

ex: have an expression defining {Off-Delay} = 300 seconds
then in logic, compare something like device state > {Off-Delay}

I have a few Reactor sensors that I’ve setup to Turn off lights after a set period of time has lapsed, (if people leave lights on during the day when they aren’t supposed to be on). I use the “Condition must be sustained for” Restriction to accomplish this.

is there a way of using this expression defined variable in the “Condition must be sustained for” section?

I tried setting an expression of: {Off-Delay} = 5 mins in a reactor sensor, and I can reference it within conventional conditions logic of the reactor sensor, but it doesn’t work if I try to put {Off-Delay} as an argument in the “Condition must be sustained for” section. :frowning:

Is there a way to make this work? or is the “Condition must be sustained for” restricted to a numerical value only?

Also, If there is a way to make this work… can I also refer to this expression variable from other reactor sensors as well?

Right now the options do not support variable references. That is doable, but a fairly aggressive change to undertake for the current version. I’ll commit to doing it for the next version, though.

1 Like

No worries! Definitely nothing urgent. :slight_smile: Thanks for validating my current thought process !