Logic advice sought - trigger automation at opening of door


I’m scratching my head on this one and would really appreciate some insight from more logical minds than my own !

I’m trying to build an automation based on the opening of a door - i.e. turn on a light when I open the door of my office and it’s dark.

All very straightforward thus far and I have door contacts and motion sensors on hand.

But …

I don’t want that same automation to fire when I open the door later in the day to exit the room and lock up for the night.

Sure I could put some time parameters on this but that doesn’t really help with flexibility I//e popping in for just 15 minutes for so

Basically I am looking to trigger on entry but not departure

Apologies for the rather all encompassing question but could somebody suggest the routes I should be exploring ?

One way to achieve this is to use a motion sensor that only ‘sees’ just near the inside of the door so the automation has a condition to only run if motion was not detected in the moments before the door opens. ie: the person is on the outside of the door.

1 Like


That is very helpful

As luck would have it I have a motion sensor which looks directly at the door linked to the alarm and of course it cannot detect motion beyond the glass.

So would I effectively be putting in a condition along the lines of “not detected motion for xx seconds” ?

Exactly. That way it won’t action the automation if the motion sensor does detect someone as they approach the door on the inside.

1 Like