Why Does This Rule Not Work

I have a rule that I sorta copied from someone else's example. I want a notification when motion is detected, but only once till 15 minutes has elapsed. So tell me what I am doing wrong.
Here is the rule:

Here are the events from the rule: Notice the Boolean last got set to false at a point where there was no motion and never got reset to true:

And here are the motion events:

Edit: Looking at what you need again and you might just need to leave your rule pretty much as is but deselect the Enable/Disable with PB option and add and if PB is True statement at the beginning. Give that a shot first and if it doesn't work for you, then try below.

Firstly you will need a Triggered Rule instead of just a Trigger. Secondly you will need to deselect the Enable/Disable with PB option.

The triggered rule will give you True Actions and False action.

True action:
If PB is true then

  • Speak on Speaker
  • Rule Boolean False **this rule

False actions:
Delay 15 minutes
Rule Boolean True **this rule

I think a triggered rule with all the actions under true is the way to go.

Trigger motion active
Condition PB true
Actions Speak, PB false, delay, PB true.

I'm gonna change it as suggested . Still puzzled as to why it didn't work as is, but so be it. I guess I don't quite understand the PB operation.

Thanks for the help.

I didn't as well until recently. See this discussion.

1 Like

It's still confusing. It appears from this statement from that post that my rule should have worked. But it's not worth spending time on, I have changed it as you suggested and it works and that's all that matters.

QUOTE: 'If a rule is restricted nothing happens, irrespective of how it is restricted. So yes, PB false with PB restriction prohibits rule from running.'

The confusing part for me was the enable/disable rule with PB toggle. I thought this was a necessary part of using the PB. It is not. If you do use this toggle to disable the rule, the only way to reenable it is with another separate rule or action. In your case you want the rule to be able to reenable itself after a timeout.

The PB itself does not enable or disable the rule. It is simply a varaiable that can be true or false. In your case we use it (via an if statement) to allow/disallow a small section of code (speak on speaker) to run. If true then allow. If false do not allow....etc.

If you also use the Enable/disable toggle, when the PB is false, it disables the ENTIRE rule, including the part where you tell it set the PB to true. Therefore the PB will always remain false...unless....you setup another seaparate rule that sets the PB to true.

Hopefuly this makes more sense. It was an eye opener for me.

That is not correct. You can have a delayed action within a rule that will still set the PB back to true, even though the PB is currently false.. If you have a rule action such as this:

Set PB to False
Delay 1 min
Set PB to True

After 1 minutes, the private boolean of the rule would be true. Setting PB is the one action that can violate PB restriction.

I think I will stay out of all PB discussions going forward. Every time I think I understand it there seems to be another piece of the puzzle. :man_shrugging:

But isn't that the way my rule was written? And it didn't turn the PB back to true.

Me too...:grin:

I think the problem is the action of delay. I just tested this in RM 3.0. When you use a delay, like this:


It sets the PB to False and never to True again. But when I do this instead:

You can see in the events that the PB is set to true 10 seconds later. Want another piece of evidence about setting PB not being restricted by PB? Take this action:


You can see, the only action is to set the PB to true but the PB is currently False and the rule is restricted by PB. When I run the actiuon...
image
:astonished: