Feature Request - Run when Required expression becomes true

@bravenel, would it be possible to have a toggle in Required expression that would make the rule run at the moment when the required expression becomes true?

Here’s a use case:

A rule needs to set a fan’s speed depending on the temperature difference between two sensors. The rule should run when the temperature changes, but only if it the fan already on.

Setting a required expression where the fan needs to be on will ensure the rule only runs when the fan is on. However, when it is turned on, the speed will not have been set properly. (From what I could see, if fan - “On” is set as a trigger, it doesn’t pick it up since required condition was false before the change.)

Thanks!

1 Like

This would completely change the meaning of Required Expression. Perhaps you're mis-thinking it.

Why don't you just include a Conditional Action in the rule instead of using Required Expression? Or some other approach? Sounds like the speed logic should be where you turn the fan on.

Or run the actions of this rule from the rule that turns on the fan, leaving the Required Expression as is. Or there is a simple rule that's triggered by the fan turning on, and it runs the actions of this rule. Don't know how you've set things up, but you don't need a feature to do what you need.

1 Like

Thanks for your response. I agree - these are all valid options - I previously had a conditional option that would exit the rule when the fan was off. And I could also have a separate rule that triggers on the fan turning on which runs this rule.

The “Cancel pending actions when Required expression becomes false” toggle made me think of this as a potentially useful and simple (to the user) option to have available.

These two ideas are completely unrelated! That option extends the implied restriction of the Required Expression beyond just the trigger events. This was needed in order to support the concept of Restrictions available in Basic Rule and Simple Automation Rule for their importation into Rule 5.1.

What you're describing negates the concept of a Required Expression, and turns it into a trigger event. I'm sorry, but that makes no sense, and as I said, you simply need to rethink how you're doing things in this case; it's not a legitimate "need" for a feature, just lazy thinking.