Bug or how it should work? Trigger and stays with required expression

I saw some other post but they don't seem to address my situation.

Required expression: Switch is closed, in this case a garage door.

Trigger: outlet switches off and stays off for 2 hours.

Today about 15 minutes before the 2 hours was up the GDO was opened and the log showed the required expression was then false. When the time expired on the stays, however, even though the required expression was false the rule still triggered.

Apparently the required expression only pertains to the initial trigger and the upcoming event is not cancelled. I assumed it should be but apparently not. So is it working as expected or do I need to re-think my rule?

FWIW, It's best to show a screen cap of your full rule so folks can give the best advice and not misunderstand anything. :slight_smile:

Assuming it is as simple as below:

  1. Required expression: Garage door is closed.
  2. Trigger: outlet turns off and stays off for 2 hours.
  3. Action: Turn on some switch

If so, I believe since the rule was already triggered that changing the state of the required expression doesn't stop it from completing. I did a quick test w/a similar rule like above, and the light does turn on even if the contact in the required expression is opened before 10s is over. Oops - here comes Bruce...he'll have what you need before I can type it. :slight_smile:

No, the rule didn't "trigger", it was running out the 2 hour clock. You can prevent that by selecting the option in Required Expression to Cancel Pending Actions:

Screen Shot 2022-10-14 at 12.18.47 PM

Without that option Required Expression only affects Triggers, not things pending. With it, anything pending is cancelled.

I see your point, as in effect that's a delayed trigger. I will look at that, and see if it should actually not trigger in this circumstance. I can tell without looking that what happened is the initial triggering event checked the Required Expression, but the subsequent after 'stays' did not. Perhaps it should.

In the meantime, it can be forced to work with that option.

I've looked at this, and I do think it is a bug. It should check to see if the Required Expression is false at the end of the stays time, and only trigger if it is true. That fix will be in the next release.

2 Likes

Fix has been released: Release 2.3.3 Available - #12 by bravenel

1 Like

Works as expected w/the update in my test rule I posted above, FWIW. Opened the contact during the 10s countdown after the trigger light was turned off, and the rule's action was not executed.

1 Like

I think it needs better logging for this case. Will add that for the next release.

2 Likes

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