This room lighting rule has been misbehaving for a while. It is a motion/contact-based rule. 90% of the time it works, but sometimes it will still shut off even if there is motion. and not turn back on for several minutes once it does. I'm sure I'm just missing something, but I'm just not sure what it is. Hoping a fresh set of eyes can see what I'm missing. Thanks!
Here are the settings for the motion sensor in the rule.






