When do required expressions run

@bravenel noticed a number of times recently when required expressions are false and blocking the trigger when they should be true.

If I open the app it will re define the expression and go true.

So the question is what should make it re evaluate normally?

Isn’t it similar to triggers, ie there should be related event registrations/ schedules in the app settings ?

Could this not being checked be the explanation?

image

Any of the events related to the expression's conditions will cause it to be evaluated. Look at the Event Subscriptions, and see if they cover those cases. Also, have all logging on, as the events that cause evaluation of the Required Expression will be logged.

1 Like

This is what I thought but was not happening.

Tried both but think that does what it says on the tin

Will do, I'm sure I already did and with logging and still saw the same but I'll confirm.

You will have to show logs and the rule.

here is a odd one


it ran but logs show it was false

Hmmm. I will look into this. I imagine that the scheduling that happens upon Update does not look at the current state of the Required Expression, and not doing triggers when Required Expression is false relies on the triggers having been removed when it becomes false.

I am not able to reproduce this. I get identical logs to yours, but there it no Scheduled Job, nor even an Event Subscription to the variable time. So it can't possibly trigger at that time.

So, I don't know what happened. Is this repeatable for you?

I'm sure I see it each time in other rules as well as this so yes.

So your saying your rule didn't run at all? But you got the same log?

Mine ran as the logs said it just said it was false when it was not. Going to check the logs today as it should now BE false and should NOT run today.

However what I have seen in the past with this rule is it then ran! Then once I opened up the rule again it then corrected reverted to false.

Edit:
Unfortunately like a idiot in my sleep deprived state I A opened the rule last night and be turned off the logging so I have to start again.

So things I have noticed on a rule like this in the past.

A when the date it changed (BTW I change the two HV with a dashboard HV) the rule never fired because the expression never became true.

B it does run like the logs show but it says it's false. (Maybe just a UI thing)

C after B the next day I I don't touch the rule it will run again when the dates don't match because it hasn't re evaluated the required expression and the trigger time then runs.

Maybe need to do just a trigger time variable with variable date.

What "says it's false"? Was it the logs said it was false, but it was actually true? Or are you talking about the app UI saying it is false?

This

blank???

Says false in the logs when true

Maybe some problem when Update is hit. I'll poke at that code...

1 Like

this seems odd but maybe not.

the ones without the time are when i had "display current values" turned off in the app

the ones with the time i turned it on. Should that have made a difference to the logs?

the logs are me changing the HV energy start date so its "working" correctly it seems here. However i would have thought it would show in the logs if the expression is going true and false?

where as it just seems to be setting up the trigger either way even if the expression works out to be true or false.

Yes, the logs are using whatever would show in the UI of the rule.

If Events is enabled in Logging, it will show the Required Expression changes.

Well, don't have super x-ray vision, so show the rule in question and turn on all of the logging for it.