There's a couple things that you have to address here. First is the cancelation of the delay. You are not going to cancel the delay until after the lights turn off. That is because you have the cancel nested under the PB being True. So, to address this, I would remove the PB and instead have the rule structured like so:
Trigger: Any motion changed
Action:
If Any motion active
Cancel Delay Actions
If all lights are off
Turn lights on
End-If
Else-If All motion inactive
Delay by 10 minutes with cancel
Turn lights off
End-If
This will get the lights to only change settings if they are off and also still cancel turning the lights on if motion is still detected within the 10 minutes. For rooms like the family room or Kitchen, where you have long periods where you might not move much, I also have my delays be contingent on what lights are on. For example, in my kitchen, if the dining area light is on it takes 30 minutes for the lights to time out. But if just the overhead is on, it only takes 5. You could do the same if you have your family room lights low for watching TV (when you don't move much, like this:
Trigger: Any motion changed
Action:
If Any motion active
Cancel Delay Actions
If all lights are off
Turn lights on
End-If
Else-If All motion inactive
If lights on AND dim level < 50
Delay by 30 minutes with cancel
Else- If lights on and dim level >= 50
Delay by 10 minutes with cancel
End-If
Turn lights off
End-If
I would have the second if to ALL lights are off. That way, it won't continue to change them if you turn either of the lamps on.
Also, I was using shorthand when I said "turn on the lights". You can use whatever command you want: Dim to level or set color temp....whatever you want.
Also you don't want the else-if to be "ANY inactive". You want it to be ALL inactive.
Maybe a little off topic but I have a "newbie" question. How did you get that view that looks like you single stepped through the rule? Is this an RM4 addition?
Was that directed to me? If you're asking me how I got that view, it's simply using the "format as code" in the forum. This icon:
If you don't, it won't put spaces in at the beginning of a line. So, this is how it looks without applying that formatting.
Trigger: Any motion changed
Action:
If Any motion active
Cancel Delay Actions
If all lights are off
Turn lights on
End-If
Else-If All motion inactive
If lights on AND dim level < 50
Delay by 30 minutes with cancel
Else- If lights on and dim level >= 50
Delay by 10 minutes with cancel
End-If
Turn lights off
End-If
See, it left justifies all of the text even though there are spaces in front of those lines in the version in the editor.
Are you able to turn the lamps on and off via the edit device page? Trip motion for the sensors again, then let it go into inactive and show the rule properties page (the cog wheel). You should see a scheduled task for the delay.
Never mind. I see your problem. Your trigger is incorrect.
If you notice, I said motion CHANGES. Not active. You have to also trigger the rule when the motion becomes inactive. Otherwise the lights won't turn off. Take a closer look at what I posted and make sure that it matches.