A blueprint for triggering lights through motion detection when outdoor light level is low enough

Had been struggling to get this working reliably, so decided to share. I hope it’s useful for someone else as well.