Review Requested

I had more or less given up on Rule Machine a while ago. I just couldn't wrap my head around it. Now that there have been significant changes, both in UI and in in app guidance i thought I would give it another try. The first rule I'm attempting is very simple when either the tilt sensor on the garage door or the contact sensor on the inside door to the garage opens, turn on the overhead light, wait 10 minutes, then turn it off. here is how I have that written, and on a basic level it seems to be working as intended. open the door, light come on. after ten minutes, they go off.

My question is, will this also keep the light on if one of those sensors remains open? or do I need to add something to it? I'm really not experienced at all with variables or Boolean, if that's what needed, I may need a bit of guidance in those areas.

Thanks !

Nothing in your rule checks for the sensors remaining open--it will just turn the lights on when any sensor opens, wait 10 minutes, then turn them off, no matter what happens in the meantime. In fact, if you open and close multiple times within that 10 minutes, nothing will cancel the original delay, so they may "unexpectedly" turn off sooner than 10 minutes after the most recent opening. (This is the issue that "cancelable?" on the delay plus "Cancel Delayed Actions" addresses, or you could use "Wait for event: elapsed time" instead of "Delay," which is automatically cancelled on re-trigger. But it sounds like this isn't your main concern.)

You have a few options for what you can do address this, mostly depending on what you actually want to happen.

For example, to make it wait 10 minutes after the contact sensors are both closed again:

Trigger: Contact 1, Contact 2 any open

Actions to Run:
On: Light
Wait for expression: Contact 1, Contact 2 all closed --> duration: 0:10:00
Off: Light

3 Likes

75% of the time that would actually be fine.

That's kind of what I suspected. Being the garage, the most likely scenario will be that I'm out there working on something (cleaning, car repair, other project, that's where the work bench is.) Most likely I would have at least the main door partially open (the tilt sensor is on the top panel). Would you mind helping me figure that out?
The next question I just thought of is if I go out in the garage ,and have both doors closed, will this cancel out if I turn the overhead light on by dashboard, and still shut it off after 10 minutes? I do have a Zooz Remote switch I have thought about using out there for a while, just haven't figured out what to use it for yet.

I do have some motion sensors out there. I've had a motion rue for this for a while, but it has not been very reliable. I threw an extra contact sensor up last week and saw they it triggers much more reliably, then remembered the tilt sensor and an idea was born .

EDIT

If I toggle and stays, wouldn't that make is so the rule wont trigger until AFTER the and stays time elapses?

So here is the re-write. While I have toggled that its cancellable, (this may sound really dumb), I don't see how to define HOW to cancel it.

Not to derail you here but this would be a perfect thing to do in Room Lighting. I have two rooms with timers. I am activating it with the light switch but it could just as easily activate by contact/tilt sensors. You can specify for the timer that it is since the LAST activation, so any re-activation while the timer is going will reset it. To me this is more intuitive than using RM.

That's another one I have been experimenting with and not having much luck. It seems simple enough but I never get it to work out the way I want. When it came out I went right to it, but nothing worked like it was supposed to. I got frustrated then just tweaked my Event Engine Cogs a bit . I'll give it a try. Rule Machine does seem a bit over kill, but I also need to figure out how to use it better. Futzing about and trial and error for hours just to get it working on a basic level gets really old really fast. In my mind I should be able to get at least a basically functioning rule written fairly quickly. Tweaking is another matter. I need to get something written for the garage because the lack of reliability out there is starting to drive me nuts, particularly at night. I have three other rooms I have ideas in room lighting for.

You can also build it out in both, just keep only one active at a time and see which you like better. If you work on anything in RL and make a post feel free to tag me. I am the self proclaimed RL master :laughing: since I beat it into submission during the beta.

2 Likes

oh, don't worry, I will. I have three other rooms I need to set up, and it does seem to better suited for this. I'll work on this one now using your example. I have a couple of garage door rules that were my reason for walking away from RM in the first place. They may be better suited .

Add as your first action

1 Like

But I don't see HOW to cancel. Device, button, switch etc.

You would probably want to do it first thing in your actions--i.e,, if it reopens, cancel that delayed action because you want to start the countdown over. Technically, you'd also have this delayed action still pending even if the contact closed (though I suppose your original rule doesn't really care about this) and the lights are already off, but then you'd just be sending off to a device that is already off, which would have no effect, so it isn't necessarily something to worry about. But there are many ways to rethink the flow of these rule if it is.

1 Like

When you create a new action, go the the very bottom option


From there select Cancel Delayed Actions as shown above. It'll cancel everything that is cancelable.

1 Like

So, create a new action after the wait action? doesn't something still need to actually trigger it? Wouldn't that just keep it on indefinetly?

TRIGGER: 
	Door Tilt, Garage Door any contact open
ACTION:
	Cancel delayed actions
	Turn on garage lights
	Delay 10 minutes (cancelable)
	Turn off garage lights

Once a contact is open, this will turn the light on and start a 10 minute countdown (if you will). If either contact is opened again, the "cancel delayed" will clear out the first countdown, turn the light on again (which would still be on at this point), and start a new countdown for 10 minutes. If the contact sensors don't "open" again, then the lights will turn off after 10 minutes.

This is going to be a problem for your use case though, if you're anything like me. I know I can go out in the garage and end up sitting out there for hours without going in/out a door. With the rule written like this, the lights would end up constantly turning off on you and this is where RM becomes daunting for people, but one you get your head around the basic logic, it's a snap. The hardest part is really thinking through your use cases (I think this applies no matter what app you're using).

I have two motions sensors in my garage for just this reason. It's a standard two bay layout 20'x24'. I have a motion sensor on the back wall watching each bay pointed towards the middle. My lighting is based solely on those two motion sensors on a 15 minute delay. That keeps the lights on as long as I'm active in the garage. I think the only time it's ever given me problems was putting sound deadener in the back of a car where I was inside the car for long periods and not triggering the motion sensors. Works a treat for maintenance work or if I'm working on something else.

1 Like

Make the Cancel Delayed Action your first action. When the rule runs the first time, there will be nothing to cancel so no harm. If the rule re-triggers within your 10-minute delay, the Cancel Delayed Action will cancel the delay that's running, then send an on command to the already on light (no harm), and then schedule another delay.

Every time the rule re-triggers within your 10-minute delay, it'll basically restarts the delay timer. Once you've gone 10 minutes without re-triggering the rule, the off command will run and the rule will be done.

Like this?

Yes. I would suggest that you change the delay to something like 1 minute and trigger and re-trigger the rule to see how it works. Once you understand what's happening, change it back.

2 Likes

I am building it out in both, just for the experience. I have alss created a similar thread for Room Lighting. . I'll probably try each for a few days once i have them nailed down.