RM Example - Rule Machine, run once then stop for a period of time

I would define it as a Trigger rather than a Rule.

I'm not sure that a rule with PB false can reset itself to true...might need to do that part in a different rule. Also make sure you have PB restriction enabled.

Final update - works like a charm (Enabled Private Boolean "PB") as well.

It can. A Trigger can set its Public Boolean to False, and set its Public Boolean to True with a delay. I have triggers running like that, to ensure they are disabled for a minute after being called. I use it for my door bells, so that if someone pulls/pushes them several times, I don't get multiple notifications.

1 Like

It's still more complicated than you need. You don't need a Triggered Rule, you only need a Trigger. The Trigger Events would be the same, there would be no Conditions or Rule, and your Actions would be the same.

Can you expand on that a bit ..

Nevermind @bravenel I think this is what you're talking about:

2 Likes

Yes, that will do it.

Starting to learn this stuff and what it all means ... feel like I'm starting to "control" some stuff ...

Thanks!! Hopefully others will learn along the way.

2 Likes

Doing the trigger, will the delayed action be canceled when the private boolean gets set to false? Or does the schedule persist even if the rule is disabled by private boolean?

The rule with False/True definitely wouldn't work since the false part wouldn't fire since the rule is disabled by private boolean.

No, the delayed setting of Private Boolean is not cancelled by the trigger being disabled by PB. That wouldn't make sense, as it could never be re-enabled.

@bravenel As a change request, I think it would be more flexible if the delay could be specified in seconds rather than minutes. Eg for some things I would prefer a shorter delay than 1 minute.

But it would be if you put the re-enable in the false part of a rule, right?

Yes, I agree. It's on the list.

2 Likes

Yes, that is correct.

Thanks!

In this sample trigger above, can we treat PB as restriction?

Since "PB set to be True" action will be delayed 1 min to fire, and "PB set to be False" action would be executed first, how system handles? When try to execute "set to be true action" , trigger looks like restricted because PB is false..

Another question is for any delay action in the rule, by default ,will RM validate the rule again by delayed time before firing the delayed action?

Yes, PB should be a Restriction to get the desired result of only one notification for events in the first minute. That restriction will not stop the setting of PB back to true one minute later.

No, RM does not run an evaluation after a delay. However, by using Delay These Actions with Cancel on Truth change, a delay can be cancelled if the rule would evaluate differently. Rules are only evaluated when one of their conditions changes state, or when you hit Done in the UI for the rule.

@bravenel

Thank you for the explanation.