home *** CD-ROM | disk | FTP | other *** search
-
- AMIGA CONTROL PROGRAM FOR THE X10 USA, INC.,
-
- CP290 COMPUTER INTERFACE
-
-
-
- (C) 1988, Stephen L. Childress
- Phone: 818/706-5247
- Plink: OPS274
- USENET: ..!wlbr!etn-rad!steve
- CI$: 73007,350
- VAUX BBS: Steve
-
- RIGHTS AND TITLE STATEMENT
-
- The above listed person is the author and owner of this software. I grant
- permission to duplicate and use this software for not-for-resale, non-
- commercial and not-for-profit uses. Other uses require my permission via
- written contract between author and user.
-
- Source in Lattice C available to beautiful people only.
-
-
- THIS IS A PRELIMINARY VERSION OF THE SOFTWARE.
- IF YOU FIND A BUG, PLEASE ADVISE.
-
-
-
- INTRODUCTION
-
- The X10 USA company manufactures a series of low cost devices which enable an
- electrical or electrically controlled device to be controlled remotely, within
- a home or small building. To do so, the controlled device, such as a lamp, is
- plugged into an X10 USA "module" which is in turn plugged into a wall outlet.
- A controlling transmitter unit, resembling a hand calculator's keyboard, can be
- plugged into an outlet in the same building. The device (lamp) can be turned
- on, off, and dimmed using the transmitting controller. Other than the lamp
- control module, there are other modules to control higher power devices such as
- spas, coffee pots, and the like.
-
- There are also transmitting controllers which are embedded in a wall switch
- which replaces a standard wall switch. New X10 products include a module which
- contains a contact closure which is activiated remotely at will. This closure
- can be wired to, say, a garage door opener's manual switch, enabling one to
- close said door remotely. The X10 product line also includes a transmitting
- controller which uses a wireless link thus enabling you to control things while
- roaming around your estate or from your automobile.
-
- The subject at hand is the X10 USA computer control product (CP290), available
- from DAK, Sears, Radio Shack, Heathkit, and others, for about $30-40. This unit
- functions as a transmitting controller, has integral push buttons, and provides
- an RS232 serial link to a computer such as the Amiga. Inside the CP290 is a
- small microprocessor and a battery-backed-up memory. The idea is for the Amiga
- computer to use the serial link to load a schedule of on/off/dim events into
- the CP290's memory. Having done so, the CP290 will forever follow that
- schedule, turning things on and off at the prescribed times on prescribed days
- of the week.
-
- There are commercial CP290 support software packages for MS-DOS, Macintoshi,
- Radio Shacks, and others. I wrote this program to learn how to use Intuition
- and because I did not like the human factors and ease of use in the demo
- version of the Amiga support package.
-
- The benefits of using the CP290 include:
-
- o Outdoor lighting on/off via one unit; cheaper than multiple timers
- o Can turn on key lights for brief time each day, e.g., for AM departure
- o Can repeatedly turn off lights which children tend to leave on
- o Close garage door each night
- o Run Spa or pool filter each day
- o Turn on dimmed hallway and/or porch lights each day
- o Can control lights, TV, or radio to simulate occupancy during absences
-
- o See "HINTS", below.
-
-
-
-
-
-
-
-
- USE OF AMIGA SOFTWARE
-
- The program uses a 650 x 420 hi-res screen with 16 colors. The sofware will
- run without a CP290 connected, if you do not choose the send or receive
- options. If you wish to abort the program without affecting the CP290 or any
- disk files, click on the CLOSE window gadget or the word QUIT in the gadgets in
- the bottom of the screen. If asked about saving data to a file, click on NO.
-
- You will probably not need a manual to use the program. There are, though, a
- few non-obvious things:
-
- 1. When run, the program tries to find a data file in the current directory. If
- it is not found, it asks for a new pathname. If you wish a blank, event-less
- screen, click on the requesting window's close gadget. If you venture into this
- program for the first time without pre-existing events, you'll have more
- difficulty learning. Put the file X10DATA in the current directory before
- running this program for the first time.
-
- 2. Choose the first event for a module by clicking on the module number on the
- right side of the screen. Click again for the next event. Click on an
- *existing* event to activate it. The details about an event are displayed
- textually on the bottom right side of the screen. The active event changes from
- multi-color to red.
-
- 3. Be sure to check or establish the date known to your CP290 by clicking on
- SET-DATE. You must change the time to accomodate daylight savings time.
-
- 4. Click on SET BASE if your X10 modules do not use house codes A and B.
-
- 5. Clicking on a module number has no effect if there are no established events
- for that module.
-
- 6. Click on SET NAME to enter a module description, e.g., hall lights.
-
- 7. Click on SECURITY to cause the event to vary randomly by one hour.
-
- 8. Click on SEND to load the events and module names into the CP290.
-
- 9. Click on RECEIVE to recall events and module names from the CP290.
-
- 10. Don't choose DIMMER or BRIGHTER for other than X10 Lamp Modules.
-
- 11. Click on CMD NOW to cause the CP290 to do the active event now.
-
- 12. Click on a day of the week to add/remove it from the active event.
-
- 13. Because all events and module names are stored inside the CP290, it is not
- essential to keep a copy on disk. You can always use RECEIVE to recall the
- data. However, disk files are an easy way to switch between normal and vacation
- schedules, or for seasonal (sunset-related) changes.
-
- 14. Create new events by drawing a line using the left mouse button.
-
- 15. Delete the active event by choosing DELETE.
-
- 16. An OFF command is automatically created by the software for every event you
- enter. You choose what X10 command is to occur at the beginning of the event.
- If you define the start of the event to be an OFF command, a second OFF command
- is not added by the software.
-
-
-
-
-
-
- DETAILED USE INSTRUCTIONS
-
- When run, the screen depicts 32 X10 modules, numbered A1 through A16 and B1
- through B16. This corresponds to the way the thumbwheel switches are set on the
- X10 modules, so that each module can be given a unique code. (It is legal to
- give the same code to multiple modules; indeed, this is often done to
- synchronize, say, several lamps in the same room.) On the Amiga's monitor
- screen, the 32 modules displayed will have on/off/dim events at particular
- times of the day. A bar chart like display, for each of the modules, reveals
- the start/stop time for each event for each module. Each bar consists of up to
- seven parallel lines, each corresponding to the day of the week for which the
- event is allowed.
-
- To scrutinize an module's events, use the mouse to click on a module number or
- click on the event itself. This results in a textual status display which lists
- the event's start and stop time, the days of the week for which it to occur,
- and the X10 command which is to be issued at the start of the event. The X10
- command will be either ON, OFF, or DIM. For DIM, a number between 1 and 16 is
- shown which indicates the chosen brightness. The chosen event is displayed in
- RED. Other events are shown in multi-colors, according to the days of the week
- activated. Each day has a unique color.
-
- If the mouse is clicked where there is no event data, a new event is created.
- Be careful - clicking the mouse without care will create very brief events. To
- delete an accidentally added event, click the mouse on the DELETE gadget in the
- bottom of the screen, if the undesired event is active (RED). If the undesired
- event is not active, make it so by clicking on the module number on the right
- side of the screen. To activate each event in turn, for a given module, click
- on the module number, then on NEXT, repeatedly. Click on DELETE when the
- undesired event is active (RED), as NEXT is repeated.
-
- To activate a tiny event (short duration), click repeatedly on the module
- number until the event is RED and you see its description in the text summary
- on the bottom right of the screen.
-
- To draw a new event, draw a line by holding down the left button of the
- mouse while dragging it to the right. Fine-tune the start, end, or duration
- times using the EARLIER, LATER, LONGER, and SHORTER gadgets.
-
- Click on a day of the week to reverse the on/off choice for that day for the
- active event.
-
- Click on WEEKEND or WEEKDAY to reverse the on/off choice for those days.
-
- Click on SECURITY if you want the event's start/stop times to vary randomly by
- about an hour (see CP290 manual).
-
- Click on SET NAME to establish or revise the description of a module's purpose.
- This is what is displayed to the right of the module number on the screen.
-
- If your serial port is not connected to a CP290 and you attempt to SEND or
- RECEIVE, you will receive an error requestor in about 30 seconds.
-
- Click on CMD NOW to actually do the X10 command immediately. Be careful to undo
- the command if need be... don't leave the pool filter on all night!
-
- Click on NEW FILE to save and/or load new event data to/from disk. If you exit
- the program without saving, you will be automatically prompted to do so. The
- data stored on disk is a printable ASCII text file. (See Appendix A).
-
-
-
-
-
- HINTS
-
- o Define no-duration OFF events to turn off things in case you are forgetful.
-
- o Use an appliance module to close the garage door. (I have circuit).
-
- o Establish fancy schedules for outdoor lights.
-
- o Use X10's 20 Amp contactor module for big motors and other loads.
-
- o Buy one 12 or 24 VAC transformer for all your outdoor "Malibu" lights. Buy
- only the lights - save money by not buying many timers.
-
- o Replace wall switches with X10 switches. Let the CP290 turn off lights to
- save electricity if your kids have poor habits (or if you are lazy).
-
- o Run your spa or pool filter daily cleaning via the CP290.
-
- o Let the CP290 turn on the spa before you return home from dinner, to have it
- ready!
-
- o Program the CP290 to light up dark hallways, sidewalks, etc, for early
- morning joggers or departures to work - duration, say, 30 minutes.
-
- o Use X10's new dry contact closure module to automate most anything ... lawn
- sprinklers, drip irrigation system, etc.
-
- o Use an appliance module to turn on the Amiga at an appropriate time. Using a
- startup batch file, have the Amiga down-load to the CP290 a new schedule and
- the CP290 can then turn off the Amiga. Thus, the CP290 turns on the Amiga which
- then reprograms the CP290 to do things including turning off the Amiaga.
-
- Egad! A monster!
-
-
-
-
-
-
-
- -----------
-
- APPENDIX A
-
- DISK FILE DATA LAYOUT:
-
- Line one of the "typical file" shown below, contains 9 events and 9 defined
- modules. Reading the first line:
-
- EVENT NUMBER = 1, START TIME X-AXIS = 370, END TIME X AXIS = 475,
- DAYS MASK = 127 (0X80), X10 command code = 5 (dim), dimness = 7, security = 0
-
- To convert an X-Axis value to a time of day, multiply by 3 to get minutes past
- midnight. Refer to the CP290 Programming manual for details of the day mask,
- command, dimness, and security bit-layouts.
-
-
- Following the nine event data lines, there is an line of all zeros which
- delimits the event data. Next, there are nine lines of module names. Each line
- contains a module number followed by an ASCII string. Module B1 would appear
- here as number 17.
-
-
- -----------------------
- TYPICAL FILE:
-
- 1,370,475,127,5,7,0
- 2,479,479,127,3,7,0
- 5,370,476,127,5,7,0
- 6,440,440,127,2,0,0
- 6,479,479,127,2,0,0
- 7,370,479,112,2,0,0
- 8,320,330,127,2,0,0
- 8,478,478,127,3,0,0
- 9,122,127,15,2,0,0
- 0,0,0,0,0,0,0
- 1,"Hall Light "
- 2,"Living Rm. Lamp"
- 5,"Driveway Lights"
- 6,"Garage Door Clo"
- 7,"Decorative Ligh"
- 8,"Spa Filter "
- 9,"Front Security "
-