home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / UTILS2 / X10XA2.ZIP / XA.CMD < prev    next >
OS/2 REXX Batch file  |  1994-01-15  |  10KB  |  257 lines

  1. DISPLAY OFF
  2. #
  3. #  ┌──────────────────────────────────────────────────────────────────┐
  4. #  │                                                                  │
  5. #  │   XA - X10 Command Interpreter for the CP-290 - Version 2.1      │
  6. #  │  Copyright 1991-1994 by Bruce Christensen. All Rights Reserved.  │
  7. #  │                                                                  │
  8. #  └──────────────────────────────────────────────────────────────────┘
  9. #
  10. #──────────────────────────────────────────────────────────────────────────────
  11. #
  12. #
  13. #    IF NONE OF THIS MAKES SENSE....
  14. #                                   ....READ THE MANUAL (XA_201.TXT)
  15. #
  16. #
  17. #──────────────────────────────────────────────────────────────────────────────
  18. #
  19.  
  20. # * * * * * * * * * * *   SHAREWARE VERSION   * * * * * * * * * * * * * * * *
  21. #
  22. # IF/ELSE/ENDIF, VARIABLES, LOGICAL-BOOLEAN-ARITHMETIC LOGIC HAS BEEN
  23. # DISABLED FROM THE SHAREWARE VERSION. YOU MUST REGISTER THIS SOFTWARE
  24. # TO HAVE THESE FEATURES ACTIVATED.
  25. #
  26. # You can pass arguments to a command file and have it react accordingly. 
  27. # If you pass a non-zero variable and test it with the IF statement, it will 
  28. # result in a TRUE condition. For example:
  29. #       XA f=xa.cmd "vacation = 1"
  30. # IF (vacation)
  31. #  DISPLAY ON
  32. #  Security_Lights ON TIME 9:30 PM RANDOM 15 TODAY
  33. #  Security_Lights OFF TIME 10:30 PM RANDOM 15 TODAY
  34. #  DISPLAY OFF
  35. #
  36. # ELSE                    # Do all the other things...
  37.  
  38. #
  39. #──────────────────────────────────────────────────────────────────────────────
  40. #
  41. #    Produce a report file listing events for each day. Use REPORT1 to
  42. #    generate a listing events in the order they occur for each day. 
  43. #    Use REPORT2 to list events for each day by module.
  44.  
  45. REPORT1
  46.  
  47. #  
  48. #──────────────────────────────────────────────────────────────────────────────
  49. #
  50. #    The next token (ERASE) will remove all events from the CP-290
  51. #    memory. You are advised to use this when you use the DATE token for
  52. #    programming specific events. This ensures that when the event has
  53. #    passed, it will be deleted. Since every one of your events should
  54. #    be included in this file, there is no need to worry about erasing them
  55. #    now...they will be downloaded automatically.
  56.  
  57. ERASE
  58.  
  59. #
  60. #──────────────────────────────────────────────────────────────────────────────
  61. #
  62. #    Set the X10 clock to the time and date of your PC's internal clock.
  63. #    Use the optional "EXACT" token to wait for the seconds counter to
  64. #    rollover to 0.
  65.  
  66. SYNCHRONIZE X10 EXACT
  67.  
  68. #
  69. #──────────────────────────────────────────────────────────────────────────────
  70. #
  71. #    Set the PC clock to the time of your X10's internal clock.
  72. #    Use the optional "EXACT" token to wait for the seconds counter to
  73. #    rollover to 0.
  74. #
  75. #    Note: There is not enough information from the X10 to set the date.
  76.  
  77. #SYNCHRONIZE PC EXACT
  78.  
  79. #
  80. #──────────────────────────────────────────────────────────────────────────────
  81. #
  82. #    The following are a set of commands that are downloaded weekly. See the
  83. #    documentation for full details - but here's a synopsis:
  84. #    Every Sunday morning at 3:00, the computer is turned on via X10. As
  85. #    DOS executes AUTOEXEC.BAT, a utility supplied with this package,
  86. #    POWERUP.EXE will return an ERRORLEVEL of 1 if the current time is
  87. #    within a range that you specify. This errorlevel can then be used to 
  88. #    invoke XA.EXE to download another weeks worth of events, or you can use
  89. #    it to call other programs as well, for instance: backup programs, 
  90. #    communications, etc. See the documentation for more details.
  91. #    
  92. #    Note the use of the SUNRISE and SUNSET tokens. These tokens will 
  93. #    calculate the exact time of sunrise or sunset for your city assuming 
  94. #    LATITUDE, LONGITUDE, and TIMEZONE were all entered correctly. 
  95. #    This avoids having to constantly enter a new time for your outdoor lights.
  96.  
  97. DISPLAY ON
  98.  
  99. #INCLUDE INC1.CMD               # Include other command files...
  100.  
  101. #    Sunday's events:
  102.  
  103. LIVING_ROOM_LAMP        OFF     SUNDAY  TIME 11:30 PM
  104. LIVING_ROOM_LAMP        ON      SUNDAY  SUNSET OFFSET -1:00
  105. FAMILY_ROOM_LAMP        ON      SUNDAY  SUNSET OFFSET -1:00
  106. FAMILY_ROOM_LAMP        OFF     SUNDAY  TIME 11:30 PM
  107. BEDROOM_LIGHT           ON      SUNDAY  TIME 10:30 PM RANDOM +15
  108. BEDROOM_LIGHT           OFF     SUNDAY  TIME 1:30 AM
  109. OUTSIDE_PORCH_LIGHTS    DIM 80  SUNDAY  SUNSET
  110. OUTSIDE_PORCH_LIGHTS    OFF     SUNDAY  TIME 10:35 PM RANDOM +15
  111.  
  112.  
  113. #    Monday's events:
  114.  
  115. LIVING_ROOM_LAMP        ON      MONDAY  SUNSET OFFSET -1:00
  116. LIVING_ROOM_LAMP        OFF     MONDAY  TIME 11:30 PM
  117. FAMILY_ROOM_LAMP        ON      MONDAY  SUNSET OFFSET -1:00
  118. FAMILY_ROOM_LAMP        OFF     MONDAY  TIME 11:30 PM
  119. BEDROOM_LIGHT           ON      MONDAY  TIME 10:30 PM RANDOM +15
  120. BEDROOM_LIGHT           OFF     MONDAY  TIME 1:30 AM
  121. OUTSIDE_PORCH_LIGHTS    DIM 80  MONDAY  SUNSET
  122. OUTSIDE_PORCH_LIGHTS    OFF     MONDAY  TIME 10:35 PM RANDOM +15
  123.  
  124. #    Tuesday's events:
  125.  
  126. LIVING_ROOM_LAMP        ON      TUESDAY SUNSET OFFSET -1:00
  127. LIVING_ROOM_LAMP        OFF     TUESDAY TIME 11:30 PM
  128. FAMILY_ROOM_LAMP        ON      TUESDAY SUNSET OFFSET -1:00
  129. FAMILY_ROOM_LAMP        OFF     TUESDAY TIME 11:30 PM
  130. BEDROOM_LIGHT           ON      TUESDAY TIME 10:30 PM RANDOM +15
  131. BEDROOM_LIGHT           OFF     TUESDAY TIME  1:30 AM
  132. OUTSIDE_PORCH_LIGHTS    DIM 80  TUESDAY SUNSET
  133. OUTSIDE_PORCH_LIGHTS    OFF     TUESDAY TIME 10:35 PM RANDOM +15
  134.  
  135. #    Wednesday's events:
  136.  
  137. LIVING_ROOM_LAMP        ON      WED   SUNSET OFFSET -1:00
  138. LIVING_ROOM_LAMP        OFF     WED   TIME 11:30 PM
  139. FAMILY_ROOM_LAMP        ON      WED   SUNSET OFFSET -1:00
  140. FAMILY_ROOM_LAMP        OFF     WED   TIME 11:30 PM
  141. BEDROOM_LIGHT           ON      WED   TIME 10:30 PM RANDOM +15
  142. BEDROOM_LIGHT           OFF     WED   TIME  1:30 AM
  143. OUTSIDE_PORCH_LIGHTS    DIM 80  WED   SUNSET
  144. OUTSIDE_PORCH_LIGHTS    OFF     WED   TIME 10:35 PM RANDOM +15
  145.  
  146. #    Thursday's events:
  147.  
  148. LIVING_ROOM_LAMP        ON      THU   SUNSET OFFSET -1:00
  149. LIVING_ROOM_LAMP        OFF     THU   TIME 11:30 PM
  150. FAMILY_ROOM_LAMP        ON      THU   SUNSET OFFSET -1:00
  151. FAMILY_ROOM_LAMP        OFF     THU   TIME 11:30 PM
  152. BEDROOM_LIGHT           ON      THU   TIME 10:30 PM RANDOM +15
  153. BEDROOM_LIGHT           OFF     THU   TIME  1:30 AM
  154. OUTSIDE_PORCH_LIGHTS    DIM 80  THU   SUNSET
  155. OUTSIDE_PORCH_LIGHTS    OFF     THU   TIME 10:35 PM RANDOM +15
  156.  
  157. #    Friday's events:
  158.  
  159. LIVING_ROOM_LAMP        ON      FRIDAY  SUNSET OFFSET -1:00
  160. LIVING_ROOM_LAMP        OFF     SATURDAY TIME 12:30 AM
  161. FAMILY_ROOM_LAMP        ON      FRIDAY  SUNSET OFFSET -1:00 
  162. FAMILY_ROOM_LAMP        OFF     SATURDAY TIME 12:30 AM
  163. BEDROOM_LIGHT           ON      FRIDAY TIME 10:30 PM RANDOM +15 
  164. BEDROOM_LIGHT           OFF     FRIDAY TIME  1:30 AM 
  165. OUTSIDE_PORCH_LIGHTS    DIM 80  FRIDAY  SUNSET
  166. OUTSIDE_PORCH_LIGHTS    OFF     FRIDAY TIME 10:35 PM RANDOM +15
  167.  
  168. #    Saturday's events:
  169.  
  170. OUTSIDE_PORCH_LIGHTS    DIM 80  SATURDAY SUNSET
  171. LIVING_ROOM_LAMP        ON      SATURDAY DUSK
  172. LIVING_ROOM_LAMP        OFF     SUNDAY   TIME 12:30 AM 
  173. FAMILY_ROOM_LAMP        ON      SATURDAY SUNSET OFFSET -1:00
  174. FAMILY_ROOM_LAMP        OFF     SUNDAY   TIME 12:30 AM 
  175. BEDROOM_LIGHT           ON      SATURDAY TIME 10:30 PM RANDOM +15 
  176. BEDROOM_LIGHT           OFF     SATURDAY TIME  1:30 AM 
  177. OUTSIDE_PORCH_LIGHTS    OFF     SATURDAY TIME 10:35 PM RANDOM +15
  178.  
  179. #    Miscellaneous Events:
  180.  
  181. DEHUMIDIFIER         ON      EVERYDAY ON  TIME  6:00 AM
  182. DEHUMIDIFIER         OFF     EVERYDAY OFF TIME 12:00 PM
  183. DEHUMIDIFIER         ON      EVERYDAY ON  SUNSET 
  184. DEHUMIDIFIER         OFF     EVERYDAY OFF SUNSET OFFSET 6:00 
  185. HALLWAY STAIRS       DIM 40  EVERYDAY SUNSET
  186. HALLWAY STAIRS       DIM 40  TIME 8:30 PM DATE 1/1 THRU 5/1
  187. HALLWAY STAIRS       DIM 40  TIME 8:30 PM DATE 9/1 THRU 12/31
  188. HALLWAY STAIRS       DIM 25  EVERYDAY TIME 10:30 PM
  189. HALLWAY STAIRS       DIM 25  EVERYDAY TIME 11:30 PM
  190. HALLWAY STAIRS       OFF     EVERYDAY DAWN
  191.  
  192. DECK_LIGHTS_1        ON      SUNSET OFFSET 5 DATE 4/1 THRU 9/31 
  193. DECK_LIGHTS_1        DIM 50  DUSK DATE 4/1 THRU 9/31 
  194. DECK_LIGHTS_1        OFF     SUNSET OFFSET 1:30 DATE 4/1 THRU 9/31 
  195.  
  196. KATHRYNS_PC          ON     SUNSET OFFSET 15 THANKSGIVING THRU NEW_YEARS_DAY 
  197. OUTSIDE_PORCH_LIGHTS DIM 50 SUNSET OFFSET 15 THANKSGIVING THRU NEW_YEARS_DAY 
  198. CHRISTMAS_LIGHTS     ON     SUNSET OFFSET 15 THANKSGIVING THRU NEW_YEARS_DAY 
  199. CHRISTMAS_LIGHTS     OFF    TIME 10:32 PM THANKSGIVING THRU NEW_YEARS_DAY 
  200.  
  201.  
  202.  
  203.  
  204. #
  205. #──────────────────────────────────────────────────────────────────────────────
  206. #
  207. #    The following event occurs every Sunday at 3:00 AM.
  208. #    When used in conjuction with POWERUP.EXE (in AUTOEXEC.BAT)
  209. #    we can automatically download new commands an a weekly basis.
  210. #    For example, sunrise and sunset change from day to day. The X10
  211. #    computer interface can store these times for 1 week, then it
  212. #    needs to be updated with new times.
  213. #
  214. #    Additional note: Backups are now performed during this time, as
  215. #         well as having all the drives optimized. See the sample 
  216. #         AUTOEXEC.BAT file supplied with this package.
  217. #
  218. #
  219. #    Note: The sample AUTOEXEC.BAT contains the command: XA "PC OFF"
  220. #    after the download, optimizations, and backups have been performed.
  221. #    But just in case something went wrong (like leaving a floppy in Drive A),
  222. #    we'll have the CP-290 turn the computer off 2 hours later.
  223.  
  224.  
  225. COMPUTER ON  SUNDAY TIME 3:00
  226. COMPUTER OFF SUNDAY TIME 5:00
  227.  
  228.  
  229. # * * * * * * * * * * *   SHAREWARE VERSION   * * * * * * * * * * * * * * * *
  230. #
  231. # IF/ELSE/ENDIF, VARIABLES, LOGICAL-BOOLEAN-ARITHMETIC LOGIC HAS BEEN
  232. # DISABLED FROM THE SHAREWARE VERSION. YOU MUST REGISTER THIS SOFTWARE
  233. # TO HAVE THESE FEATURES ACTIVATED.
  234. #
  235. #
  236. # Turn ON various lights on weekday mornings only when sunrise occurs
  237. # at least 30 minutes after they're needed.
  238. #
  239. #
  240. # IF (SUNRISE > TIME 6:00)
  241. #   OUTSIDE_PORCH_LIGHTS    DIM 80  WEEKDAYS  TIME 5:30 RANDOM 10
  242. #   OUTSIDE_PORCH_LIGHTS    OFF     WEEKDAYS  SUNRISE
  243. #
  244. #   LIVING_ROOM_LAMP        ON      WEEKDAYS  TIME 5:35 RANDOM 10
  245. #   LIVING_ROOM_LAMP        OFF     WEEKDAYS  SUNRISE OFFSET 10
  246. #  ENDIF
  247. #
  248. #
  249. #
  250. # ENDIF     # from IF (vacation)
  251. #
  252.  
  253. #                     That's all folks.
  254.  
  255.