It would be really nice to have trigger conditions that remember the previous state of the trigger value, and can trigger a rule when a threshold is crossed.
For example, I currently have rules to open and close my blinds when the illuminance reading on a sensor goes above or below a given threshold:
Currently, the only trigger that works is to trigger the rule every time the illuminance reading changes. Since the sensor reports every 5 minutes, this means that the rule runs every 5 minutes. To get the behavior I want I have to keep track of the previous illuminance value in a variable.
It would be very convenient if I could define triggers like "Illuminance of Upstairs Window Multisensor rises above 400" and "Illuminance of Upstairs Window Multisensor drops below 400" so I don't have to keep track of the previous reading explicitly within the rule logic.
As far as I can tell, "becomes" is just bad wording on those triggers. It's really "is". The rule will trigger each time the sensor reports a value as long as that value is greater than the target. That's not what I want. I want it to trigger once, when the value transitions from less than the target to greater, and not trigger again until the value drops back below the target.
The Illuminance device IS sending a report. Every 5 mins. Hiding the compare doesn't change the work the hub has to do. You do it in the Rule or the Hub does it 'under the covers' -- I don't see what is gained by burying the event handing.
@csteele It doesn't change the work the hub has to do. I picked a simple example, but I have rules where hiding the state in the trigger would make them much easier to read and reason about.
@aaiyar That's fairly similar to the private variable approach I'm using. The early-return is a bit nicer than the if conditions I have though.