/* ** General */ final Time SunRise = "R-0"; final Time SunSet = "S-0"; /* ** X10 */ final X10Code dl = "A/1"; // Desklamp (Used for experimenting) final X10Code DeskLamp = "A/1"; // Desklamp (Used for experimenting) final X10Code Hutch = "A/2"; // TV hutch in the Livingroom final X10Code TV = "A/16"; // TV in the closet final X10Code Bench = "B/1"; // X10 outlet behind the bench final X10Code StTv = "B/2"; // Hutch lamps in the Study (Future) final X10Code Pump = "C/1"; // Water fountain in the CR final X10Code Outlet = "C/2"; // Outlet in the computer room final X10Code Therm = "C/16"; // Computer room themostat final X10Code Halloween = "O/1"; // Halloween pumpkin in study final X10Code Xmas = "O/1"; // Christmas lights around the house final X10Code Xmas1 = "O/1"; // Christmas lights around the house final X10Code Xmas2 = "O/2"; // Christmas lights around the house final X10Code Xmas3 = "O/3"; // Christmas lights around the house final X10Code Xmas4 = "O/4"; // Christmas lights around the house final X10Code Xmas5 = "O/5"; // Christmas lights in my computer room final X10Code Garage = "M/2"; // Garage, front X10 outlet (by Garage door). final X10Code Attic = "N/1"; // Garage attic final X10Code fp = "O/14"; // Garage outside driveway light final X10Code FrontPorch = "O/14"; // Garage outside driveway light final X10Code Stereo = "P/16"; // Macro for Stereo final X10Code VolDown = "P/21"; // Macro to turn down the volume final X10Code VolUP = "P/22"; // Macro to turn up the volume final X10Code StereoCmd = "P/15"; // Macro for Pause & Mute /* ** IR */ final Number Power = 1; final Number Tape = 2; final Number CD = 3; final Number Tuner = 4; final Number Aux = 5; final Number VolMinus = 6; final Number VolPlus = 7; final Number Mute = 8; final Number Pause = 9; // < Pause V final Number Stop = 10; // * Stop final Number Play = 11; final Number Reverse = 12; // << final Number Forward = 13; // >> /***************************************************************************** if X10 P/16 Turns On // Use x10 P16 as CD Then Transmit Infra-Red #3 // No need for ON just send CD (IR3) Then Transmit Intra-Red #11 // IR11 = Play if X10 P/16 Turns Off // Use X10 P16 as Stereo Then Transmit Intra-Red #1 // IR1 = On/Off if X10 P/21 is received && X10 P16 is On // Any Px DIM will lower the volume Then Transmit Infra-Red #6 // Vol(-) (First displays volume level) Then Transmit Infra-Red #6 // Vol(-) (Second lowers volume) if X10 P/22 is received && X10 P16 is On // Any Px DIM will raise the volume Then Transmit Infra-Red #7 // Vol(+) (First displays volume level) Then Transmit Infra-Red #7 // Vol(+) (Second raises volume) if X10 P/15 On Command // Mute Then Transmit Infra-Red #8 if X10 P/15 Off Command // Pause Then Transmit Infra-Red #9 if Time of Day = Sunset + 0 minutes // Christmas Decorations Then Transmit X10 O/1 Then Transmit X10 O/2 Then Transmit X10 O/3 Then Transmit X10 O/4 Then Transmit X10 O/5 Then Transmit X10 O/19 Then turn X10 O/5 ON Then turn X10 B/1 IN if Time of Day = Sunrise + 0 minutes // Christmas Decorations Then Transmit X10 O/1 Then Transmit X10 O/2 Then Transmit X10 O/3 Then Transmit X10 O/4 Then Transmit X10 O/5 Then Transmit X10 O/20 Then turn X10 O/5 OFF Then turn X10 B/1 OFF Then Transmit Ascii String #1 End of Program *****************************************************************************/ void run() { // cdon if(cpuxa.x10State(Stereo, TurnsOn)) { // X10 P16 as CD/Stereo cpuxa.xmitIR(CD); cpuxa.xmitIR(Play); } // cdoff if(cpuxa.x10State(Stereo, TurnsOff)) { // X10 P16 as CD/Stereo cpuxa.xmitIR(Power); } // voldown if(cpuxa.recvX10(VolDown) && cpuxa.x10State(Stereo, IsOn)) { // cpuxa.xmitIR(VolMinus); cpuxa.xmitIR(VolMinus); } // volup if(cpuxa.recvX10(VolUP) && cpuxa.x10State(Stereo, IsOn)) { // cpuxa.xmitIR(VolPlus); cpuxa.xmitIR(VolPlus); } // mute // First time sent it mutes // Second time sent it un-mutes if(cpuxa.x10State("P/15", OnCmdPair)) { cpuxa.xmitIR(Mute); } // pause // First time sent it pause // Second time sent it unpauses if(cpuxa.x10State("P/15", OffCmdPair)) { cpuxa.xmitIR(Pause); } if(time == SunRise) { // Sunrise - 0 Minutes cpuxa.xmitX10(Xmas1); cpuxa.xmitX10(Xmas2); cpuxa.xmitX10(Xmas3); cpuxa.xmitX10(Xmas4); cpuxa.xmitX10(Xmas5); cpuxa.xmitX10("O/20"); cpuxa.x10QuickOff(Xmas1); cpuxa.x10QuickOff("B/5"); cpuxa.sendAscii(1); } if(time == SunSet) { // Sunset + 0 Minutes cpuxa.xmitX10(Xmas1); cpuxa.xmitX10(Xmas2); cpuxa.xmitX10(Xmas3); cpuxa.xmitX10(Xmas4); cpuxa.xmitX10(Xmas5); cpuxa.xmitX10("O/19"); cpuxa.x10QuickOn(Xmas1); cpuxa.x10QuickOn("B/5"); } }