You got it almost.
If I push the button, the light should turn on for 5min and after that it goes off.
If within 5min someone push the button again, it should turns off and will react to motion (on goes off if no motion detects within 45 s)
Here is the current code:
[{"id":"af7416ee.37c178","type":"tab","label":"Deckenlampe Flur","disabled":false,"info":""},{"id":"1c73597d.5bfbdf","type":"switch","z":"af7416ee.37c178","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":650,"y":200,"wires":[["cb6dcae0.000078"],["bff73bf3.6b1518"]]},{"id":"94211752.509d4","type":"api-call-service","z":"af7416ee.37c178","name":"Tag ","server":"818794df.29c548","version":3,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.deckenlampe_flur","data":"{\"brightness_pct\":100}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1410,"y":40,"wires":[["bff73bf3.6b1518"]]},{"id":"20686e7d.bb3402","type":"api-call-service","z":"af7416ee.37c178","name":"","server":"818794df.29c548","version":3,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.deckenlampe_flur","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1450,"y":360,"wires":[[]]},{"id":"bff73bf3.6b1518","type":"trigger","z":"af7416ee.37c178","name":"","op1":"","op2":"off","op1type":"nul","op2type":"str","duration":"45","extend":false,"overrideDelay":false,"units":"s","reset":"true","bytopic":"all","topic":"topic","outputs":1,"x":1130,"y":300,"wires":[["20686e7d.bb3402"]]},{"id":"5f545cca.2c7614","type":"trigger-state","z":"af7416ee.37c178","name":"","server":"818794df.29c548","version":0,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"binary_sensor.flur_bewegungsmeldung_occupancy","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":"is","comparatorValueDatatype":"bool","comparatorValue":"true","propertyValue":"new_state.state"},{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":"is","comparatorValueDatatype":"bool","comparatorValue":"false","propertyValue":"new_state.state"}],"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"habool","x":290,"y":200,"wires":[["1c73597d.5bfbdf"],["1c73597d.5bfbdf"]]},{"id":"fb93c45b.161b9","type":"trigger","z":"af7416ee.37c178","name":"","op1":"","op2":"1","op1type":"nul","op2type":"str","duration":"1","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":380,"y":440,"wires":[["a5ad5640.15adc"]]},{"id":"cb6dcae0.000078","type":"time-range-switch","z":"af7416ee.37c178","name":"Tag 6:30-23:00","lat":"","lon":"","startTime":"6:30","endTime":"23:00","startOffset":0,"endOffset":0,"x":1120,"y":80,"wires":[["9fb2b808.a5a8b8"],["69b2e451.820ab4"]]},{"id":"69b2e451.820ab4","type":"api-call-service","z":"af7416ee.37c178","name":"Nacht","server":"818794df.29c548","version":3,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.deckenlampe_flur","data":"{\"brightness_pct\":30}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1410,"y":160,"wires":[["bff73bf3.6b1518"]]},{"id":"3ae1175c.893398","type":"api-call-service","z":"af7416ee.37c178","name":"Tag ","server":"818794df.29c548","version":3,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.flur_deckenlampe","data":"{\"brightness_pct\":100}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":770,"y":380,"wires":[[]]},{"id":"679b5aff.b6b4dc","type":"api-call-service","z":"af7416ee.37c178","name":"Nacht","server":"818794df.29c548","version":3,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.flur_deckenlampe","data":"{\"brightness_pct\":30}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":770,"y":500,"wires":[[]]},{"id":"a5ad5640.15adc","type":"time-range-switch","z":"af7416ee.37c178","name":"Tag 6:30-23:00","lat":"","lon":"","startTime":"6:30","endTime":"23:00","startOffset":0,"endOffset":0,"x":580,"y":440,"wires":[["3ae1175c.893398"],["679b5aff.b6b4dc"]]},{"id":"d90859a9.395268","type":"server-state-changed","z":"af7416ee.37c178","name":"Deckenlampe Flur","server":"818794df.29c548","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"light.deckenlampe_flur","entityidfiltertype":"exact","outputinitially":false,"state_type":"habool","haltifstate":"true","halt_if_type":"bool","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":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":150,"y":440,"wires":[["fb93c45b.161b9"],[]]},{"id":"9fb2b808.a5a8b8","type":"api-current-state","z":"af7416ee.37c178","name":"< 30 lx","server":"818794df.29c548","version":2,"outputs":2,"halt_if":"30","halt_if_type":"num","halt_if_compare":"lt","entity_id":"sensor.flur_bewegungsmeldung_illuminance","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":1290,"y":60,"wires":[["94211752.509d4"],[]]},{"id":"818794df.29c548","type":"server","name":"Home Assistant","version":1,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]