Tip When Using Contact Sensors and Motion Sensors For Lighting Triggers

Based on my recent experience, I feel like motion-based lighting that relies on a combination of contact sensors and motion sensors to turn lights on, but only relies on motion inactivity to turn the lights off, could benefit from either:

  • Treating the contact sensor like a motion sensor
  • Introducing a timeout after activation (thanks @JB10 )

to help make the lighting automation more tolerant of motion sensors that stop reporting motion.

I tend to write too much :slight_smile: So read on if you are interested...

My Experience...

Recently I had noticed that sometimes my garage lights would stay on, particularly when I went down to the Laundry area just near an internal access door, then return back through the same door, regardless of whether I closed the door or left it open. I just figured out what was happening....

The Room Lighting setup I have can be triggered by various contact sensors, including the internal access door, as well as Hue Motion Sensors dotted around the garage. Turning on the lights has worked perfectly fine. Triggering the lights to turn off however, is based on motion becoming inactive in the garage.

The Hue Motion Sensor that covered the internal access door near the laundry had run out of battery power, so was not reporting motion. Other motion sensors in the garage were not detecting motion in this area. When I entered the garage to deal with the laundry, then left back through the same door, this meant that the lights were turned on by the contact sensor (door) opening, but motion was never activated and therefore never reported as becoming inactive, so the lights would not turn off. If I moved throughout the rest of the garage, then the motion would eventually report as inactive and the automation would work as I intended.

While I need to setup monitoring for the motion sensor to detect when it stop reporting, I also think that the RL setup would benefit from the contact sensor also triggering a virtual motion sensor that is included in those that are used to turn the lights off.

I'm sure that you know this already, but I use Device Activity Check on all of my dashboards to monitor my batteries, including my motion sensors.

2 Likes

Yes, and I use DAC.... or at least have done... It's so hard to remember sometimes... :slightly_smiling_face:. That is definitely what I need to setup for each of my motion sensors and likely other battery powered devices, where it makes sense.

There is a small app, I think written by Bruce, that converts a contact sensor to a motion sensor. I use it for my shed. I can't give you specifics as the hub is currently down without power. It might be in the HE example github.

1 Like

Depending on the nature of the light, I like to use Elasped time since First/Last Activation to go with Motion and contact sensors. It provides a back up to turn off the light that is not reliant on battery operated sensors and would work in this situation.

1 Like

That's a good point as well. I'll add it to the original post.

The app that @oldcomputerwiz mentioned can be found at HubitatPublic/example-apps/contactMotion.groovy at master ยท hubitat/HubitatPublic ยท GitHub. In doing some searching, it looks like there might be one or two community options as well.

2 Likes

Great topic/ideas.

A related potential game-changer for motion-based automations is adding mmWave sensors. I have multiple motion automations that don't involve doors at all, so the contact/motion combo doesn't give me any juice. However, mmWave sensors have allowed me to conquer my wife's Sphinx imitation while working in her home office, and not turn off the lights when she's motionless for long periods.

3 Likes

I've heard they can last thousands of years....

1 Like

Which mmWave sensors are you using?

Linptech...

1 Like