First thank you for posting this! As a new user i'm looking to accomplish this same thing. My goal is to have the motion sensor in a scene with my dimmer switch for instant activation, but I only want the motion sensor to toggle the switch on from sunset to sunrise. During the day I don't want the light turning on automatically. I understand the time logic however I'm not able to decipher how you entered some of these variables. In the top screenshot for program "Basic Light Levels" with "$LightLevelBackPatio = 100" - is this an integer variable created under Programs > Variables > Integer?
For the 2nd screenshot calling the "set scene" command: I've been completely unable to replicate this syntax. I'm unable to figure out any way of inserting any of the "$lightLevel" options. Are you creating these lines with Action > Adjust Scene or some other way? I greatly appreciate any help!