Thinking Home can be used with web server software two different ways. It can respond to AppleScripts launched by web server software or it can handle requests directly as the CGI application. This discussion explains direct CGI setup. It assumes you are already familiar with your web server software.

Step 1: It may be necessary to rename the Thinking Home application, depending on the limitations of the web server software. The most compatible name is obtained by removing all spaces and adding ".acgi".

For example, "ThinkingHome.acgi" should work with all server software.

Step 2: Set the html form to use Thinking Home

Set the html form to refer to your Thinking Home application as the intended CGI application.

For example:

> <FORM action="http://123.456.789.4/thinkinghome.acgi" method="POST">

GET and POST work equally well.

Step 3: Set the html form inputs. The three inputs used by Thinking Home are devName, x10Action and amount. The first two are required; the amount is optional and used for dim and brighten actions.

Device names can be the names used in the relevant Thinking Home document (e.g. "Desk Lamp") or they can consist of house and unit values (e.g. "A12")

x10Action should be "Turn On", "Turn Off", "Dim" or "Brighten"

The amount input is the percentage to dim or brighten.

Examples of html Form inputs:

> <INPUT TYPE="hidden" name="devName" VALUE="Desk Lamp">

> <INPUT TYPE="hidden" name="x10Action" VALUE="Dim">

> <INPUT TYPE="hidden" name="amount" VALUE="50">

An example is provided in the Thinking Home folder.

Leave a Thinking Home document open in order to refer to devices by the given names. The document window also specifies the type of interface and serial port to be used. When no document is open, the settings from the Preferences are used and devices must be addressed by house and unit ID.

See also: AppleScript CGI