RM - notification for dog feeding

I have a contact sensor on my dog food bin. I want to send a notification at 8:15 if the bin has not been opened in the last 2 hours. Can this be done with one rule?

Thanks

OK, removing as Bruce pointed out my idea would not work...

No, that won't work. The rule would only be evaluated at 6:15 so there is no chance for rule truth to change. Next release will remove Cancel as an option in triggered rules because it doesn't work in them.

I think you need two to do it:

Rule 1 (trigger)
Trigger event: Bin opened
Action: set Private Boolean of Rule 2 to false
Restriction: only between 6:15 and 8:15

Rule 2 (triggered rule)
Trigger event: at 8:15
Condition: Private Boolean true
Rule: Private Boolean true
Action for True: send notification
Action for False: set Private Boolean to true

Here's what happens: If the bin is opened between 6:15 and 8:15 it sets the PB of the other rule to false. At 8:15 the second rule runs. If it's PB is true, the bin wasn't opened in the preceding 2 hours, so send the notice. If it was opened, reset PB to true, effectively arming it for the next day. The PB can only be set to false during the two hour window, and it's going to be set to true at 8:15.

1 Like

In Rule 2, Action for False, is that the private boolean for rule 1 or rule 2?

That for rule 2, its own Private Boolean. That's how it rearms for the next day.

After a second reading that is obvious.

For anyone seeing this in the future, if you are trying to set the private boolean for the rule your editing it is at the top of the list.

BTW, there is a bug with Private Boolean as a condition in a rule. Fixed in upcoming release.

Oils that explain why I didn’t get a notification tonight?

Yes, fix coming soon. Sorry for the inconvenience.

Do I need to do anything for this to work once the update is installed?

It should work once the update is installed. Open the rule and hit Done.

I opened the rules, stepped through them and then resaved them and it is not working. Before I start digging to much are we sure that the issues was fixed?

Can you show the rule that is not working? Are you on 1.2.1.121?

I updated last night. If it doesn’t run tonight I’ll report back with screen shots.

After updating, This worked as expected last night. Thanks for the help, hopefully this is useful for others.

To add another layer, I’d like to repeat this every 15 minutes until the bin is opened or an hour has passed.

The repeating is working as expected but I’m not sure how to stop repeating the notification.

In general how do you stop a repeating action?

Second option from the bottom

Yes and I select “stop actions:this rule” but then I don’t know how to configure what stops it.