Change security mode with door open sensor

To simplify integration with business use, it would be really handy to have Home/Away modes controlled by a certain sensor’s trigger. For example, for an internal office door or the like, or even a lever that employees can operate:

OPEN = home mode (or whatever custom mode created)
CLOSED = away mode (or disarm or whatever custom mode created)

This would also be useful when working with keyswitches (when wired to the internal reed switch), or access control systems.