Motion sensor and light

Hey all. I need little help with my node red automation. I have motion sensor in my bathroom. If motion is detect, turned light on and if no motion detect for 10min then turned light off. This works fine.
light off after 10min of no motion
I came to the bathoom again 9min59sec after last motion and light turned off
And this is my problem
Light dont turned on if motion is detect at this moment and i dont know why
Some ideas?
Sorry for my english, i speak only czech and little bit of english as you probably see :wink: