Conditional timed trigger does not work as expected

My app triggers when it is not supposed to. I have this entry in the log:

2023-10-13 07:35:17.911 AMinfoTriggered: Garage door(on) turns on and stayed that way for: 0:10:00 - ONLY IF(NOT Time between Sunrise(7:06 AM) and Sunset(6:23 PM) TRUE)

The conditional triggers do not work even with non-inverted conditions.

The hub version is: Version 5.1.5 (6/27/2023)

A couple of things....

Which app are you using for your automation? Are you using Rule Machine? Or something else?

Regardless of the app you are using, I would suggest posting some screenshots of the App setup, to display how you have setup the automation.

When you say "hub version", looking at the version number you quote, I am thinking that is the version of the app you are using, like Rule Machine, which is fine, just wanting to confirm where you have sourced this from. Again, screenshots are always useful to provide context in situations like this.

Thank you @sburke781 for the lighting fast reply!

I am using Rule Machine.

Here is a screenshot of the app:

You will notice that in the app the condition is correctly shown as "FALSE". But if I open the garage door and wait 10 minutes, the app will trigger and in the logs the condition will be "TRUE" when it is not supposed to be.

1 Like

Ah, I think I see what may be happening....

The simple explanation is that the conditions are just a list of conditions available to use...

I attached it to the trigger though:
app

Good point...

Yep, that should not trigger from all I can see, not that I am an expert...

The other point to my post earlier was to confirm the platform version, thinking the 5.15 you were quoting originally was likely the RM version, which is fine, but the platform version is likely more useful to others,

Platform:

I thought conditional triggers sounded cool at first (and I'm glad they exist as an option), but I haven't figured out a use case for them for me yet...

If this was my rule, I'd just use the SS-SR condition as a plain Reqd Expression instead of tying it directly to the trigger.

Maybe worth a try?

2 Likes

I installed a new test app using "Required Expression" as @hydro311 suggested and it works great.

Thank you so much!

3 Likes

Hmmm... I'm confused... But happy... Nice work @hydro311 and @user6883 .... @bravenel ????

Good deal! Yeah, Req'd expressions are nice because if they are false, the hub doesn't even bother looking for the trigger event.

I'm still struggling to think of cases where a conditional trigger is useful, but I'm sure they exist... I'm guessing in rules where there are multiple triggers - I suppose that could make sense.

But I myself avoid making multiple-trigger rules -- I learned long ago to KISS with rules -- I think it's better to have several smaller/lighter rules than trying to cram stuff into one larger/clunkier rule. Both options are fine, but the bigger a rule gets, the harder it is to keep optimized.

1 Like

But it still doesn't make any sense why it triggered...

1 Like

Am I reading this wrong? At 7:35 AM the NOT expression appears to show TRUE in that log entry.
Any clarification ?
May need () to group??

No, you are reading it right, it doesn't make sense to me either... although I started out this post by thinking you had spotted the key to the puzzle I had missed, but... sadly no.... you also noticed the glaring issue...

That said, I think I get what you mean now, the two parts to the condition need brackets but cannot have then surrounding the two conditions... Well spotted...

Just created equivalent rule and it works perfectly fine.

It shows TRUE. But "NOT (time between 7:06am and 6:23PM)" should be FALSE when time == 7:45am.

I will look into this...

OK, I set up a Condition just like yours with NOT, and just tested it. The trigger did not fire, which is the expected result.

You never showed us the logs for this. Screenshot of the logs with it failing would be good.

My trigger is this:

4 Likes