Hello all,
Hopefully someone with superior rule machine 5.1 skills will jump in and help me out here. I'm trying to set up a motion activated sprinkler zone on my Rachio(zone 4) using two motion sensors placed in front yard. The way I'm trying to make this work is as follows: Motion detected on one of two sensors->turn on zone 4-> wait 30 sec.->turn off zone 4->add one to variable(run limiter)->notify my phone(victor's iPhone). If my presence changes to arrived->pause rule for five minutes(time to get from car into house without being sprayed). If any of four exterior doors opens->pause rule for five minutes(time to get to car and leave). If zone 4 turns on five times(run limiter = 5) between one hour after sunset and sunrise wait one hour and reset variable(run limiter) to 0. When time becomes sunrise and if variable(run limiter) is greater than 0, reset to 0) I would also like to limit the times in which the rule can run to sunset + 60 mins. and sunrise. I'm attaching some screenies of the rule as is and the the error I get when both motion sensors become active before the current actions play out.
This rule is mainly for racoons that like to come tear up the trash cans but will also be very handy for the neighbors frequent, wild parties that sometimes spill onto my yard in the wee hours. I promise to post videos!
The delays are only set to 30 seconds for testing.
The above error occurred only when both motion sensors change state to active.
Thank you all!
The error is caused by multiple trigger events while Delay pending inside an IF-THEN. Changing the Delay to Wait will prevent the error but it'll also prevent the following actions from running. I think it may be better to delay the Set Private Boolean False action rather than having a Wait (or Delay) before it as I can imagine a case where you get stuck with the PB True and no way to reset it.
1 Like
Thanks for the reply!
I changed the rule structure to this below but still receive the same error.
Also, if the if-then section to reset variable(run limiter) fires and a motion becomes active during the delay, it resets the delay which can create a loop if motion stays active for some reason.
I can imagine ways to do all this with multiple rules and hub variables but would really like to keep it within one rule if possible.
Sorry but I'm not picking up on what has changed. I still see Delays and not Waits.
1 Like
When I change to wait for event-> elapsed time, the following actions donāt fire. Sprinkler just stay running.
Okay, I think I figured this out. The above works well, follows all the constructs thus far, and without errors.
If everything works overnight then tomorrow I will try condensing the else-if statement into the first if statement by adding both motion sensors with an or between them.
Thanks for your help!
1 Like
I like your random notification messages ! : )
1 Like
Okay, so Iāve got the actual sprinkler on off with motion running well now but two other aspects Iām stuck on. Hopefully someone will chime in here!
Iād like the variable ārun limiterā to reset itself after a one hour delay once the number climbs to five. Also, I would like the ārun limiterā variable to reset to zero either at sunrise or sunset if the variable number is greater than zero.
TIA!
I'd make "run limiter" a hub variable then use a second rule to reset it.
1 Like
Iāve gotten that far. Itās the one hour delay if run limiter = 5 that is tripping me up.
Guess maybe Iāll need two separate rules. One for the one hour delay if run limiter = 5 and one for when time reaches sundries and run limiter > 0. Unless someone has a better idea to keep it contained in a single rule.
Trigger Events
Time is sunrise or sunset
Action to Run
Set run limiter to 0
Wait for event: run limiter = 5
Wait for event: elapsed time 0:01:00
Set run limiter to 0
1 Like
@pseudonym thanks for guiding me in the right direction with this. The revamped version below seems to run as expected after some testing. The red area is disabled because that is what I was using to test during daylight hours. Both the "Don't spray me" and "run limiter" are hub variables with first being a time delayed boolean based on arrival and the second being a number variable. @pseudonym @bertabcd1234(who was big help a few years back) Would either, or hopefully both of you, be willing to take a look at this rule for any potential gotchas? I'm mainly concerned with potential errors or a situation where a sensor(motion or contact) takes a dump and leaves the "rachio - zone 4" action running over and over.
The latest version is below:
Thanks to any and all willing to take a look and provide feedback!
I don't see any gotchas right now but I would organize it differently to help me find them. I would try to group common conditions together but that'll introduce nested IF-THENs. For me that is better but isn't necessary. I would suggest that you make PB is false a Required Expression. It's in your IF-THEN and both ELSE-IF. It's not in your ELSE but I don't think functionally it'll matter.
Forgive my ignorance, but will the rule still run when PB becomes true?
The rule will only trigger when the PB is false. The only actions that currently run when the PB is true is in the ELSE section. I think it's okay to wait for this section to run when the PB is false again or at least it wouldn't be any worse than if the rule never triggered between sunrise and sunset. Hmm, perhaps that's a gotcha right there...
So I take it the rule wonāt stop running after the PB becomes true? For instance when zone four turns on and PB becomes true or when a door opens.
The ELSE statement could be a hiccup but only if no motion or exterior doors open between sunrise and sunset. Very unlikely but not impossible.
No, the rule won't stop running. The Required Expression only stops the rule from triggering unless you select the option to cancel pending actions. Don't do that and you'll be fine.
1 Like
Okay, makes sense. Iām assuming this addition(to stop rule from running when PB is true) is done to lessen the hub load and prevent the rule from running over and over as the rule has quite a few triggers? Or am I missing something?
I think it's simply to stop a rule from running additional actions if the rule is currently in a Wait or Delay. For example, if you have a Required Expression between two time you might want to cancel a Wait to prevent any further action after the end time.