Help with a rule

so i need a little help if possible,
i have a weird rule im trying to get to work and it works almost right but doesn't turn off the light if no motion is present.

so the idea is if a door or motion is open/detected the light comes on ant 50% and 8000k. then it stays on until the door has closed and/or the motion has no motion. "just in case someone dont close the door" i got two rules tring to do this only one is a ctive at a time tho, just so thats clear.. here is a screenshot..

i hope this helps and you can understand it. in basic rule machine it works but again it dosnt want to turn off

Look at basic rules and or motion lighting apps one of those can probably can do what you want and it will basically step you through the process.

Your current rule will only turn on the light if the door is open and motion is active. That is the first condition in your rule. So if those are not true then nothing happens. If they are true then the second part is not so it will do nothing.

The second IF is nested so it will never do anything as it will only be evaluated if the opposite is true in the first place. You could make this an ELSE and have both the triggers as changed.
You also have the issue that the lights will never turn off if the door is open as you as the you need both the door to be closed and motion inactive.

Motion lighting is the easiest way to do what you want so maybe check it out.

Probably want to ditch the IF statement in actions, and instead use wait-for-event. Something like this.

I would recommend using Zone Motions Controllers instead of the motion sensor directly.
You will be able to adjust the activity timeout.
I found out the hard way.

Ok cheers guys I'll give this a go. You are right it don't turn off. I'll change it and post results won't be till Monday sometime I'm away now. Cheers for the reply