Rule Machine: Run rule only once per day


(Preston Todd Bradford) #1

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?


(Brian Diehl) #2

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).


(Bruce) #3

You can do this with a rule and a trigger:

Rule:
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

Trigger:
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.


(Preston Todd Bradford) #4

@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.


(Bobby) #5

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!!!


#6

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


(Preston Todd Bradford) #7

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.


(Ryan) #8

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


(Bruce) #9

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.


(Ryan) #10

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


(Bruce) #11

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