Try this
[{"id":"14824bc.042abb4","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"7d67af5c.419b7","type":"switch","z":"14824bc.042abb4","name":"","property":"topic","propertyType":"msg","rules":[{"t":"cont","v":"yourMotionItem","vt":"str"},{"t":"cont","v":"yourContactItem","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":290,"y":200,"wires":[["9b43469b.160dd8"],["fd027f8a.69699"]]},{"id":"9b43469b.160dd8","type":"switch","z":"14824bc.042abb4","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"neq","v":"yourMotionItem","vt":"flow"}],"checkall":"true","repair":false,"outputs":1,"x":490,"y":160,"wires":[["2a52616f.aa4bae"]]},{"id":"2a52616f.aa4bae","type":"change","z":"14824bc.042abb4","name":"","rules":[{"t":"set","p":"yourMotionItem","pt":"flow","to":"(\t if (payload.value < 39)\t)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":160,"wires":[["58ebd238.f8f04c"]]},{"id":"62ccf864.2e4878","type":"change","z":"14824bc.042abb4","name":"","rules":[{"t":"set","p":"yourContactItem","pt":"flow","to":"(\t if (payload.value != \"ON\")\t)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":240,"wires":[["58ebd238.f8f04c"]]},{"id":"fd027f8a.69699","type":"switch","z":"14824bc.042abb4","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"neq","v":"yourContactItem","vt":"flow"}],"checkall":"true","repair":false,"outputs":1,"x":490,"y":240,"wires":[["62ccf864.2e4878"]]},{"id":"58ebd238.f8f04c","type":"switch","z":"14824bc.042abb4","name":"","property":"(\t if (flow.yourMotionItem and flow.yourContactItem )\t)","propertyType":"jsonata","rules":[{"t":"true"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":990,"y":200,"wires":[["d2898229.8cb84"],["1944ac1c.950b14"]]},{"id":"d2898229.8cb84","type":"openhab2-out","z":"14824bc.042abb4","name":"","controller":"","itemname":"","topic":"ItemCommand","payload":"ON","x":1200,"y":160,"wires":[]},{"id":"1944ac1c.950b14","type":"openhab2-out","z":"14824bc.042abb4","name":"","controller":"","itemname":"","topic":"ItemCommand","payload":"OFF","x":1200,"y":240,"wires":[]},{"id":"5016f9a0.819e38","type":"comment","z":"14824bc.042abb4","name":"filter your items","info":"","x":280,"y":360,"wires":[]},{"id":"63b3cba.393f634","type":"comment","z":"14824bc.042abb4","name":"has it changed ?","info":"","x":520,"y":360,"wires":[]},{"id":"30252ce8.def2e4","type":"comment","z":"14824bc.042abb4","name":"Save value","info":"","x":720,"y":360,"wires":[]},{"id":"ba94b11c.17e83","type":"comment","z":"14824bc.042abb4","name":"Are the two values set ?","info":"","x":980,"y":360,"wires":[]},{"id":"bc7c0ea6.01904","type":"comment","z":"14824bc.042abb4","name":"Switch the light OFF","info":"","x":1390,"y":240,"wires":[]},{"id":"ae8c4b8b.fbb178","type":"comment","z":"14824bc.042abb4","name":"Switch the light ON","info":"","x":1390,"y":160,"wires":[]},{"id":"42c25e00.f297b","type":"openhab2-events","z":"14824bc.042abb4","name":"","controller":"","itemname":"","x":100,"y":200,"wires":[["7d67af5c.419b7"]]}]