Home assistant motion sensor lighting

Good evening all,

Since this week I switched everything over to home assistant. I am now having problems with my motion sensors and my lights. Turning on the lights goes well. Only with going out the problems come. Even though I am still near the sensor the lights go off and do not come back on. I have to leave the room and come back. When everything was still set in the HUE app or HomeKit set I didn’t have these problems. The bulbs and sensors are from Philips HUE. Below is the automation.

Am I doing something wrong?