Rule Machine: Run rule only once per day

So I’m a Rule Machine noob and still having trouble wrapping my head around the differences between rules and conditions and triggers but I’m enjoying the potential power. I’ve set up a simple rule that says on Monday between 5:30 and 10 PM if the back door opens then open the garage door in the front. Tuesday is trash day so I set the trash out front on Monday. The rule works fine but I would like to have it only run once.
Is there anyway to ask rule machine to only run this trigger rule once if the conditions are met?

You could use a virtual switch.

First Rule:
Have Rule Machine turn the virtual switch on (action) with the back door opening (trigger) between 5:30 and 10 PM (condition), only on Mondays (condition).

Second Rule:
When that virtual switch comes on (trigger), have it open the garage door in the front (action).

Have a rule reset the virtual switch to OFF on Tuesday.

EDIT: Instead of having a separate third rule reset the virtual switch to OFF on Tuesday, you could just use a Delayed OFF in the actions of the second rule, delaying the virtual switch turning OFF by 5 hours (your window is only 4.5 hours, so 5 hours means it won’t shut off and be turned back on the same day).

1 Like

You can do this with a rule and a trigger:

Conditions: back door open, private Boolean true
Rule: back door open AND private Boolean true
Actions for true: open garage door, private Boolean false
Actions for false: [none]
Restrictions: Day of Week: Monday, Time of Day 5:30 PM to 10:00 PM

Events: Certain Time: 1:11 AM
Actions: Rule Boolean [first Rule] true
Restrictions: Day of Week: Monday

The Trigger is just to reset the Private Boolean to true every Monday. This will run once on Monday, max, only when the door opens during the time.


@bravenel, this is bad a$$. I just built it and it works perfectly. Now I’m going to make it work on OR Tuesday morning. Thanks for the quick help and for the overall app. I look forward to better understanding the app so I may exploit it.

Bruce @bravenel , I must say, the rule boolean feature is PLAIN GENIUS! I was sitting on a rule for couple of days because I didn’t know how in the world I can pick the “Rule Boolean”, well I should’ve known that trying new things with Rule opens up a world of possibilities. Nice work, man!!!

Just curious why you need this function. Do you carry your trash from the “back” through the garage to set it out for collection?

I keep my trash bins in the back (side) yard. I drag them along the whole side of the house, through the wet grass or snow or drizzle to the front curb. (Suburbia problems) When I open the back door to go get them, now the garage in the front opens and I can walk right back into the house without having to trudge back to the back yard and through the back door. Smart lock w/ keypad on front door is next purchase and then this would be less of an issue. I would probably then have RM just unlock the front door.

Just to be sure I don’t forget trash day, I have Smartthings announce via my Samsung speaker that “Tomorrow is trash day” I also have it do that on Tues. morning too , “Today is trash day”. These work on a time of day range combined with motion. Next I will have it not speak the second announcement if the backdoor/garage rule has run.

1 Like

Can someone please explain the difference between the private Boolean and any other virtual switch? They seem the same to me…?

You are correct. Private Boolean is very similar to a virtual switch. The two main differences are, (1) you don’t have to create it as a device, and (2) it can only be used within the confines of Rule Machine. For automations that need a virtual switch to hold state information, private Boolean fills the bill.


Ok, that’s kind of what I thought. Thanks!

I was able to get rid of most of my virtual switches with it.

1 Like