Bug: Rule Machine with multiple timed triggers (using OR) does not trigger correctly

Hi, I am unsure where to report this issue.

This appears to have been raised in 2019 for Rule Machine 4 but there is still an issue occurring in the newest Rule Machine 5.1.

I am using a C-7 hub, running version: 2.4.0.150.

This is the Rule I created. I've labelled the triggers 1, 2 & 3 for convenience:

When looking in the logs, the rule starts the countdown for trigger 2 and trigger 3 but trigger 2 "restarts" it's countdown multiple times without triggering when it should.

There are no "Not triggered" entries for trigger 2 which is correct, but it doesn't trigger.
All the "Not triggered" entries are for trigger 3, and they are correct.

The rule finally executes on trigger 2 @9:40AM, 22 minutes late despite all conditions in reality being met multiple times prior.

Here are the logs. Note the multiple countdowns for trigger 2 which all seem to "fail" and do nothing:

Could staff please look into this?

Thanks!

Yes, but you must post logs as screenshots.

Hi @bravenel I have included a screenshot of the rule and pasted in the logs.

What additional information do you need? Do the logs need to be in a different format?

Thanks

Yeah, those are unreadable. Post a screenshot instead.

Got it! grabbing screenshots.

@bravenel I've updated the original post with a screenshot of the logs. Thank you.

Hmm, something is definitely not quite right here.
So, the finger lime sensor is a member of all three triggers, two of which (triggers 2 and 3) are using “and stays for”.
It looks like every time the lime temp reports within the range of trigger 2, it properly starts the 5 minute timer for that trigger. But, before the 5 minutes are up, one of the other sensors that are members of trigger 3 sends an event with a temp that is out of range of the trigger 3 condition and that then causes the “not triggered” event to show in the logs for trigger 3. That event seems to cancel the active “and stays” timer for trigger 2. Seems like RM is a little bit confused. Sorry, can’t help you with that.

But, I was thinking about a potential workaround. In the required expression add “AND finger lime sensor temp >= 5”

Then remove the finger lime sensor from trigger 3 because the required expression takes care of that bit of trigger 3.

Now that the finger lime sensor is only a member of one trigger with a stays condition, does it work better?

1 Like

This appears to be a bug just in the logging text. I will track that down.

5 Likes

Yes that happened after I changed the rule and deleted one of the triggers. That is separate from the first issue.

After I re-edited the rule a third time, it seems to have gone away.

Thanks

1 Like

Thanks @mattias. I do have a work around already - in this particular example I could easily just split it into separate rules. But I'd prefer if the function actually worked correctly - especially for other rules. The fingerlime temperature trigger had the all the right conditions to trigger, so Rule Machine should be made to work correctly.

Please post the rule as it is now.

The rule is the same as I posted. I have not changed it and it behaved the same this morning as it did yesterday. I have just now disabled it.

Oh I just realized I did change the required expression value from 0C to 0.4C. But that was working just fine previously and is unrelated to the bug I am reporting.

Thanks

RM won't track two different Stays for the same event, nor is there any guarantee as to which of multiple triggers actually triggers the rule (first one does). So, for a temp value that is both > 5.0 and in [7.0 .. 9.9], either trigger may fire, and the corresponding stays timer started. RM does not support multiple simultaneous Stays timers.

You would have to split this into multiple rules; all but one could run the actions of another. This just so you can separate the stays timers.

4 Likes

Ok, thanks - so this is not a bug and just an unsupported feature? I have split all the rules out this morning. Just makes a bit of a mess with all the multiple rules.

If we could add this as a feature request that would be nice.

Yeah. I'm going to look into preventing multiple triggers with Stays selected, as in, not offering Stays once there is one.

3 Likes

Thanks. yes the GUI doesn't make this clear and readily allows them.

First step: fix the bug identified above.
Second step: fix the app to allow multiple Stays triggers.

First step coming soon, second tbd...

5 Likes

Did you mean disallow ?

Same applies to Wait for Events ?

No, I meant allow.

Yes, if they have Stays elements.

RM does not have multiple simultaneous Stays timers.... Which pretty much means you can't expect multiple simultaneous Stays to work as you might expect. Step 2 is an investigation into allowing this.

5 Likes