Home Automation EZine
Volume 4 Issue 3
June 1999

Features
HEADLINES
Connections '99
What is a Gateway?

Conn99 Chronicle
Home Nets for Sale
Mr. Who?
Wireless Obstacles
Capacitor as Bridge?
Jini - 3 Wishes
Back to Basics
Steve's Online House
HA & Load Shedding
Personal Robots?
Palm Pilot Remote
Adicon 2500
Info Appliance Net
EDITORIAL

Interview
HomeRF Group
- Wayne Caswell -

Reviews
SwitchLinc 2Way
HomeSeer
PC Commander

Home Automation Products & Services

Press Releases
News Briefs
AMX=Panja/Cisco
Multitainment
Internet Entertain
Forum'99
OnQ Mgmt Team
Ameritech & IBM
Open Systems'99
Lightfair '99
ISC NY Highlights
Silent Relay
Home Gold Mine
Structured Wiring
Digital Lock
Anicom Seminars
Proxim Symphony
Infrastructure Report
Motorola & Proxim
HAI - Sensor
PC Access - HAI
LonWorks / JINI
Multiplex / Nortek
HomeNet '99
ISC Expo Miami
Metricom PLC-1
Instant View
SmartHomeUSA

OnQ @ HCI
PCTheater Portals
Security Revenues
EH Expo 2000
New OnQ Enclosure
HCA Version 2.0
CEBox 2.1
OnQ Telcom Mods
Domosys / HAL3000
OnQ Home Office
ISC Expo New York
OnQ Network Mod
Napco News
Commercial Building Automation Website
Sharewave / NetGear
PAL Kits X10Pro
CEMA Internet
LonMaker 2.0
HA Show Report

Home Net @ N+I
DomoNet Module
900MHz Wireless
CD MegaChanger
Leviton Training
FiberOptic ToolKit
LonPoint Additions
WinProxy Wireless
SwitchLinc 2 Way
Echelon / Microsoft

ARCHIVES
Subscribe - Free

Return to Main Menu

 

Home Toys Article
- June99 -
[HTI Home Page]
KEEP INFORMED OF THE LATEST NEWS
Sign Up for our Newsletter
[Click Message To Learn More]

nolen-01.gif (23352 bytes)
Stephen Nolen

Although there are no standards on web interfacing of home automation systems to date, there are definitely easy ways of putting this feature in place. What I have done is take existing technologies and add a bit of custom programming to interface the different parts.

Stephen Nolen is Assistant Director of Networking/Webmaster for the Citizen Potawatomi Nation (www.Potawatomi.org) providing web site development and database integration, internal system support, and technical assistance for CPN, it's Internet Subsidiary www.CPN-Net.com  and it's various enterprises and services. He maintains web sites for several entities in addition to CPN sites as well as his own domain Protowrxs.com. Stephen's hobbies include computers, programming, robotics, his '69 Mustang and he enjoys time with his family."


Introduction

As I begin writing this article, I have just dialed up the Internet using a notebook PC and a Cel-phone... no phones out here at the lake. The first thing I did was check email and then I ‘checked the house’. I simply pointed my browser to House.ProtoWrxs.com and made sure the burglar/fire alarm was still armed, that no window, door or garage door activity had taken place since we left and noticed that there was motion that has been recorded on the security system VCR at 2:30am and 2:48am. There ARE many benefits to having an online house.

Overview

BL00302_.wmf (16642 bytes)Having been ‘into’ Home Automation for many years starting with a homebrew VIC20 based ‘home automation controller’ programmed in BASIC, the latest move for our house is online. The system is an integrated mix of JDS Timecommand Plus, PC, hard-wired burglar/fire alarm, and web server. The web enabled features are available through the TC+ and PC connection. The PC is running a web server that allows interaction with the TC+ system and other information that is on the HA PC. Many data items are automatically generated when activity occurs such as motion, arming/disarming alarm, etc while others are on demand such as current light status information. This reduces some of the PC/TC+ traffic but still allows access to the information.

Sample ASP Code for HVAC Temperature Display

