Automation to send notification when a delivery arrives

I have a porch that has an external front door and an internal front door to the home. Both doors have door sensors. I would like to know when the delivery person has opened the front porch door and closed it again but the internal door has not opened. The door also currently switches the porch light on.

Any help would be great

What kind of delay do you accept between the doors for it to still be considered a family member fumbling with keys?
Or do you mean both doors need to be in open state when it’s family at the same time, and if only the exterior door open and close is it delivery?

good question. I guess to start off with a one minute delay. I can always increase it or reduce etc. Only one of the doors would be in an open state. the other should be in a closed.

I gave it my best in yaml but I just can’t get the logic in yaml.
I’m missing the timeout branch in the wait for trigger/template.

But it can easily be done in Node red.

[{"id":"0879129f36f95878","type":"ha-wait-until","z":"ebaa69a9.649708","name":"","server":"4bbca37b.1700ec","version":0,"outputs":2,"entityId":"input_boolean.door2","entityIdFilterType":"exact","property":"state","comparator":"is","value":"on","valueType":"str","timeout":"60","timeoutType":"num","timeoutUnits":"seconds","entityLocation":"data","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":610,"y":820,"wires":[["454975a5f389e688"],["6cb90d2f2529a442"]]},{"id":"6cb90d2f2529a442","type":"api-call-service","z":"ebaa69a9.649708","name":"Placeholder for package","server":"4bbca37b.1700ec","version":3,"debugenabled":false,"service_domain":"light","service":"toggle","entityId":"light.kokslampa","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":870,"y":820,"wires":[[]]},{"id":"454975a5f389e688","type":"debug","z":"ebaa69a9.649708","name":"Someone in family came home","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":890,"y":740,"wires":[]},{"id":"4bbca37b.1700ec","type":"server","name":"Home Assistant","version":1,"legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]