Updated device/agent code. The device now goes in to deep sleep when the door is unlocked, to save battery. This invalidates the circuit diagram, but the changes are minor and you can figure them out from the device code.