Motion Lighting On with contact - staying on

I see your point. Just create a virtual motion sensor, and in the device page you can select it to turn off after a certain time. Then create a RM rule that if the contact sensor becomes open, then change virtual motion sensor to active and add the virtual sensor to your motion sensors in ML. This is how I was doing it before the change.

Yep that's what ive done, thx.

Actually, the user who first requested this feature uses it. His use case is this: He wants the light to come on when he opens the door to a room that has ML controlled lights. He gets faster response from the contact sensor than from walking into the room and tripping the motion sensor. But, he does walk into the room and trip the motion sensor.

I will look into adding an option to turn the lights off on a contact sensor closing, so that it's a matched pair.

1 Like

That's how I use the contact sensor function in ML as well.

I also get faster response with this than with having to use a rule triggering a virtual motion sensor, and adding a simple lighting rule for the contact sensor left me in the dark. Since I am definitely big enough to set off the motion sensors, I never noticed that it didn't shut off until I tried it.

The feature to allow contact sensors to turn off the lights has been added to Motion Lighting in the latest hot fix release.

I will check this out tonight, thanks! Does it turn it off right away with the contact? or can there be a delay like with motion?

It turns off right away with the contact closing.

Ok so, here's my use case. By my testing, it looks like it won't work like this with ML? I have a contact sensor on the door going into the garage. I also have a motion sensor out there, but it's not pointing right at the door. I'd like the contact sensor to turn on the light, but I want it to follow the same 5-minute no-motion timer as the motion sensor has. Like others have said, if I open the door, but do not go out and then close the door, the light stays stuck on.

I did see the setting to turn off the light when the door contact closes, but that overrides everything, so if I go open the door, the light turns on and when I close it behind me, the lights turn off when I'm in the garage. I stood there in the dark and finally after like 30-secs of waving my arms around, the motion sensor kicked in and turned the lights back on, but obviously that doesn't work very well. :slight_smile:

So, what I'd like to happen is have the door contact sensor turn on the lights, but I want the 5-minute no-motion to turn the light off after 5-minutes, even if I don't go out there.

If that doesn't work, does anyone have any theories about why the motion sensor doesn't pick up after going out there so the light doesn't turn off as soon as I close the door behind me?

Use this code from Hubitat to create a virtual contact motion app. Use it to use your contact sensor as a motion sensor in the built in zone motion app with the garage motion sensor. Then replace the sensor used in your garage motion lighting app with the one created by the zone motion app and remove the contact sensor from the motion lighting app.

Interesting! Thanks!

1 Like

With your current setup, the motion sensor is probably getting canceled by the contact closing. I have tried several different ways of incorporating the contact sensors into the garage with the motion sensors and this has been the winning combination. The lights are one before I have the door half way open. My contact and motion sensors work together as one sensor.

Just came across this post as it addresses a similar scenario that I am currently looking at. I have motion lighting in a bathroom that I would like to "jump-start" with a door sensor. Once the door contacts detects a door-open, I want the lights to be triggered and then have the motion sensor routine take over. I can't seem to get this to work, the code works fine for the motion sensor alone but once I add the variable for the door contact, the light simply stays on. Any advice on what I might do wrong here?

I use motion lighting which is faster than RM. I use this small app that @bravenel wrote to make a contact sensor appear as a contact-motion sensor which can be incorporated with actual motion sensors into the built-in Zone Motion app. I use the virtual motion sensor from that as the motion sensor for Motion Lighting. It may sound complex, but it is lightning fast. Lights come on well before I have the door all of the way open.

1 Like

Thanks, I just played with that a bit and it seems to work well. Having said that, there is one issue that I am not sure how to address. When I enter the room, the lights turn on very quickly and the motion sensor keeps them on. Since this is a bathroom, whoever goes in there is likely to close the door once inside :wink:
Now, when you turn off the lights in the room before you open the door, the contact-motion sensor will turn them right back on. It would be great if there was a timer function that keeps the motion lighting app from reactivating for a few seconds once the lights are turned off manually.

Never mind - I was able to accomplish the delay with a virtual switch that turns on for 5 seconds once the lights are turned off - works great now.

1 Like

Ken I seem to have an issue. I thought I followed your directions but the lights are not coming on in my garage when I open the door. I have a contact sensor on the door and a motion detector in the garage.

  • The code for the user app was added to my HE and the interior garage door was added as the contact sensor. Named: Garage Door Contact Motion

  • The built in Zone Motion Controllers app was added. Created a Zone named Garage Motion Zone. Setup as a trigger activated zone with the motion sensors Garage Door Contact Motion and Garage Motion Sensor. The activation window is 5 seconds with a timeout of 5 minutes.

  • The Motion Lighting App us very simple. The motion trigger is mZone - Garage Motion Zone, turns on the garage switch, and delays for 1 minute.

Where did I go wrong?

Set this up as Motion Aggregation. Also, don't use a long timeout in the Zone controller, I just use 1 or 2 minutes. I set the real timer in Motion Lighting.

1 Like

So it seems like it's working. Thank you.

1 Like

Hi all, I am doing something wrong and I’m sure it’s simple. The scenario is this:

I want the lights to turn on for my attic when I open the attic stairs (pull down), then turn off after 5 min when I close it up.

Right now I can turn it on when I pull down from the contact sensor, but when I close it it turns off immediately. I have it set for a 5 min delay and have tried all the different modes as well with that setting.

What am I doing wrong?

Thanks
Eric