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}]