The light is on as long as there is movement in the room with a motion sensor

Hi Joar and welcome!

I don’t use the CountDown App, but I rebuild the first row of your flow with the Chronograph App:

So if motion is detected (card #1) then stop countdown. But if no countdown is running, which will be definitely the case if the ms detects the first time motion, then the flow stops.

It is a very old topic, but you can still use these flows as a basis: