Motion sensor and door open/close sensor used together to trigger lights but with different turn off conditions?

What I want to do is have a motion sensor in the hallway trigger the hallway light and bathroom light(s) simultaneously…hallway light turns off after no motion, but I’d like the bathroom light to stay on an extended period of time if the bathroom door is closed. If the door is left open, the bathroom light would go off sooner.

I don’t want the lights to go off on someone using the restroom for more than a few minutes, but I don’t want them left on as long if someone just walks by without using the restroom.

The main purpose of the hallway sensor triggering these lights is for my 3 year old daughter when she gets up in the middle of the night. I have this setup with Smart Lights currently and it all works well minus the problem I’ve encountered for when to shut the lights off.

If the rooms on either side of the hallway have motion sensors, then this SmartApp might work for you.

Since you’re only dealing with 2 lights and 2 sensors, it might be easier if you just use CoRE. It’s technically still an Alpha release, but it’s already more stable than most of the SmartApps released by SmartThings.

1 Like