| Home Toys Article - June99 - [HTI Home Page] |
KEEP INFORMED OF THE LATEST NEWS Sign Up for our Newsletter [Click Message To Learn More] |
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
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 Microsofts 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.
The 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.
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 Id like to track the water heater but being a natural gas fired unit, Im 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 its cycle. I am current working on feedback sensors for the refrigerators allowing run time data for them.
Entertainment
An
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 Microsofts Netmeeting package but really want to keep all interaction web browser based.
HVAC
The
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 doesnt actually control temperatures but all the code is setup both on the web server and the TC+ to handle it.
Lawn and Garden
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
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 havent 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 havent 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
Phone 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
The 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 dont have any issues with that.
Review of Key Equipment UsedConclusion
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
© 1996 - 2008, Home Toys Inc. - All Rights Reserved
Powered by LJB Management Inc.