80+ home automation applications for your iPhone and iPod Touch.iPhone photo

With many developers flocking to the iPhone platform, it's time to publish a new guide showcasing all home automation applications available, allowing you to control every aspect of your home.  We'll do our best to keep this list updated, but if you find an application which hasn't been listed yet, please let us know.  Read More


ZigBee 101: Learn more about ZigBee and what it means for Home Automation.
How to interface Homeseer with PHP Print E-mail
Written by Dan   
Wednesday, 17 March 2004 13:52

This tutorial will show you how easy it is to control your Homeseer devices with a PHP script.

  1. Configure DCOM (Check the 'Related Articles' section).
  2. Install & configure Apache + PHP (Check the 'Related Articles' section).
  3. Create a new file in your webroot directory using notepad, name it index.php.
  4. Paste the following code into the index.php file (make sure you change Homeseer.Application to whatever the object is named in your DCOM configuration screen, usually the other name is Homeseer.ClsString.
    <?php
       $hs = new COM("HomeSeer.Application");
       $List=$hs->GetDeviceList();
      
       print "<table>";
      
       for($i=1; $i < $List->Count() + 1; $i++) {
          $What=$List->item($i);
          $device="<tr>";
          $device.="<td width=50>$i</td>";
          $device.="<td>$What->Name</td>";
          $device.="<td>$What->Location</td>";
          $device.="<td>$What->Status</td>";
          $device.="<td>$What->hc</td>";
          $device.="<td>$What->dc</td>";
          $device.="<td>$What->misc</td>";
          $device.="<td>$What->interface</td>";
          $device.="<td>$What->dev_type_string</td>";
          $device.="<td>$What->buttons</td>";
          $device.="</tr>\n";
          print $device;
       }
       print "</table>";
       unset($hs);
    ?>
  5. Go to http://localhost (or the ip address of your machine), and you should see a listing of all the Homeseer devices you have, including all details.
  6. Here are some other examples on how to control HS using PHP:
    • Turn on a device named "A4":
      $hs->ExecX10("a4","off","0","0");
    • Write to the Homeseer log file:
      $hs->WriteLog("PHP","This is a test");
    • To check the status of a device named "A4":
      $hs->devicestatus("A4");

That's it!

Forum Thread