The main objective is to control an intruders alarm.
When door is open from inside, because someone leaves or, as it has been remarked, to receive a visitor or a packet, the alarm must never be triggered. When door is open from outside, the alarm must be triggered, except if some inhibition action has is done a few before or after.
In particular, I’m playing with a raspberry pi 3, bluetooth microphone/speakers, pocketsphinx voice recognition and http client/server to interface with smart-things hub. This solution allows to an automatic system ask “who is ?” when someone opens the door and expects a predefined answer phrase that inhibits the alarm. But this experiment is valid for incoming scenario, not for outgoing one.