Two Sensors, one Light - interesting question

Any suggestions on how to make this scenario happen, with ST Automation. I can do it with Webcore, but want to simplify.

*Double Closet doors that open into a wide closet.
*Contact Sensor on Each door
*Open is easy, if either sensor is opened, turn on light.

Question as to how to turn the light off. If either door is (right or left sensor closed), and the opposite sensor is already closed, then turn light off. Sounds simple.

When selecting multiple sensors to be off, it is any “of”. So, this is not what i want. If i’ve opened both doors, and the light is on, i do not want the light to turn off if i close one of the doors.

Webcore logic allows this, as i can indicate that if left closes while right is already closed etc, i get what i want. Just wondering if there is a way to do this within ST, as this is really the only item i have left that would benefit from Webcore.

Don’t want to get into Webcore, not comfortable with the reliance on cloud. All of my switches can run local, except those referenced by Webcore.

Can we assume that the doors were separate from each other and you couldn’t use 1 sensor?

1 Like

i’m sorry, i’m not sure i understand when you say “doors are separate from each other”, or maybe i do.

they are simply double doors (left and right) with handles next to each other in the middle. There is no separation, that is there is a single door jam, 6 feet wide, and the doors close into that jam.

Are you suggesting that i use a single sensor, with 1/2 on one door and 1/2 on the other? That may just work … hadn’t thought of that. that would certainly simplify it.


Yup! That’s what I do, and it’s a whole lot more simple.


Thanks for the help, feel silly i didn’t think of that.

1 Like

I did something similar to shut down the motion sensor in our bedroom if the bathroom or bedroom door is closed. I used a virtual switch and the 2 open/close sensors are the triggers for the virtual switch. The virtual switch then become the condition for your closet automation.

LOL, no worries!

thank you for the reply.

I’m going with a single sensor. But the solution you present seems to kick the problem over. when is the virtual switch turned off and thus the light? you’re still needing to deal with two sensors and orchestrate them. turn the light of when the last of two switches or contacts are closed.

maybe using multiple virtual switches in some way, but it starts to get ugly fast.

Go with the single contact solution. Far simpler, far more effective. Magnet on one door, sensor on the other.

You have to really pay attention to your logic.

For a 2 door situation I did it with one virtual switch and I think 3 Smart Lighting rules.

I actually have 3 separate conditions that will cause the bedroom motion sensor to be bypassed (and turn on the bedroom Do Not Disturb virtual switch). I also have a 5 minute delay when any of the conditions changes before the DND turns off. The 3 condition scenario requires multiple virtual switches and about a dozen or so separate rules. I would have to go back and look at all the rules again to see how I did it. It was FAR SIMPLER to code it in webcore but I wanted to see if I could do it in smart lighting.

If it works, the single sensor is the easiest way to go. I couldn’t use a single sensor in my situation.