REM Setup file open commands
Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
TestFile = Server.MapPath("/LogFileLocation") & "\temps.log"
Set InStream=FileObject.OpenTextFile(TestFile,1,False,False)
REM Default value for display
CurrentTemp = "Not Logged"
REM Read to end of log file and get last line
While not InStream.AtEndOfStream
    CurrentTemp = Instream.Readline
Wend
REM Format the information read in
LDate = Mid(CurrentTemp,2,10)
Response.Write LDate & " - "
LTime = Mid(CurrentTemp,15,8)
Response.WRite LTime & "<BR>"
LinTemp = " " & Mid(CurrentTemp,25,2)
REM Write the data to the browser
Response.Write "Inside : " & LinTemp & "° F |"
Response.Write "<img src=/images/appledot.gif
   width="&trim(LinTemp)&" height=10 border=1><BR>"

Sample Form Submission to set/reset Home/Away Mode

REM Get the control from form submission
HomeAction = Request.Form("HOME")
If Homeaction = "HOME" then
Action = "HOMEMODE"
end if
if HomeAction = "AWAY" then
Action = "AWAYMODE"
end if
if Len(Trim(Action))<>0 then
REM Setup the ASPExec command
REM what to run, what parameters, and show the app locally or not
Set Executor = Server.CreateObject("ASPExec.Execute")
Executor.Application = "c:\winevm\sendevm.exe"
REM These are the keyboard commands going to the TC+
REM they would be ALT S <action> ALT S ALT O
Executor.Parameters = "%S"&Action&"%S%O"
Executor.ShowWindow = True
REM run the app and return any results
strResult = Executor.ExecuteWinApp
ActionList = Action
end if

The interaction lies in the ability of the web server to read data files off the PC and format them into a viewable web page, and the ability of the web server PC to execute programs that can perform various functions or provide key controls to the TC+ EventManager program. The web server is currently Microsoft Personal Web Server (PWS) that provides the ability to use Microsoft’s web scripting language, VBScript, under Active Server Pages (ASP). With these features you can basically ‘program’ your web page instead of relying solely on static information. With the addition of some key ‘components’ or add-ins for the web server, additional functions can be established. For example, the ASPExec component by ServerObjects allows a web page to execute a program on the web server and return a value to the web page if needed. I added a simple ‘sendkey’ program that is executed by an web page that calls ASPExec and sends the keys to the TC+ control program that have been setup by the ASP web page. This allows for a very flexible setup for the web site and allows a web page to do almost anything that can be done at the keyboard. For the more common commands or controls, I have included IF/THENs in the TC+ to look for commands from the PC via the ASCII-IN command.

To make the web site easy to navigage, I have broken the web interface down into primary areas of interest or control and have created display pages and control forms for each area.

Lights

LightsThe majority of lights in our house are X10 controlled either through a wall mount receiver, hard-wired module or plug in modules. There are a few lights that need to still be included which are not controllable from the web page or from the various hand-held remotes but they are in the future plan. Since lights have a very high activity rate, I decided not to try to track each and every change in light status. Instead, I included some code in the TC+ that looks for a LIGHTREFRESH command from the PC and then sends the current light data back to the PC for viewing in a web page. This requires a REFRESH button on the lights status page but keeps traffic low. The refresh button fires off the LIGHTREFRESH command, waits for the execution of it, and then goes back to the lights status page which reads the light status text file and builds the display page.

Additionally, lights can be controlled from the web page in similar fashion. There are some limitations at this time in what can be controlled since keyboard access to all 256 X10 modules is difficult using the keyboard in the EventManage program. Instead, I have selected the key lights to control, added a form for them on the lights page and then provided code in the TC+ to look for those commands and control the light. Some functions are easy to establish such as ALL LIGHTS ON or ALL LIGHTS OFF, others are more difficult to setup controls since code must be written for each activity in the TC+. Hopefully future versions or the EventManager software or a replacement for it will be available that will allow DDE or some other automation interaction with the TC+ and local programs on the PC.

Appliances

AppliancesI have several appliances tied into the HA system one way or another and in this area have simply provided some status views and controls for them. Appliances that currently do not have direct HA controls such as the washing machine and dryer provide status information only. Since these items cannot be ‘refreshed’ for status information, a status file is written each time the unit toggles on or off. The latest information is provided on the web page with logs available for seeing the history of each unit.

For example, we can see if the Washing and Dryer are on or off from the Appliances page and the last time the activity was logged. When logged in, there are some additional features that allow viewing graphs of the log files providing run time information and estimated electrical usage based on the runtime. Other appliances such the humidifier are treated similarly except they can be turned on or off from the web page. Next I’d like to track the water heater but being a natural gas fired unit, I’m going to have to see how to get status information back from it. Additionally, the dish washer is on the list since it will rather easy to control via X10 and can then be schedule off hours or during the day if we are not here to hear it run it’s cycle. I am current working on feedback sensors for the refrigerators allowing run time data for them.

Entertainment

EntertainmentAn interesting item as to why the entertainment system would be accessible from the web is the entertainment system. Consisting of the video/audio receiver/amplifier, TV/Monitor, VCR, and Cable box, the system can track status information by using the switched power outlet on the main units. The output of these are hooked up to a 110v AC relay which drives an X10 burglar alarm interface to send an X10 signal when on and when off. This helps the TC+ to make sure the units are off when everything is supposed to be shutdown and on when asked to be on.

Control is provided by the Infrared controller on the TC+. The unit points towards a X10 Powermid that relays the info into the primary living area where the Entertainment system is located. This unit also drives an infrared amplifier block that provided for illumination in the garage which is explained in the security section. The entertainment system is actually one of the easiest areas to control since all the IR commands can be completed through keyboard sequences in the EventManager software. It is slightly tricky since there are a lot of down arrow or down/right arrow keyboard movements to select the right controls but anything that the IR unit can do can be setup.

There are some potential problems in that one does not know the status of the MUTE command for example and unless it is tracked, you can easily be in inverted situation. Future audio feed by using a Real Audio or other server realt time audio encoder at the house would resolve this and provide "listen in" features. I have worked some with this on a Linux machine but have not been happy with the results yet. I have also tried this using Microsoft’s Netmeeting package but really want to keep all interaction web browser based.

HVAC

HVACThe Heating, Ventilation, and Air Conditioning has proved to be the more difficult area to integrate with our existing setback thermostat system. Currently, it is pretty much limited to tracking the current temperature and humidity values, and current status of AC, Heater and blower. With a planned replacement of the existing thermostat with an RCS X10 unit, integration should be much easier. Status for the HVAC unit is currently provided by in-line relays for the thermostat and digital inputs on the TC+.

Currently the temperature control form doesn’t actually control temperatures but all the code is setup both on the web server and the TC+ to handle it.

Lawn and Garden

HH01456A.gif (2530 bytes)The primary reason for the Lawn and Garden section is the control and tracking of the sprinkler systems. I also duplicate the temperature section here and the future weather information will most likely be centered around this area. Additionally the front and rear moisture sensors are displayed here. These sensors are manually adjusted on/off sensors and do not provide an analog value at this point.

Security

SecurityThe security system, a hard-wired burglar and fire unit, is firmly integrated since this was the original reason I wanted web control. I wanted to be able to check the house and make sure the alarm was armed since we frequently forget to set the away mode when leaving the house. Once I get to work, I can view the house and make sure all things are in order if no one is home. I have enabled arming, disarming, and viewing activity logs for those who are authorized for such information. I can view when the alarm last sounded, check to see if all the loops are good and what activity each had, and view and graph historical data for any of the information.

This are also tracks the video log information and will contain the camera captures as soon as they are online. I currently have most of the needed equipment but haven’t setup a machine to do the captures yet. This will be done on the cheap using a Snappy capture device, an old 486 box, and one of the capture packages that are available. I have played with a Connectix cam for this feature too and it works fine, but I haven’t dedicated a camera for this purpose yet.

Obviously this much control must be limited to those who have access to it and this is where the web security comes into play. Although web servers do open your machine up to the world, scripting allows a much deeper level of control than static web sites can. One feature particular to my connection is the use of an Ascend Pipeline 75 router. This router acts as a Network Address Translation, or NAT point and a firewall allowing a better protected internal network. This could be accomplishing using a product such as IPRoute and an old DOS PC for an analog dialup connection which I had before. Additionally, a move to Microsoft NT would increase this security to some degree.

Phone

PhonePhone integration with the web server is centered around status information including incoming and outgoing call tracking. On the incoming side, I have a CID tracking program that reads incoming calls, announces them via the Text To Speech (TTS) system and logs the call date, time, name and number to a file that is available to the web server. Outgoing calls can be viewed since all calls DTMF values are stored into a file along with date and time information. As a secondary set of data, the X10 phone controller generates an X10 signal when the phone rings which is tracked to count the number of rings for each incoming call.

Under development, is a PC based voice mail system that will then allow listening to voice mail through the web browser. The key is having the voice mail system log the recorded data into a format that can be read by a web browser or at least a format that can be converted by a command line program that ASPExec can call.

Modes

ModesThe mode control interface is rather straight forward since I am simply viewing /setting the various modes the system supports. The primary modes of Home/Away, Entertainment, Vacation and Defcon are used to determine how the automation system reacts to activity inside and outside the house. These modes are displayed for authorized users and can be turned on or off from the web interface.

Voice System

SpeechThe voice system is one of the more fun areas of the site providing the ability to make the system speak from anywhere in the world. If authorized, the system can be turned on and off through a simple flag file that is created or deleted by the on/off form. From there, one can input any text to say and the Text To Speech (TTS) system will speak it through the audio distribution system.

Currently under development is the speech output section that will use the Microsoft Agent technology to report information in a talking character for the complete system. I have built a couple sample pages using the agents and it is reasonably simple to do. It does limit activity on those pages to Microsoft IE browsers but since most system I will be using are already running IE I personally don’t have any issues with that.

Review of Key Equipment Used

  • JDS TimeCommander Plus - Dedicated Home Automation Controller
    The same features can be setup for a JDS TC, TC+ or Stargage as well as other controllers
  • 100Mhz Pentium Dedicated PC - Used for CID, Speech, Voice Mail and Web server
    To date this machine has performed quite well even loaded down with the various applications. More horsepower might make things smoother and is in the future plan.
  • Ascend Pipeline75 ISDN Router/Firewall
    The benefit of the firewall and NAT help protect the internal net and provide direction inbound routing for various services.
  • Full Time Connection to Internet
    Currently this is a dual channel compress ISDN connection but it can range from an analog modem, ADSL, or Cable for others. Even if your connection only provides dynamic IP assignments, one could use Dynip.com or some other dynamic Domain Name Server to provide remote access.
  • Microsoft Personal Web Server
    Note that PWS is limited to four (4) simulataneous connections to the web server. NT Server and IIS would elimintate this but would increase the startup cost considerably. Since I primarily am the only one really using the web site, this is not a limiting factor. However, if many people try to see what's going on in our house, performance will suffer.
  • ServerObjects.com ASPExec Component
    The ASPExec component is free from ServerObjects.com and provides the true interaction with the PC/TC+ and the Web site.
  • SendEvm.exe customer SendKey program
    This custom Visual Basic (VB) app simple takes the command line given, activates the EventManager program, and sends the key commands to it.

Conclusion

wpe730.jpg (132478 bytes)Although there are no standards on web interfacing of home automation systems to date, there are definitely easy ways of putting this feature in place. What I have done is take existing technologies and add a bit of custom programming to interface the different parts. Although ASP programming can be somewhat confusing, anyone that has programmed a TC+ or Stargate can learn how this works with some time and effort. I manager several web sites that use ASP as the core to create custom, database driven web pages and House.ProtoWrxs.com is not too different.

Related Links

So visit our house sometime and be sure and sign the guestbook...
http://House.ProtoWrxs.com