Troubleshooting a specific flow to mimic philips hue, or make a better way to do it?

the philips hue indoor sensors that push as soon as motion is detected