void Start() {
Off(All);
DateTime now = DateTime.Now; //get the current time
//The DateTime constructor goes (YYY, MM, HH, SS)
//Start and End time - Midnight to 5:00 pm - All Off
DateTime start0 = new DateTime(now.Year, now.Month, now.Day, 00,00,00);
DateTime end0 = new DateTime(now.Year, now.Month, now.Day, 17, 00, 00);
//Start and End time 5:00 - 6:00pm - Basic Lights
DateTime start1 = new DateTime(now.Year, now.Month, now.Day, 16, 25, 00);
DateTime end1 = new DateTime(now.Year, now.Month, now.Day, 18, 00, 00);
//Start and End time 6:00 pm - 10:30 pm - Main Background Sequence
DateTime start2 = new DateTime(now.Year, now.Month, now.Day, 18, 00, 00);
DateTime end2 = new DateTime(now.Year, now.Month, now.Day, 22, 30, 00);
//Start and End time 10:30 pm - 12:00 am - Good Night Sequence
DateTime start3 = new DateTime(now.Year, now.Month, now.Day, 22, 30, 00);
DateTime end3 = new DateTime(now.Year, now.Month, now.Day, 00, 00, 00);
//Variable Declaration
//****Channel Specific****
ChannelCollection WhtTree;
ChannelCollection RedTree;
ChannelCollection BluTree;
ChannelCollection GrnTree;
ChannelCollection SingingSanta;
ChannelCollection Arches;
ChannelCollection Eve;
ChannelCollection Candy;
ChannelCollection Deer;
ChannelCollection SantaLgt_Proj_BlowUp_Motion;
ChannelCollection Branches;
//Channel selection of loads - All from this profile
WhtTree = Channels(Wht1,Wht2,Wht3,Wht4,Wht5);
RedTree = Channels(Red1,Red2,Red3,Red4,Red5);
BluTree = Channels(Blue1,Blue2,Blue3,Blue4,Blue5);
GrnTree = Channels(Grn1,Grn2,Grn3,Grn4,Grn5);
SingingSanta = Channels(Santa);
Arches = Channels(HouseRArch,HouseLArch,GarageLArch,GarageRArch);
Eve = Channels(EveLgts);
Candy = Channels(CandyCanes);
Deer = Channels(DoeLgts,BuckLgts);
SantaLgt_Proj_BlowUp_Motion = Channels(SantaLgt,Projector,BlowUp,DeerMotion);
Branches = Channels(Twigs);
//Time Zone Zero
while (now.CompareTo(start0)>= 0 && now.CompareTo(end0) <= 0)
{
Off(All);
now = DateTime.Now; //update the current time
}
//Time Zone One
while (now.CompareTo(start1) >= 0 && now.CompareTo(end1) <= 0)
{
On(SingingSanta);
On(SantaLgt_Proj_BlowUp_Motion);
now = DateTime.Now; // update the current time
}
//Time Zone Two
while (now.CompareTo(start2) >= 0 && now.CompareTo(end2) <= 0)
{
On(SingingSanta);
On(SantaLgt_Proj_BlowUp_Motion);
On(EveLgts);
Random(Channels(HouseRArch,HouseLArch,GarageLArch,GarageRArch), 75, Over(20).Second, Wait);
On(Branches);
On(Deer, At(30)); //Deer on at 30%
On(Candy);
Ramp(WhtTree, 100, 0, Over(5).Second, Wait);
Ramp(WhtTree, 0, 100, Over(5).Second, Wait);
Ramp(RedTree, 100, 0, Over(5).Second, Wait);
Ramp(RedTree, 0, 100, Over(5).Second, Wait);
Ramp(BluTree, 100, 0, Over(5).Second, Wait);
Ramp(BluTree, 0, 100, Over(5).Second, Wait);
Ramp(GrnTree, 100, 0, Over(5).Second, Wait);
Ramp(GrnTree, 0, 100, Over(5).Second, Wait);
now = DateTime.Now; //update current time
}
//Time Zone Three
while (now.CompareTo(start3) >= 0 && now.CompareTo(end3) <= 0)
{
On(SantaLgt_Proj_BlowUp_Motion);
On(Deer, At(30));
On(Branches);
now = DateTime.Now; //update current time
}
}