Home | Programming Resources | Home Automation |     Share This Page
Home Automation
P. Lutus Message Page

Copyright © 2008, P. Lutus

(double-click any word to see its definition)

 
Web Page Interface

Version

This is Version 3.2 (03/02/2008) of the ISY-26 PHP Web interface script. It is Copyright © 2008, P. Lutus. This script is released under the GPL.

Introduction

This page describes a convenient way to control and monitor all your Insteon controls by way of a Web page accessible on your local intranet. The only prerequisites are:

  • A PHP-enabled Web server on your desktop machine, something easily accomplished in modern times — especially if you're running Linux.
  • An ISY-26 controller, accessible on your local intranet, configured with your Insteon controls, and updated with software revision 2.6.2 or newer.

There are some Web pages served up by the ISY-26, but at the time of writing they're not very polished or useful, so I decided to create a PHP script that takes the ISY-26's HTTP output, processes it, and creates a simpler and more useful Web page.

I created this script because I can display it on my palmtop computer's browser, as a stand-in for a decent (but nonexistent) Insteon remote control — one with a lot of buttons.

By the way — the people who designed the ISY-26 could easily create a built-in Web page like this — a simple, intuitive page that allows a user to easily control his home system. Hint, hint.

Example

The resulting Web page looks like this:

Scenes:

All_Units OnAll_Units OffExternal/Foyer OnExternal/Foyer Off
Lower Level OnLower Level OffLower Staircase OnLower Staircase Off
Master Bedroom OnMaster Bedroom OffMiddle Bathroom OnMiddle Bathroom Off
Radio Room OnRadio Room OffUpper Bathroom OnUpper Bathroom Off
Upper Staircase OnUpper Staircase Off  

Controls:

Computer RoomDining RoomExternal/Foyer 1External/Foyer 2
GalleyGarageLiving RoomLower Level 1
Lower Level 2Lower Level 3Lower Staircase 1Lower Staircase 2
Master Bedroom 1Master Bedroom 2Master Bedroom 3Middle Bathroom 1
Middle Bathroom 2Radio Room 1Radio Room 2Upper Bathroom 1
Upper Bathroom 2Upper LandingUpper Staircase 1Upper Staircase 2

The idea of the page is that you can click any of the control labels to toggle that control's state — the control will be turned on if it's off, off if on, and the label color indicates the control's present state. For scenes, because the ISY-26 doesn't provide state information, there are two buttons per scene, one for on, one for off. By the way, the sample above is live — it won't actually control anyone's lights, but if you click one of the labels, a dialog will appear showing the action that would be taken.

Setup

To use the PHP script, simply follow these setup instructions:
  • Download the PHP script — click here for a pretty-printed listing, click here for a plain-text form. Rename the script with a ".php" suffix for server use.
  • Edit the values near the top of the script — change the user configuration to suit your requirements:
    • $show_controls: This value enables display of the controls table.
    • $show_scenes: This value enables display of the scenes table.
    • $isy26_address: Edit this value to reflect how you identify your ISY-26 controller locally — by a name or address. Applications like this shows why it's better to assign a fixed address to your ISY-26, rather than allow it to acquire an address dynamically using DHCP.
    • $logon_name: Enter the logon name assigned to the ISY-26. The default is "admin".
    • $password: Edit this value with the password you use to access the ISY-26. The password is not displayed in the browser's address bar (it is passed using a POST HTTP transaction). Nevertheless, if third parties were to gain physical access to your desktop machine, they could read your password in the PHP script. I included it as a variable simply because I am too lazy to type in a password every time I access the ISY-26.
    • $font_size: I use this value to adjust the size of the displayed output, to fit conveniently onto my handheld's browser.
    • $control_row_length: This value selects the number of cells per row in the controls table.
    • $scene_row_length: This value selects the number of cells per row in the scenes table.
    • $refresh_interval: This value specifies the number of seconds between page refreshes.
  • Install the script on your local PHP-capable Web server.
  • Access it in a local browser.
  • Control your devices by clicking on their names.

Miscellaneous Notes

To exclude a particular control or scene from the display, simply prefix its name with a double underscore (like __this). I have a number of scene definitions that only serve to make orphan controls broadcast their changing state to the ISY-26, but they don't need to be displayed in the page.

The reason there are no on/off color cues in the scenes table is because the present ISY-26 Web output doesn't provide this information. This may change in the future. In fact, there is some indication that a future ISY-26 software version will allow users to upload Web pages (or server-side control scripts) onto the controller and be served from there. That change would greatly simplify a project like this. Hint, hint.

The reason this script doesn't support light dimming is because I don't have any dimmable controls or lights (all compact fluorescents at my house). This function would be easy to add if there were a compelling reason.

This script is very simple to set up and use. It shows one of the many advantages of running Linux. One can run a Web server under Windows, but compared to Linux, it's a lot more effort to set up.

 

Home | Programming Resources | Home Automation |     Share This Page