but I’d like to set it so that if the light is on and more movement is detected, the timer resets. Also at the moment the light turns off after 10 minutes but then if someone walks by straight after this the flow does not trigger and the light doesnt come on?
This is what I use. Not perfect but works most of the time. The State Node sends the payload message back into the loop if the motion sensor is ON other wise the State Node passes the payload to the switch and turns off the light. I have a door sensor that will block the payload if the bathroom door is closed so the light wont turn off if I am in the shower.
When motion is detected the trigger state node sends a message through the third output and turns on the light.
Every state change from the motion sensor is sent to the trigger node, that hold the message for 10 minutes, and resets the timer every time motion is detected.
I suppose this could fail if there was continual motion for 10 minutes, so an extra check of the motion detector status could be added before the switch off. In practice I’ve not needed that as even when we’re moving round the room there are sufficient pauses to trigger the sensor again.