> The solution I've come up with but haven't yet put into action is to use an ESP device, with some sort of contact switch which sits _in_ the hole where the lock goes and detects whether the lock (bolt?) is physically present.
Another option is to disassemble a door/window sensor and replace its reed switch with a contact switch, much like you want to do with the ESP.