Any video tutorial for using Private Boolean in RM?

Goal is to create a rule that runs only once a day, eg a Good Morning routine.

In the past, I have either used a virtual switch that reset before sunrise, or used ST/Echo's built-in option of run the rule once a day. This seems to be missing here? While searching I came across suggestions to use private boolean, same topic discussed here, with this solution comprising of two rules.

I understand the logic, and the triggers/conditions/actions in that example, but could not recreate it using the RM interface in few attempts. Finally, after some playing around I got it configured with the two rules method.

Question 1: Is there a video tutorial on private boolean use? Like all other tutorials that are immensely helpful along with the documentation to learn using the interface.

Question 2: Is it possible to add this option of 'run once a day'? This would make life much simpler for novice users!! (And not to create two rules every time)

Question 3: Is there a simpler solution that I missed on searching/ or not posted? :smiley:

That's an old example. Rule Machine now has Required Expression and Private Boolean is typically used here to prevent retrigger of a rule. Perhaps post your two rules and we can suggest how to make it work?

The "Two Rule" option becomes more attractive when you consider that the second rule can be shared among many other rules. I have one dedicated rule that runs overnight to reset a bunch of variables, timers, etc.

1 Like

I can't tell if you are wanting a rule that runs at a certain time every day, or one that is triggered by something else, but will only run once per day, no matter how many times it is triggered.

For the first case, use the trigger called Certain Time.

For the second, use a Required Expression. Part of the expression would be 'Private Boolean True'. There could be other elements to the required expression, such as only during some specific time-frame. Then, the first action of the rule would set Private Boolean to false. The last two actions would be Wait Until Certain Time (like midnight), and the very last action would be to set Private Boolean to true.

2 Likes

Thanks, I did make it work, just that it took a while to figure out the RM interface to set it up correctly. That's why I was asking if there is a video tutorial for others who might be in the same boat as me.

This is an "Aha!" moment for me!

Yeah, I have set it up like that.
Except, I dislike 'wait options' and avoid as much as possible. Any interruptions in hub (power outage/ reboot?) might reset variables. I use time triggered second rule to reset the boolean.

1 Like

There is no functional difference between these two. A pending wait can only be reset by the rule being triggered, but in this case with Required Expression, that can't happen. Power interruptions and reboots do not affect Waits any differently than Certain Time triggers.

2 Likes

That is awesome! Thank you for clarifying.