For any one looking for a non python way this is what I did, has been working for at least a year reliably.
[{"id":"560a48e311b7eb68","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"5c2db089c40906f7","type":"stoptimer","z":"560a48e311b7eb68","duration":"20","units":"Minute","payloadtype":"num","payloadval":"0","name":"","x":460,"y":200,"wires":[["5f0b738695627d36","8aea4325d5c1efcd"],[]]},{"id":"5f0b738695627d36","type":"api-current-state","z":"560a48e311b7eb68","name":"Shop Motion","server":"1f07ad34.678b53","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.shop_motion_occupancy","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"x":450,"y":300,"wires":[["5c2db089c40906f7"],["05d5265c633fdc53"]]},{"id":"05d5265c633fdc53","type":"api-call-service","z":"560a48e311b7eb68","name":"shop lights off","server":"1f07ad34.678b53","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.shp_lights","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":680,"y":220,"wires":[[]]},{"id":"9e0ec0746592f426","type":"api-call-service","z":"560a48e311b7eb68","name":"shop lights on","server":"1f07ad34.678b53","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.shp_lights","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":680,"y":140,"wires":[[]]},{"id":"fffc264821afe1b2","type":"server-state-changed","z":"560a48e311b7eb68","name":"shop motion","server":"1f07ad34.678b53","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.shop_motion_occupancy","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"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":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":230,"y":200,"wires":[["247c114b9cd7f03c"]]},{"id":"dcf42bac9c0e9e5c","type":"server-state-changed","z":"560a48e311b7eb68","name":"Shop Motion 2","server":"1f07ad34.678b53","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.shop_motion_2_occupancy","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"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":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":210,"y":280,"wires":[["247c114b9cd7f03c"]]},{"id":"8aea4325d5c1efcd","type":"api-current-state","z":"560a48e311b7eb68","name":"Shop motion 2","server":"e173a2fc.b1fb3","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.shop_motion_2_occupancy","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":440,"y":380,"wires":[["5c2db089c40906f7"],["05d5265c633fdc53"]]},{"id":"247c114b9cd7f03c","type":"switch","z":"560a48e311b7eb68","name":"On/Off","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":410,"y":140,"wires":[["9e0ec0746592f426"],["5c2db089c40906f7"]]},{"id":"1f07ad34.678b53","type":"server","name":"Home Assistant","version":1,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true},{"id":"e173a2fc.b1fb3","type":"server","name":"Home Assistant","version":1,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]