Feature Request - Add triggers for "drops below" and "rises above"

I would like to be able to trigger a rule in RM when the illuminance either drops below or rises above a certain value. I currently use the decreases and increases triggers, but it causes undesired changes.

I've combined the decreases trigger with an if statement to get my living room lights turn on when outside illuminance drops below 795. The problem is, sometimes I want to turn off one of the lights to watch a movie, but when my illuminance sensor updates (every two minutes) while it's still getting dark out, the rule runs again and turns the light back on.

This is already available; use:
<, >, =<, or >=
in your trigger instead of increases or decreases.

Lots of ways to address this:

One simple way would be to check the value of a Private Boolean for this rule as the first action. And then to proceed only if the PB is true.

Then, whenever you start your "movie mode", set the PB for this rule to be false. Turn it back to true when you're done with "movie mode".


Note that this will still trigger on any event that matches the value (less than whatever, etc.), not just the first. But...

This use case is exactly one of the things the "required expression" feature introduced a couple versions ago is designed to handle. For example, this configuration:

Required expression: Illuminance < 50

Trigger: Illumance >= 50

...will triggger only when the lux reading rises above 50. Of course, this works most easily when it's your only trigger, so if you have others that could affect this, you may need to split this particular thing out into another rule somehow or use a different method, like Private Boolean (described above, assuming an actual trigger isn't a problem for you--keeping in mind retriggers cancel waits, etc.). Otherwise, this is a pretty easy case.


Thanks @bertabcd1234, this fixes it.

I turn off the light to get to "movie mode" using an Alexa routine, so it'd be several more steps to get that info into a private boolean in Hubitat.

Since there's no explanation, I'm not sure what that screenshot is trying to say. However, if it's being proposed as a solution to trigger only when the lux reading drops below 100, it will not work; it will trigger on any event that matches that criterion, including both the first and any subsequent readings below 100. I mentioned this in my first reply.

The solution I proposed above, using a required expression, is the easiest way to make this happen instead (state transitions were a specific use case this feature was added for), and the OP appears to already be using it successfully.


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