Rule Machine help Lighting on Motion and Contact triggers

I have a simple automation rule that has been working for me for a long time. The only issue is that sometimes there is a short delay to turn the lights on in the garage. Motions are in the garage. So now I want to add a door contact sensor to also be able to turn the light on and have it continue to turn off 5 minutes after motion ends on all of the motion sensors. This is only during the hours I have in the rule below. I am struggling in creating this rule in rule machine. Can someone help me out with creating this rule? Simple automation will not let me add the contact sensor as a trigger. Thanks.

I think something like this should work for you.

1 Like

@Otto_Mation you stated that you wanted to add a door contact sensor. If you want to also turn on the lights based on motion then add the following trigger to gwydionjhr's suggestion:

Motion Garage 1, Motion Garage 2, ... any active

1 Like

Why not in Motion Lighting? It can use contact sensors, and your sunrise/sunset restrictions.

Example:

1 Like

I think that I got it. Thanks for all the help.

1 Like

@Otto_Mation I believe your Wait should be all inactive and it should be duration, not timeout.

1 Like

You are right. I will fix that.

1 Like

There is something wrong with this part of the rule:

On: Switch Garage Lights
Wait for Expression: Motion Garage 3, Motion Garage 4, Motion Garage 5, Motion Garage 1, Motion Garage 2 all inactive(T) [TRUE] --> timeout: 0:05:00
Off: Switch Garage Lights

If I open the Mudroom Door the lights turn on and then immediately turn off and as a motion picks up motion they turn on again. Opening the door turns them off and then back on.

Edit: I found the problem. There is a radio button to use the duration that I had not turned on

1 Like

Ok, now that you've got it working.... can I come over and play in your garage? Any garage that requires 5 motion sensors has got to be aaawwwwwesome!

1 Like

Not a lot to look at in my garage. All the usual garage stuff is in a shop behind the house. The garage is for my beer fridge and trucks. I need motions to protect my beer from the neighbors.

1 Like

BTW, the rule is still not quite working. Now it does not turn the lights off when motion ends.

The rule should turn off the light five minutes after motion ends.
I'd suggest you trigger the rule and wait for motion to be inactive on all.
Then go in to the rule click on the gear icon.
At the bottom of the page you should see that there is a scheduled job to turn off the lights.
Would you verify that you're see a scheduled job?

Stay out of that beer fridge for one hour and revisit the rule configuration. Guaranteed results.

3 Likes

I tested several times and they never turned off. I deleted the rule before I read your message and am trying the motion lighting rule to see if I can get that to work. If that doesn't work I will rewrite the Rule Machine rule and see if I can get it working.

Well it looks like motion lighting was the way to accomplish this rule. This is what is working.

2 Likes

Here is an update. The motion rule above that I thought was the solution from @neonturbo turns out has a flaw. If the light was turned on with the contact and no one walked out into the garage to trigger motion the light would not turn off. With a little help from @scunny I got there with this rule written in Rule Machine.

2 Likes