Hue Motion Sensor Rule - Timer Problems

It is perhaps worth a little explaining here.
This line creates a timer and stores a handle, a reference to the timer, in the variable motion_timer_floor. That’s all.

There are non-obvious consequences to that.
If you run the line again, say two minutes later, it still does the same thing.
So the original 3-minute timer is still running in the background, and will go off and do whatever it was told.
But you’ve lost the handle to that timer, because you have overwritten your motion_timer_floor variable with a handle to a brand new timer.

If you need your rule to deal with existing timers, things like cancel or reschedule, you need to do it explicitly, and need the handle for that.
.
If you need your rule to check if a timer is already running before creating a new one (and I am certain that you do!), then again you must do explicitly in your code using the handle.

You might look over example rules again, paying attention to checks for handle===null tests, and when to set the handle null.