There are a few cases where Mary can base the status of the lights on the position of a door.  An example of that (as you might have guessed by the title of the page) is closets that have overhead lights.  The closet in the master bedroom has a light in it that until recently had to be turned on when someone entered.  Then the timer for the bedroom would turn the light off after that person left the bedroom.

Now there is a magnetic (security) switch in the door frame with a magnet in the door so Mary can tell when the door is opened and turn on the lights.  When the person is finished with the closet, the door is closed and Mary turns off the lights.

Another place this is handy is a storage closet below the stairs.  These lights were always being left on and we needed some way to make sure they were turned off when not in use.  Now Mary has a way to detect whether the lights should be on or not.

The event is simple enough:

If Sens, Door, Mstr, Cl Is Now On        ->When the door is closed, so are the magnetic contacts indicating on.

Then St, Closet, Master Set 0            ->Turn the light off

Then Event-Call Set Lt, Closet, Master

;

If Sens, Door, Mstr, Cl Is Now Off       ->Door is open

Then St, Closet, Master Set 1            ->Turn the light on

Then Event-Call Set Lt, Closet, Master

End

We do something similar in the bathrooms.