I have several rules for time-slot & motion based lighting, all build the same way.
Works like a charm, expept for my kitchen lights.
I want the lights to fade in on motion, and turn off if no motion in X time.
What I see is that the lights turn on after 24:00 on motion, but turns of after X amount of time even if there is motion.
Example: Middle of the night, I go downstairs, walk into the kitchen, lights fade in. Smoke a sigaret while in the kitchen standing still. Move again after one minute, but after two minutes the lights turn off, and stay off even if there is motion again. Then after about a minute, the motion is picked up again, and the lights fade in again.
What I want is: motion > lights on > keep lights on for X amount if time > if again motion, reset the X timer > if no motion during X timer > fade off lights to 0.
Based on how you describe it sounds like your time to turn off lights is to short for the cool down period of your motion sensor. What if you extend your period of time out before it turns off with no motion. Does that make a difference.
What happens if you change your rule to the following.
ELSE-IF
Time between xx and y THEN
Set Color
wait for event
Dim xxx delayed 0:02:00 (cancelable)
In other words remove your delay statement and move the delay (canceable) to the actual dimming of the light to 0.
Seems more logical to me.
As I went back and looked at this again i also think what @bobbles is saying here is a good idea. You have two delay statements which makes the math for cooldown a little wonky.
Verify your cool down period for your motion sensor. You may want to just scan through the device events page and see what is the quickest amount of time during the day you see it go back to a active state. I also don't even have a wait for event state of inactive in my rules. just make sure you set your delay some portion above your motion sensor cool down. Like if it is 5 min set it to 7-10 min minimum.
Ok, tested.
When I remove the second wait, I see the following:
Motion > 30 seconds cooldown of sensor > no motion > dim down.
So you have to keep moving every 30 seconds, or the light wil dim down.