There are already countless examples here in the forum, I also wrote about this yesterday in the linked post: Slow Flow - #20 by DirkG
However, these flows only work if the Motion Sensor frequently detects more or less significant movements.
There are also so-called Presence Sensors available which register even the smallest movements, e.g. the SONOFF Zigbee Human Presence Sensor (SNZB-06P).
But of course, it depends on the use case if a Motion Sensor or a Presence Sensor is the better solution.