Pet proof motion detection lighting

So I’ve been playing with my SmartApp, but Im unable to get to functioning efficiently for your needs (sorry I’m just earning to code this myself). I would suggest looking at SmartRules which should be able to perform most of what you need. The app cannot yet schedule off after x # of minutes, but the dev says it coming soon.