You can use a history node with a switch
[{"id":"79e47c8f918e7911","type":"inject","z":"f80b6c338afd5483","name":"door sensor","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":2660,"wires":[["5bfbe652ebf70ed6"]]},{"id":"5bfbe652ebf70ed6","type":"api-get-history","z":"f80b6c338afd5483","name":"","server":"6b1110b5.183a4","version":0,"startdate":"","enddate":"","entityid":"binary_sensor.motion","entityidtype":"is","useRelativeTime":true,"relativeTime":"5min","flatten":true,"output_type":"split","output_location_type":"msg","output_location":"payload","x":370,"y":2660,"wires":[["42380187e6d0017d"]]},{"id":"42380187e6d0017d","type":"switch","z":"f80b6c338afd5483","name":"","property":"payload.state","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":570,"y":2660,"wires":[["6977a8432bfe3bcf"],["20bb073f12b0f1f5"]]},{"id":"6977a8432bfe3bcf","type":"debug","z":"f80b6c338afd5483","name":"motion on do something","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":880,"y":2620,"wires":[]},{"id":"20bb073f12b0f1f5","type":"debug","z":"f80b6c338afd5483","name":"motion off do something","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":890,"y":2680,"wires":[]},{"id":"6b1110b5.183a4","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"}]
Sorry that only works if you are looking for the on message to do something. Using a trigger node for the door can be disabled by the motion detector for 5 min.
[{"id":"9b8896881b9fb686","type":"server-state-changed","z":"f80b6c338afd5483","name":"","server":"6b1110b5.183a4","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binsry_sensor.motion","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"date"}],"x":220,"y":3340,"wires":[["c6ba48847c065006"],[]]},{"id":"245baa783e2ea025","type":"trigger-state","z":"f80b6c338afd5483","name":"","server":"6b1110b5.183a4","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"sensor.door","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"on"}],"inputs":1,"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","enableInput":true,"x":830,"y":3340,"wires":[[],[]]},{"id":"c6ba48847c065006","type":"trigger","z":"f80b6c338afd5483","name":"","op1":"DISABLE","op2":"ENABLE","op1type":"str","op2type":"str","duration":"5","extend":true,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":550,"y":3340,"wires":[["245baa783e2ea025"]]},{"id":"6b1110b5.183a4","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"}]