Cam Pan schedule

Hey all. Just picked up a pan cam and was trying to figure out how to set up a schedule that automatically activates the pan function. The kicker is I only want the pan function to pan during certain situations. After bed it pans to predetermined waypoints until morning. But during the day it is stationary on one fixed point.