This one is the same as the first one but more obvious. I leave it here for you to have more options
[{"id":"d450b0b0.8e603","type":"server-state-changed","z":"937ef78.ec6b408","name":"Motion on?","server":"9405c3fe.d0a6c","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.your_sensor","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":[],"x":160,"y":200,"wires":[["1c13743d.92bedc"],[]]},{"id":"1c13743d.92bedc","type":"api-call-service","z":"937ef78.ec6b408","name":"Light on","server":"9405c3fe.d0a6c","version":3,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.your_light","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":360,"y":200,"wires":[[]]},{"id":"883a5f49.bbf83","type":"server-state-changed","z":"937ef78.ec6b408","name":"Motion off for 100 seconds?","server":"9405c3fe.d0a6c","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.your_sensor","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"off","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"100","forType":"num","forUnits":"seconds","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[],"x":220,"y":280,"wires":[["6c2559c1.8c0f68"],[]]},{"id":"6c2559c1.8c0f68","type":"api-call-service","z":"937ef78.ec6b408","name":"Light off","server":"9405c3fe.d0a6c","version":3,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.your_light","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":440,"y":280,"wires":[[]]},{"id":"9405c3fe.d0a6c","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]
which turns out to be the same as this:
[{"id":"1c13743d.92bedc","type":"api-call-service","z":"937ef78.ec6b408","name":"Light on","server":"9405c3fe.d0a6c","version":3,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.your_light","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":460,"y":300,"wires":[[]]},{"id":"883a5f49.bbf83","type":"server-state-changed","z":"937ef78.ec6b408","name":"Motion off for 100 seconds?","server":"9405c3fe.d0a6c","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.your_sensor","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"off","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"100","forType":"num","forUnits":"seconds","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":220,"y":280,"wires":[["6c2559c1.8c0f68"],["1c13743d.92bedc"]]},{"id":"6c2559c1.8c0f68","type":"api-call-service","z":"937ef78.ec6b408","name":"Light off","server":"9405c3fe.d0a6c","version":3,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.your_light","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":460,"y":260,"wires":[[]]},{"id":"9405c3fe.d0a6c","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]
If you go one step further in compacting you end up with the first example I put you above. Using the state of the binary_sensor (payload) to set the light’s service. All three will work just as well though.