Rule Machine (5.1) issue: Required Expression for single date does not reset after that date

Rule Machine (5.1) issue: Required Expression for single date does not reset after that date.

Hubitat Elevation Platform Version = 2.3.0.124
Hardware Version = Rev C-7
as of 02/19/2022

Example – steps to repeat issue:
Create a Rule Machine Rule
Name = Test using Required Expression for a single Date
Use Required Expression for tomorrow’s date
Add a Trigger Event for 9:00 AM
Select Action to Run = send a message “Rule triggered for [add specific date used]”
Save

Expected Results:
Today the Defined Required Expression states False
Tomorrow the Required Expression states True (blank) and at 9:00 AM message sent
-NOT- Tomorrow Defined Required Expression states False No message sent

Actual Results:
Today the Defined Required Expression states False
Tomorrow the Required Expression states True (blank) and at 9:00 AM message sent
-NOT- Tomorrow Defined Required Expression states True (blank) and at 9:00 AM message sent
…. Repeats until Rule is visited and resaved/reset

Thanks for your help.

P.S. I have a workaround by using "annual" date and time in RM but I do like seeing the False flag that the expression provides.

I have tested and concur that this is a bug when using the "On a Day" required expression it moves from false to true on the specified day but doesn't more from true to false when the specified day passes.

I will note that "Between two dates" where the days are the same but using the optional times does work at least for a subset of the day. I didn't try to specify a time of 12:00 am for the start and 11:59 pm for the end.

Interesting thought of using 12-11:59. I left the "Between two dates" times blank and the time in a trigger. I had it set to send a message and it did, but it sent it twice very quickly.
I'm setting it up for tommarrow but this time setting the logs to record.

anyway, thanks for the feedback and I hope they can fix the RE single day bug but I have not heard from staff.

I am looking into this. There is some other weirdness going on with On A Day that I need to track down. It would be most useful if you could turn on Event Logging for the rule that does this, as it should log both the Required Expression becoming true and becoming false 24 hours later. You realize of course that the Apps page is not dynamic, so it does have to be refreshed to see the current state of Required Expression True or False.

Thank you for the update and I will setup another test with Event logging. It will take 2 days of course.
I have read when researching this issue before posting this that the GUI does not update but I can assure you that is not the problem here. I had closed and reopened the APP page even clearing cookies but no change until I entered into the Rule and it refreshed, then and only then did the GUI indicate False and the related message stopped being sent the next day.

Thanks for your assistance,
David

Edit:

Edit 2:
Here are my logs and scheduled tasks for this Rule -- as you can see it did not reset on the 26th and will continue to trigger --

Log as of 02/26/22 8:33 AM
app:1742022-02-26 08:00:00.425 am infoAction: Notify Pushover: 'This rule Required Expression for single date is set for 02/25 Only.'
app:1742022-02-26 08:00:00.342 am infoTest Required Expression for single date 02 25 only Triggered
app:1742022-02-26 08:00:00.326 am infoTest Required Expression for single date 02 25 only event: Triggered at Certain Time
app:1742022-02-25 08:00:00.392 am infoAction: Notify Pushover: 'This rule Required Expression for single date is set for 02/25 Only.'
app:1742022-02-25 08:00:00.299 am infoTest Required Expression for single date 02 25 only Triggered
app:1742022-02-25 08:00:00.283 am infoTest Required Expression for single date 02 25 only event: Triggered at Certain Time
app:1742022-02-25 12:00:00.756 am infoTest Required Expression for single date 02 25 only event: Required Expression now true
app:1742022-02-24 09:24:16.650 pm infoTest Required Expression for single date 02 25 only: Required Expression now false

Scheduled Job as of 02/26/22 8:33 AM
Test Required Expression for single date 02 25 only true allHandlerT 2022-02-27 08:00:00 CST

Let me know if you need any more information.

Regards,
David

Most of these have been cleaned up for the next release. I'll check this one in particular.

1 Like

I have done this. It logged only becoming true. It has not logged becoming false. The app listing does not show the red text showing the required expression is not satisfied. However inside the app it shows the required expression as false. I am still getting push notifications from my test I set up which isn’t supposed to be sending me notifications since the required expression has passed.

Do you need or want me to produce the logs?

That's odd, as my test case did log both. I will continue to investigate. Do you see two Scheduled Jobs at the bottom of the App Status page (gear icon), 24 hours apart?

No, there is only one job at the bottom of the app status page at this moment and that corresponds to the trigger event time. Also below is a screenshot of logs for the test that I set up.

For completeness below is a screenshot of the app rule.

There should be two, and that would explain what you're seeing. However, when I create your rule, I do get two Scheduled Jobs, like this:

Please hit Update Rule, and look again at the App Settings page.

Indeed after I pressed the update rule it removed the trigger scheduled job that was pending for tonight and inserted two scheduled jobs for next year.

I also setup a new rule just like the previous today and it also has two scheduled jobs one for 2022-02-26 at 12:00:00am EST and the other for 2022-02-27 12:00:00am EST.

I meant to look at it this morning before the trigger fired but I forgot. However, right now looking at the Schedule Jobs for the new Test2 I made where the trigger fired earlier today there is only one scheduled job present and it is for the trigger for tomorrow.

I forgot to look again first thing yesterday morning so I made yet another rule and decided to stay up to wait for it so I wouldn’t forget. :sob:

What I found was after midnight the previously scheduled task for the following midnight no longer exists. So it seems that something is removing that schedule after the firing of the one that makes it true.

Thanks for your collaboration with this issue.

End of my testing below -

I created a Rule called "Test Required Expression for single date 02 25 only" that triggers only on that day at 8:00AM. It's been triggering daily for 4 days (today is 02/28/22).

This afternoon the only scheduled rule was:
|Test Required Expression for single date 02 25 only true allHandlerT 2022-03-01 08:00:00 CST|
So it was going to trigger again tomorrow.

After I Entered the Rule and clicked "Done" these replaced that scheduled task:
|Test Required Expression for single date 02 25 only (Required Expression false)|true|stHandler|2023-02-25 00:00:00 CST|
|Test Required Expression for single date 02 25 only (Required Expression false)|true|stHandler|2023-02-26 00:00:00 CST|

So it reset properly after visiting the Rule.