I would do it oposite way. IF no motion in the room, AND door open THAN turn on light. This avoids situations when someone else come in the room and somebody is in there.
I believe Jerryk means any door in the house, not the main entrance door
Like Daniel stated i have a simular setup.
Motion sensor inside the room and a door contact. WHEN door opens AND no motion in the room THEN turn on the light. That way the light also won’t turn on when leaving the room.
This was a great setup. I’m doing similar thing but instead of light I run my Sonos favorite music. The problem I’m facing is now when I leave the bathroom I want to turn of the music automaticlly. I dont really know how to do it. I also have motion sensor inside the bathroom and door sensor.
One scenario I also want to cover is when I leave the bathroom but forget to close the door.
Hope someone can help me with that.
Thanks in advance