CommandFusion Wiki

Documentation Resources

User Tools

Site Tools


Sidebar

case-studies:barry-gordon

This is an old revision of the document!


Residential iPad User Interface System

Author: Barry Gordon
Website: http://the-gordons.net/
CommandFusion Products: iViewer 4

This material may not be reproduced or reused elsewhere without the express written permission of Barry Gordon.

The Operating Environment

Purpose

The purpose of this system is to control all of the Home Automation attributes of my home and to display their current state at any time.

The House Itself

The house was designed by my late wife, Jill and myself circa 1997. We moved in on my birthday October 1, 1998. The house is a single story open floor plan design with about 3800 sq. ft. of space under air, with an additional 1500 sq. ft. (the garage) not under air. Ceilings in the house are 10 feet, except in the Great Room where they are 12 and 13 feet. The exterior walls are concrete block. We had the builder do a full 2×4 interior inside the concrete block. This makes the walls very thick providing a pleasing architectural look to the window openings. In addition it makes it easy to mount pictures; Jill was a needlepoint artist. The roof is concrete tile.

The house is logically divided into zones:

  • The Great Room - The central area comprised of the Entry way, Kitchen, Dining Room, Breakfast area, and Family area.
  • The Master Suite - Comprised of the Master Bedroom, Master bath, Walk-in Closet and Gym.
  • The Guest Wing - Comprised of the Guest Bedroom, Office (an extra bedroom) and the Guest Bath.
  • The Theater - Comprised of a formal theater, the bar and a small pool bath.
  • The Lanai - This is the pool area which has a free form pool, a SPA, and covered seating areas.
  • The Utility Zone - which consists of the Garage, a large air conditioned closet which holds the house electronics and server systems plus seldom used clothing, and a full woodworking shop. The Garage is the only portion of the house not air conditioned.

The electrical system for the house is 300 amp service split to two 150 amp service panels. One panel has a backup generator sized to run that complete panel and propane driven from a 500 gallon underground storage tank which also supplies the gas needs of the house. The system is ready for a second generator, but I have not yet seen the requirement. Special care was taken to ensure a proper system ground (8' x 1” copper pipe driven into the ground at the service entrance). Every box which takes switches, and every ceiling junction box have neutrals to allow for the operation of sophisticated electronic switches (X10, Insteon) without problems.

The view of the house from the street it resides on (a little old, landscaping has changed):

The floor plan (not to scale) for the house roughly aligned with the above picture:

Each zone of the house, except the Lanai and the Utility zone, has a wall mounted iPad. The guest wing has two, one in the guest bedroom and one in the office. There are announcement speakers mounted in the ceilings of all the major rooms.

The main zone, the great room, has three zones of music, each with its own volume control, but all playing the same source. After all, it is just a large open space. The master bedroom has an audiophile quality “stereo only” audio system, while the theater has a full 7.1 audiophile quality sound system to match its 133” HD projection system.

All software (code, data, music, video) is maintained on a 16 TB server which is expandable to 44 TB. Music is served by the “Squeeze Server” system (aka LMS, aka Slim System) while video (movies) are handled by a system I developed specifically for my theater. If I were to do it today I would just use XBMC.

The mobile user interfaces are Philips Pronto Pro remotes for which I developed the code that drives them. The kitchen and master bedroom use 9600's, the guest bedroom a 9400 and the Theater a 9800. They are all coded in Javascript with a significant amount of code reuse. There is an iPad version of these remotes as part of the wall mounted iPads' application. I am in the process of converting the mobile devices to iPod Touch units using most of the code from the iPads.

The wall mounted iPads are actually in the wall using a docking system that is slightly thinner than standard wallboard. This means that iPad placement is independent of stud locations and makes for a very high WAF. The iPads can be reloaded and restarted on command from a central point. They are constantly being charged, and revert to a black screen with the backlight off when not used. They become active on a double tap, or when commanded to display a callerID or similar message by the Home Automation system.

The Home Automation system is “Homeseer” and runs on a dedicated rack mounted 2U server. The rack is in the utility closet which has its own HVAC system so it is never heated in the winter whereas the main living areas might be. The lighting sub-system is being migrated from X10 to Insteon under the control of a Universal Devices ISY994i. The ISY994i is integrated with Homeseer so that all status can be collected at a single point. The house has two zones of Air Conditioning controlled by the ISY994, and Homeseer directly monitors the security system.

The design of the Home Automation system is based upon independently operating subsystems (Security, HVAC, Lighting, etc.) all coordinated by a single overseeing entity - Homeseer. The system will operate completely without Homeseer or the ISY994 or the iPads, just not as conveniently.

All of the electronics (PC based) rides on a single Local Area Network (LAN) with high speed access (60 mb/s) to the Internet. Phone traffic is Internet based (VOIP). The network is 100 mb/sec using only twisted pair (Cat 5e). The systems are very reliable with up times measured in years, not counting planned off times for maintenance and upgrades.

All the PC's in the house run Windows 7 and can be remotely controlled from the PC in my office which is my development system. It is a very fast system that I designed and built from scratch. I do that with most of the PC's in the house. This system has 15,000 rpm SCSI drives, 6 GB of very fast memory and a high speed 4 core processor. The monitor has a screen size of 28” and runs at 1920×1200.

The entire server rack, all of the networking equipment and all of the A/V equipment is powered with a 1.5 KVA backup UPS. The backup generator will start in about 20 seconds after a power outage and powers all of the UPS protected components before the UPS batteries cause them to go offline. Because of the UPS, the switching to and from the generator is seamless to the installed electronics.

The local ISP (cable TV and Internet) feeds into a CATV signal splitter (1:2). One output goes to the TV signal distribution system (1:8) and the other to a Motorola cable modem. The cable modem has its own internal battery backup. All the equipment associated with Ethernet, TV and telephone signal distribution is feed off Panel A, but is not UPS protected. I have plans to change this so the “Head End” signal distribution system is powered off the Utility closet UPS.

The output of the cable modem is fed into a Linksys router which has an internal 4 port Ethernet switch and handles two channels of Voice over IP (VOIP). Only two of the Ethernet ports are used, each of them feeding a 16 port Ethernet switch for a total distribution system of 32 Ethernet lines.

Three lines from one of the Ethernet switches go to POE voltage inserters and then to the three ceiling mounted WAPs. The remaining Ethernet circuits go to wall jacks in the various rooms and the outdoor pool area. Several of the rooms (Utility closet, Master Bedroom, Theater, and the Office) have a second 8 port Ethernet switch for local signal distribution.

The Ethernet wiring is all UTP CAT 5e and runs at 100 mbps. No run is greater than 100 feet, and no path between any two devices consist of more than three hops. There are WAP's located in the Theater, the Master Bedroom and the Great Room ceilings.

The network runs very lightly loaded (2-5%) unless I am playing music or watching a movie. I have not yet had a need to run two movies at the same time as I live alone, however I suspect it will probably work. Download speed from the WWW averages about 60 mbps.

The house also has a cell phone repeater system. The outdoor antenna of the repeater is aimed at the cell tower that services my geographic area on a direct line of sight. This was done because the house construction is of concrete block with a large amount of rebar. This made cell phone reception in the house very poor.

The remainder of this document will concentrate on the system I developed for the wall mounted iPads. The fact they are wall mounted is not germane to the system design.

Home Automation Philosophy

My philosophy regarding home automation has evolved over the years. Things change, new capabilities come about, I change.

First and foremost I want important things e.g. Security, HVAC, Lighting control) to work even when computers fail. Not if, but when. The key characteristic of my HA system is that major subsystems (HVAC, Security, etc) will operate with no computers in the loop. This is also important from a home resale factor. The next owner, and there will be one, may not have the same computer orientation that I do.

The HA system has one major “Brain” and that is the Homeseer HA software product. Information about all subsystems is constantly sent to Homeseer from sub-controllers (ISY994 for Insteon devices, Autelis controller for the Pool/SPA, iPads, etc.).

Dynamic scheduling, i.e. the scheduling of events based upon changing status, or by request from a user via an iPad; is handled by Homeseer, with some simple fixed schedules (e.g. landscape lights on at sunset + 30 minutes) handled by the ISY994.

The iPad is used as the primary user interface to all HA functionality. You can change the state of a light for example; from an iPad, from the ISY994, from Homeseer, and most importantly from the switch that directly controls that light. All lighting switches are computers and they will fail at some time. Such failures are single point in nature, of minor operational consequence, and no different than the light bulb burning out. The systems must be self restarting and self healing to the greatest degree possible. All major computers are setup to automatically restart after a power loss. Power loss to the electronic systems in my home is extremely rare due to the use of UPS and a standby generator. I live in the state of FL in the US. The central region (where I am) of FL is the second most prevalent location for Air-to-Ground lightning strikes in the world. Momentary power outages and voltage fluctuations are the norm.

I have never had to replace a computer or other piece of electronics gear due to a power related event, and there is a lot of electronics in my home, probably way to much.

The System Design - Overview and General Practices

System Design

The system consists of Javascript code modules and display pages. The system uses Javascript extensively and the graphics on the display pages merely make calls to the various Javascript functions where ever possible. The system is highly table driven with most details about the configuration kept in a configuration module (configuration.js) as a Javascript object. When the system starts it reads the configuration object and adjusts all key parameters according to the table entries. If IP addresses for components are not provided and the component is uPnP or DLNA compliant, then it will be searched for and the tables adjusted.

Display Pages

There are several display pages three of which are special. The first page, the splash page, is only seen on a boot of the system while all images are cached into the memory of the iPad, and the configuration tables are processed.

The second special page is the home page and all other pages revert to this page after a period of inactivity. When the home page has been inactive for a configured length of time, it reverts to an all black screen, and after several minutes of that page being displayed the iPad backlight is turned off. This is done since a wall mounted iPad is quite bright even with an all black screen at minimum brightness. Too bright for a bedroom at night IMHO.

The final special page is the Caller ID page. This page is shown for 15 seconds when a phone call is received. It displays the originating phone number and the caller's name. At the same time Homeseer is announcing the call giving an alias name, if available, based upon the originating telephone number.

The remaining pages with the exception of the first page all follow an identical layout. The left and right hand sides contain buttons to move between the various functions. Each function has a dedicated page whose central area contains the controls and displays for that function.

Javascript Modules

There are many Javascript modules. The modules are all functionally oriented to a specific page and/or functionality. There is a main module that is given control by the CommandFusion (CF) system when all modules have been loaded. Specifically the CF.userMain function is called which resides in the module making it, in effect, the startup module.

Before going into the individual modules and the associated display pages allow me to digress and speak about the coding and Javascript organization style used for the project.

Project Organization and Coding Style

I organize my CF projects into one folder per project all of which are kept on a server in a master folder. The project folder has subfolders called Documentation, Javascript, Resources, and sometimes additional folders for supporting objects. The main project folder contains the .gui module for the project. The CommadFusion architecture wants all resources (Javascript files, images, data files, etc. to be in folders headed by a root folder. By definition the root folder (the root of the directory tree) is the folder that contains the systems GUI file. [ TIP: The GUI file is an XML formatted text file. I have been able to resolve and “fix” several issues by dealing with the gui file directly using a simple text editor. I use TextPad, a free editor with many useful features.]

I keep my project folders, the root folder and directory tree that make up a project, in a master folder on my web server. This folder is not accessible external to my LAN and is where all my iPads go to load their systems.

Each Javascript module with two exceptions, is coded as a Javascript object. The name of the object can be thought of as the root of the namespace for that module. All things in that module must be referenced (even from within the module itself) as properties of the modules root name. This allows you to reuse names inside different modules without concern for their also existing in another Javascript module. For example each of my modules has an “initialize” function. In the HVAC module it is referred to as HV.initialize since the root name of the object that is the HVAC module is “HV”. Similarly the Pool module has a root name of “PL” so its initialize function is referenced as PL.initialize.

Each project has one JS module (I generally name it “Main”) that is written in “pure JS” and not as a large object. There is also a second “pure JS” module that holds functions common to all the other modules. This causes things in those modules which are externally available to be named directly without the need of a prefix representing the module itself. The Main module contains the CF.userMain function along with event handlers for page flips, Clock and Timing (called once per second), and preloading completion. The userMain function sets up “watches” for the major events.

The subroutine module contains many common library routines that I have found useful over the years. For example there is a function called uPack which takes a string argument, and returns the same string with all spaces removed and in uppercase. Very useful (and forgiving) when doing text compares. Most library functions are simple one liners, but some are more complex e.g. showHEX which displays any text string as a sequence of hex characters. This is very handy for viewing communications messages; showCOM shows a string with all formatting codes (Carriage return, tab, Line feed, space) explicitly visible using the standard ASCII mnemonics for the control codes. Another key function in the Subroutines module is the Dialog Function which handles popup displays for special notices such as troubles and errors.

All other modules (I call them the Work modules) are written as a single object encapsulating all the functions and data elements used by that module. This means that all functions and data elements defined in that module need to be referenced using the module prefix as the object name. For example, the Autelis Pool Control functions and key variables are contained in an object variable named PL, while the HVAC functionality is contained in an object variable named HV. [Note: I generally use two or three capital letters to name the object]. Ergo to access the Autelis module's initialization function one would write PL.initialize(a, b). This technique, which is recommended by the CF team, allows each module to have the same functions with no naming conflicts. Following the modules encompassing object definition a single line of code exists which is used by CF to instantiate the module and call its setup function if required.

The work modules supply supporting code to one or several pages. They have certain functions that I generally provide in every module with similar operational characteristics:

setup:Called by CF when the module is loaded.
initialize:Initializes the module. It is normally called when a Page that uses this module is loaded (page flip event).
feedback:The function that handles feedback from a system that is capable of two way communications. I generally code the feedback regex associated with an external device as (^*) which allows any string of characters and is equivalent I am told to (*) or (.). This presents to the modules feedback function the text received from the device up to that point in time. It should be noted that when dealing with RS232 and interface devices such as Global Cache units or the Xeta server (A single port TCP/IP to RS232 interface) a message may not arrive in a single packet. If the message protocol does not use a terminating sequence then code must be used to ascertain when the full message has been received and to validate its content.
actions:The function that handles user actions such as button presses.
timeout:Called when a timer associated with a message transmission times out waiting for a reply (feedback).
reset:Called when the communications system needs to be reset to start looking for another reply, normally after a timeout or error.
send:The function to send a command, or possibly resend, a command to an external device. The send function is responsible for enveloping the message in any necessary control characters and starting the transmission timer. In some systems it is possible to use a “sendQueue” to schedule many commands. A command will only be sent after the prior command has returned a reply.

Dealing with External Systems

When dealing with an external system e.g. an iTach, a GC-100xx, A PC handling a specific capability in my home, or the ISY994i; I generally handle the code in a fairly uniform manner.

Class 1:

TCP system I did not write and only handle one connection at a time:

I setup the control system to be always on in the guiDesigner. As soon as I initialize the system I use CF.setSystemProperties to disable the system so it does not attempt to make a connection. I then enable and disable the connection as needed. I enable it when I am ready to send, and disable it after I receive feedback to the transmission.

If the transmission times out waiting for feedback, I reset the system (disable it) and resend the message. I will do this up to 5 times before declaring the system down.

If I am using a queue to drive the system I put items into the queue I want sent then start a send function which transmits the earliest item in the queue (FIFO operation). I pull the next item from the queue when feedback has been received and processed. This provides perfect timing for things such as IR macro sequences if the IR pattern has the proper final off time.

Class 2

TCP systems using a server I wrote that handles multiple connections.

The system is setup as always on in guiDesigner and left enabled when I initialize the system. This causes iViewer to connect to that system and keep trying to do that periodically until successful. When successful we have what is known as an active session since I do not disconnect it. If the external system fails, iViewer will continuously attempt to reconnect.

Transmissions to the system are generally Queue based with an interesting caveat. I optionally include as a prefix in the transmission the name of the feedback function which is to process the reply. The server sends the feedback with this prefix as a prefix in the feedback message. This allows me to decide based on the feedback received, what process will handle the message with almost no effort.

Class 3

TCP systems which I have no Control over.

I just obey the protocol that the system requires.

I know that the CF staff have made recent improvements in the handling of TCP systems and getting feedback. I need to update (simplify) my code to use their efforts.

Debugging

Each module has debugging built in. The debugging aids consist of variables to control the level of debugging and when things will be placed into the CF.log file if debugging has been turned on. The production systems (wall mounted iPads) run with debugging turned off. The highest level debugging variable in each module is named trace. Almost every function has as its first line:

if(XX.trace) CF.log("The XX.nameOfFunction function has started with inputs= . . .");

This provides a simple flow trace when things do not work correctly after a change.

Activity Log

The system maintains a set of activity log files containing the most recent 50 log entries relating to a specific functionality, e.g. the ISY994. These log entries are not the same as those sent to CF.log for debugging, but document the progress of a specific application functionality as it is running. Significant events are logged as well as warning and error conditions. All asynchronous inputs from either Homeseer or the ISY994 are also logged here. This log can be displayed from a button present on most pages. The log display page allows for the selection of which particular log is to be displayed.

Handy Tools and Aids

Agent Ransack

This a free piece of software that will search all folders of a tree and all files within these folders for a specific string of text. It is very fast. I use it to verify that some Javascript function is not in use any longer so I can remove it and clean up the code.

Textpad

This a free text editor that I use as my standard editor. It understands the difference between PC and Unix line endings. It provides line numbers. It has a list of all the ASCII characters and their decimal indices.

Compare and Merge

A free utility that compares two files flagging all discrepancies with simple commands to correct or remove the discrepancies.

Antechinus Javascript Editor

This is the Javascript editor I use. It is not free but not very expensive either. It has color coding of Javascript types, Pretty printing, Syntax checking and much more. On the advice of others here I am going to look at WebStorm, but old habits die hard.

Systems Operation Overview - Display Pages

The system starts in CF.userMain of the Javascript module Main.js. CF.userMain sets some joins to their startup state, and sets up a watch on Preload Completion. While iViewer is loading the gui file, caching any images and while the system is processing any configuration assets, the system puts up a “Splash page with a spinning hourglass:

Configuration assets include: Interface definitions to external systems.

  • Mapping of IR driven components such as TV sets or STB's to iTach or GC-100 connectors.
  • Loading and mapping of IR files to reference names and devices they apply to.
  • Display Information about all lighting and appliances controlled by Homeseer or the ISY994i.

iViewer will not cache and guiDesigner will not export into zip files any resource that is not explicitly referenced in the guiDesigner XML output, the “gui file”. For that reason all configuration data is encoded into an object named “CFG” in the module “Configuration.js” which is referenced in the project script manager and therefore loaded. The CFG object contains sub objects with the configuration data for a logical entity e.g. a Rooms, Scenes, Interface connectivity, IR files, station (FM, Sirius) lists, and TV channel lists.

At startup after the completion of preloading as signaled by the firing of the preloadCompletionEvent, the system contacts Homeseer and the ISY 994 requesting the current status of every device that they directly control (X10 based devices, the Security system, Insteon device, etc..).

The configuration tables for all devices and systems (e.g. the pool system) are updated with the current state by recording: on/off state, brightness (0-255) if applicable, and a text string if applicable (e.g. standby battery voltage).

Homeseer will dynamically transmit status of devices under its control using a UDP broadcast message. [Note: the Homeseer status messages are sequence numbered and each message is sent N times (N=2) with the same sequence number. This reasonably handles the fact that UDP is not a guaranteed delivery protocol but rather a best effort protocol].

For the ISY994i, a message is sent to turn on subscriptions which cause the ISY994i to send to the iPads any and all status changes for every device it is cognizant of.

When a status message comes in the internal configuration tables are obviously updated. Most entries for a device configuration tables have a “display” sub object.

The display object has several sub objects which are used to drive the information on pages to be updated. The updates to the page displays take place whether they are visible or not. The graphics or text being updated may be in lists and may appear on different pages with the same or different join numbers. The display sub objects are as follows:

Title:Sets the text for a title string. Sets the text for the display graphic which might be in a list.
Icon:Sets an image to one of two images based upon on/off state
Opacity:Sets an images opacity between 1 and 0 based upon brightness
Slider:Sets the position of a designated slider based upon brightness
Text:Sets a text string based upon the current brightness with optional prefix/suffix
String:Similar to Text, but uses the string returned by feedback or an asynchronous input

[Note: for Opacity there are normally two icons at the same position on the page or in a list. The bottom icon is the “Off” icon to be visible when brightness is 0. The top icon is the “On” icon whose opacity is changed based upon the current brightness. At full brightness its opacity is set so it is opaque, at 0 brightness its opacity is set to be transparent. With the proper choice of Icons, this can be a very impressive display].

The remainder of the document will discuss the various pages that make up the iPad graphics. Some pages have multiple subpages and I will provide examples showing the page in various states.

The Home Page

The Home page or Idle page is the first page transferred to when the system has finished its initial setup, or when a page has “timed out”. Each page is timed when it is displayed. The timer is reset on any action to that page so it effectively determines the page's idle state. The Home page looks as follows:

The weather display is updated every hour by an external system which is queried when this page is loaded to be displayed. Each of the black buttons will transfer to a page that displays the state of that function and has the necessary buttons for control.

There are two buttons that do not operate that way; the button for the SqueezePad music system and the button for Movie Showtimes. These two buttons use a URL Schema to load either the SqueezePad app. or the IMDB app. iViewer then will be in the background still running since it is run in multitask mode. Exiting those apps just require a single click to bring iViewer and the system back into view; or if the version of IOS is recent a 4 finger swipe will go back to the prior app in the active multitasking list. These buttons use a Brass coloration to differentiate them.

Local Weather Page

This is the weather detail page. The top portion of the page is the current weather as recorded at the stated time. The graphics all change based upon the weather conditions and the background changes from blue to gray at night (after sunset) and back to blue at sunrise.

The bottom portion of the page is a scrolling list that holds a week's forecast showing both day and night conditions. There are no controls on this page other than those on the right and left for changing the page being displayed. Obviously the ability to scroll the forecast list exists.

Pool/SPA Page

This page displays all of the status received from the Autelis control system that monitors and controls the pool and SPA. The status is dynamically updated as things change. The various on/off buttons will control the functions they are titled to. The SPA may be scheduled for turn on by adjusting the values in The “Set SPA Turn On” region. Homeseer is used to handle the scheduling of a SPA turn on event.

The Autelis control will maintain only a single IP connection at a time. The logic for sending it commands involves (1) connecting, (2) sending the command, (3) waiting for the feedback response and then (4) disconnecting. If a connection cannot be made (another iPad is connected) it is re-tried at 500 millisecond intervals until successful or a maximum retry count has been exceeded. If the maximum retry count is exceeded a dialog is place onto the screen to inform the user of the issue. Note by CommandFusion: You could get around the issue of a single connection by using a CommandFusion LAN Bridge as a multiplexer.

The Autelis Control will send UDP messages for each change of state for any of the pool devices. It sends each message twice as a sequence numbered UDP broadcast to all hosts on the network.

HVAC Page

This page is similar in concept to the Pool/SPA page but handles the two zones of Air Conditioning in my home. The system uses Insteon thermostats and the associated control logic. Each Thermostat talks to the ISY994. The use of the controls on the page should be obvious. The system updates dynamically whether the page is visible or not.

Displaying the page merely displays the current values since the joins were updated as the components they represent changed and asynchronous (unsolicited) feedback was received.

Lighting Control

The lighting control page handles all lighting for the house. When flipped to, it will initially show the list for the room the iPad is in. Lighting status is continuously updated whether this page is visible or not. The lower part of the list is normally not visible. It is made visible by touching the title of a light in the list. The list then rolls up to expose the slider. If the entry in the list has a percentage to the right of the bulb icon, then there is a slider associated with that light and the list may be rolled up to expose the slider.

All lighting is controlled by the ISY 994, as are all Insteon devices. The ISY994 can handle 10 simultaneous clients (in my case a client is an iPad), and a relatively unlimited number of devices. Each iPad “Subscribes” to the Insteon during startup, after requesting the ISY configuration and the status of all the devices under ISY994 control.

Non-Lighting Device Control

This page is very similar to the Lighting control page. When this snapshot was taken the Cable box wall receptacle was powered and the Hot water circulator was operating. All other devices were off/closed. The cable STB in the kitchen is out of reach so to “reboot it” was a pain in the butt. It no longer is.

The hot water circulator is a small pump to circulate hot water to every fixture in the house. The house is large so waiting for hot water to arrive at a shower can be a little annoying. The circulator only runs when the house is disarmed and between 7AM and 11PM. If however you walk into a bathroom and turn on the lights, then the circulator immediately starts and runs for one hour. The devices under the control of the ISY994 include Thermostats, Lighting switches, Relays to control outlets etc.

Caller ID and Call Status

The above is the call status page showing calls received. The actual callerID page is bright with a telephone as the background, using large type so it can be read from across the room. The Caller ID page shows who called, and the callers number. The CallerID page is displayed for 15 seconds and then the system reverts to the prior page, generally the black screen.

Homeseer handles the incoming call using a caller ID device which sends it the Caller ID information over a serial link. Homeseer looks up the phone number in a special list to see if it is a known number and if so changes the name displayed to a more readable piece of text. Homeseer announces the call over the house's announcement system (a ceiling speaker in each major room) stating the phone number and the name.

The caller ID message is also broadcast to the Theater control PC. That PC has a list of callers by number for which it will pause the theater (Movie, TV show, whatever is playing) so that the call can be answered, and displays the incoming call on its control screen. When I am finished with the call in the Theater, I just touch the “Play” button on the theater's remote system (Philips Pronto PRO 9800).

Stock Market Status Page

At one time the DOW was displayed but that changed when the owners of the DOW index stopped supplying the feed. The button labeled “Market Dash” will bring up the Market Dash app using its URL Schema. Unfortunately they do not supply a return option in their Schema. If the IOS is recent enough, then a 4-finger swipe can be used to bring back iViewer.

This app has all of the DOW information plus history and trend data.

The current status of any stock can be queried using the “By Symbol” button after entering the symbol in the text filed provided. The portfolio configuration is maintained by Homeseer from a text file which is easily changed with a text editor.

Alarm Clocks Page

This page allows for the control of alarm clocks, one for each of the three possible sleeping areas of the house. When the page is brought up the date and time are set to the current values. When an alarm clock is setup, Homeseer manages the wakeup call.

The wakeup call starts with the playing of a melodious chime followed by an audio announcement stating the time. Optionally I can have the current weather parameters (temperature, and conditions) spoken after the time.

Each room of the house has speakers under the control of Homeseer such that an announcement can be played over all the speakers or a subset of them.

At one time, before I was retired, I traveled quite a bit. My secretary would send an email to Homeseer on my domain with the flight information. Homeseer would then compute when I needed to be awoken and set the alarm clock appropriately. I trusted my secretary not to play games, she enjoyed her well paying job so it was a nice symbiotic relationship.

House Security

The house security system is an Napco Gemini 3200 system which is monitored 24/7 by a security service. The system is interfaced to Homeseer over a serial link.

When I leave the house (I am a widower and currently live alone) I touch a button on the mirror of my car. This sends a message to Homeseer using a Lutron RA system which links to the Homelink system provided by many car manufacturers. Homeseer will know which car I am in, and what time I left. Homeseer then makes sure the garage doors are closed and arms the house security system. When I return, a second button on the mirror is pressed to indicate that fact and Homeseer opens the appropriate garage door for that car and disarms the security system. The third button allows me to leave or return without changing the house's security state.

When I return and enter the house I will be seen by a motion sensor. Homeseer issues a greeting over the audio announcement system and speaks the list of people who called while I was gone, or tells me there were no calls.

I had looked into RFID tags for the cars, but it was not reliable enough. The Homelink/Lutron system has a range of about 100 feet.

Timed Events Page

The timed events page allows for the control of various devices according to some future scheduled event. The SPA is obvious, but does not show here. It is scheduled from the Pool/SPA page. The kitchen which was designed by my late wife, a gourmet cook, has a large center island. There are no ugly “Outlets” anywhere in the kitchen.

The Center Island has a drop down panel at each end which when opened reveals a 6 outlet power strip. These power strips are controlled by the ISY994 and may be set to turn on or off using this page. Very handy for parties when we want to brew coffee at a specific time.

About eight inches above the counter top under all the cabinets is a recessed power strip (Plugmold) with an outlet every 6 inches. The strip is covered in wood veneer which matches the cabinets and the outlets are faux painted to match the veneer. The surface of the strip is flush with the back splash giving the appearance of an accent stripe. My wife's issue was that kitchen outlets were never where she wanted them. I solved that problem! There is an outlet every 6 inches for the full length of all the counters.

Whole House Music

This is the page for the Whole house music system which is a slight misnomer. It should be called the Great Room music system as that is where it plays. It does also play on the Lanai. It interfaces to the Theater Control PC which is normally asleep (Power state s3).

When this page starts it first wakes up the PC by sending it a WOL. When feedback indicates the PC is ready it sends a command to the PC to turn on the Audio system, zone 2, which feeds the house music speakers. The in-wall house music speakers are not the same as the in-ceiling announcement speakers. When the Audio system is fully powered up the system then selects the SIRIUS tuner which is connected to the audio system and the audio system powers it up automatically. Music starts playing on the last selected SIRIUS station.

The grey area is a sliding list divided into the SIRIUS radio categories, and within the categories by each station. The station list is maintained in a configuration file for both the SIRIUS tuner and the FM tuner that is part of the audio system.

Touching the button marked “FM Tuner” will have the audio system switch to its internal FM tuner and the display will change to the following:

Touching the XM Radio button will revert the system back to the XM radio and bring up the prior display.

The little speaker with the X through it controls the announcement speaker on the Lanai. It is normally off, but can be turned on if I am going to be poolside. With it on such things as a phone call or the door bell ringing will be announced poolside.

Oops, there is no doorbell! Pressing the doorbell button sends a message to Homeseer to do its “doorbell” thing. It first plays a brief audio string (think Chime) which can be set to one of several on the Settings and Mode page. It then states: “Someone is at the front door”.

I change the doorbell chime based upon my mood or the season. This will become obvious when I show the Settings and Mode page.

Settings and Modes Page

This is a catch all page for setting operating modes and similar things. The selection of the doorbell chime should now be obvious.

The Slide Show window picks the slide show to be displayed if the Idle screen is set to slide show. The iPads then mimic a digital picture frame as opposed to a black screen.

The pseudo room selection only appears on my development iPad. The wall mounted iPads each know what room they are in.

The mode control list allows for the setting of various house modes. The top three entries relate to a simulated Grandfather Clock chime. “We Have Guests” changes how lights are turned off when I retire for the night. If I have guests, then the lights in the guest wing are not changed. If my friend is here then she gets a good night message and a greeting, it being assumed she is with me. Greet owner has to do with greeting me when I return home. Call transfer on exit is a hold over. my VOIP system automatically transfers calls to my cell phone if I do not pick up after 4 rings. I just have to remember to take my cell phone with me when I go out.

JavaScript Modules - Design and Operation

General Project Design

I am a programmer (coder) at heart. I have always liked to build things. I do cabinetry work, building furniture when the need arises. My late wife liked this aspect of my personality. She would take pictures of my workshop into Home Depot at gift giving times and merely ask “What is he missing?”. I built my own stables and corrals when I was into horses, dog houses and pens when I was into showing dogs. Jill, my late wife, told me not to take up golf as building golf courses was too expensive and time consuming. Programming is an avocation that allows one to build very complex things at relatively low cost and get significant gratification when accomplished.

By “programming” I do not mean the placement of graphics on a page, but rather the writing of code in a recognized programming language. One of the major reasons I chose CommandFusion for my HA efforts, and the Pronto PRO before that, was that they both were based on and reasonably made use of a major programming language to enhance capability and functionality. In fact I had a lot of code re-use between the Pronto PRO and iViewer because I dealt with them in the same manner doing all the work in Javascript.

My “style” in using CF is to have all actions, whenever possible performed by referencing a Javascript code function to perform the work. An excellent example of this is the handling of TCP communications for intractable external systems. It seems that many software designers who work for major component manufacturers (e.g. Denon) have a philosophy of “My way, or the Highway”. Because of the Javascript capability in Command Fusion I was able to handle some pretty unreasonable (IMHO) external systems.

To the credit of the CF team, when I told them what I was going through they added basic functionality that relieved/resolved the issues. I process all feedback in Javascript, using the simplest regex possible for that external system. I do all message detection and isolation in Javascript. In this way I have no one to blame but myself when things don't work. There is a large amount of commonality in the process of detecting a message and isolating it form an input stream. Once a message is isolated, the processing of its content becomes device specific, but can be handled quite easily using the Javascript concept of a sieve, the switch statement.

I try to write all my systems to be table driven to the greatest degree possible. Changing the contents of tables is much less error prone than changing code!

Dynamic Configuration Capability:
The entire system is dynamically configured by the contents of the module “Configuration.js”. This module has several classes of items.

Control:Defines the names of the sub-objects in CFG.
Interface:Defines the external systems and how they are interconnected.
IR Files:Contains all the data needed by an iTach to send a named IR pattern to a device.
Station Lists:Contains the information to build lists of TV channels or radio stations.

The Interface object looks as follows:

Interface_config:

{"systems":[	{"name":"pageToStart", "device":"iPad", "page":"HC_HomeControl" },
 
		{"name":"IRsystems", "installed":true, "converters":[{"model":"Global Cache",
			"device":"GC1"}, {"model":"Global Cache", "device":"GC2"} ] },
 
		{"name":"iPadPAL", "installed":true, "stack":"ProntoPal",
			    "IP":"192.168.1.204", "protocol":"TCP", "port":"8000" },
 
     		{"name":"Theater", "installed":true, "stack":"Theater",
			"IP":"192.168.1.205", "protocol":"TCP", "port":"7011" },
 
		{"name":"XAP", "installed":true, "stack":"XAPUDP",
			"IP":"192.168.1.255", "protocol":"UDP", "port":"3639" },
 
		{"name":"GUI_Reload",       "installed":true, "stack":"GUI_Reload",
			"IP":"192.168.1.255", "protocol":"UDP", "port":"8001",
			"url":"192.168.1.207/HomePage/CommandFusion/iPads/House.gui" },
 
		{"name":"Homeseer_PAL",     "installed":true, "stack":"Homeseer_PAL",
			"IP":"192.168.1.204", "protocol":"TCP", "port":"8009" },
 
		{"name":"ISY99i",           "installed":true, "stack":"ISY_Subscribe",
			"IP":"192.168.1.229", "protocol":"TCP", "port":"80",
			"URL":"/desc", "Lighting_Object":"HS", "ISY_Userid":"admin",
								 "ISY_Password":"admin" },
 
		{"name":"Autelis_Command",  "installed":true, "stack":"Autelis_Command",
			"IP":"192.168.1.230", "protocol":"TCP", "port":"6000", "Object":"PL"},
 
		{"name":"Autelis_Broadcast","installed":true, "stack":"Autelis_Broadcast",
			"IP":"192.168.1.255", "protocol":"UDP", "port":"7890", "Object":"PL"},
 
		{"name":"GC1", "device":"SerialConverter",  "manufacturer":"GlobalCache",
			"model":"GC-100-12",  "ip":"192.168.1.70", "protocol":"TCP",
			 "serial":2, "ir":6, "relays":3, 
			"serialPorts":[{"name":"SP1",   "port":4999, "connector":"1:1"},
					 {"name":"SP2",   "port":5000, "connector":"2:1"}],
			"relayPorts": [{"name":"RP1",    "port":4998, "connector":"3:1"}, 
					{"name":"RP2",   "port":4998, "connector":"3:2"}, 
					{"name":"RP3",   "port":4998, "connector":"3:3"}],
			"irPorts":    [{"zone":1, "port":4998, "connector":"4:1"}, 
					{"zone":2, "port":4998, "connector":"4:2"},
					{"zone":3, "port":4998, "connector":"4:3"}, 
					{"zone":4, "port":4998, "connector":"5:1"}, 
					{"zone":5, "port":4998, "connector":"5:2"}, 
					{"zone":6, "port":4998, "connector":"5:3"}] },
 
		{"name":"GC2", "device":"SerialConverter", "manufacturer":"GlobalCache",
			"model":"iTachIP2IR", "ip":"192.168.1.71", "protocol":"TCP",
			"serial":0, "ir":3, "relays":0, 
			"irPorts": [{"zone":1, "port":4998, "connector":"1:1"}, 
				     {"zone":2, "port":4998, "connector":"1:2"}, 
				     {"zone":3, "port":4998, "connector":"1:3"}] },
             {"name":"GC3", "device":"SerialConverter", "manufacturer":"GlobalCache", 
			"model":"iTachIP2IR", "ip":"192.168.1.72", "protocol":"TCP", 
			"serial":0, "ir":3, "relays":0, 
			"irPorts": [{"zone":1, "port":4998, "connector":"1:1"}, 
				     {"zone":2, "port":4998, "connector":"1:2"}, 
				     {"zone":3, "port":4998, "connector":"1:3"}] 
],     // end of interface configuration entries for "Systems"
"devices":[ {"name":"Master_TV",    "type":"IR",     "rmt":"MTV", "manufacturer":"Vizio",
		"model":"E552LV", "iface":"GC1", "zone":2, "path":"Vizio_TV", "IRid":"VIZ"},
	     {"name":"Master_Tivo",  "type":"IR",     "rmt":"TVO", "manufacturer":"Tivo",
		"model":"Premiere", "iface":"GC1", "zone":2, "path":"Tivo", "IRid":"TVO" },
	     {"name":"Master_Dune",  "type":"IR",     "rmt":"DUN", "manufacturer":"Dune HD",
		"model":"Base 3.0", "iface":"GC1", "zone":2, "path":"Dune_Player", "IRid":"DUN" },
	     {"name":"Master_SWT",   "type":"IR",     "rmt":"SWT", "manufacturer":"DVDO",
		 "model":"Quick6", "iface":"GC1", "zone":2, "path":"DVDO_Quick6", "IRid":"SWT" },
	     {"name":"Guest_TV",     "type":"IR",     "rmt":"GTV", "manufacturer":"Insignia", 
		"model":"ZRC-101",  "iface":"GC1", "zone":4, "path":"Insignia_TV", "IRid":"ISG" },
	     {"name":"Guest_STB",    "type":"IR",     "rmt":"GST", "manufacturer":"Cisco", 
		"model":"3250HD", "iface":"GC1", "zone":4, "path":"SciAtl_4200HD", "IRid":"STB" },
	     {"name":"Kitchen_TV",   "type":"IR",     "rmt":"KTV", "manufacturer":"Insignia",
		"model":"ZRC-101", "iface":"GC1", "zone":1, "path":"Insignia_TV", "IRid":"ISG" },
	     {"name":"Kitchen_STB",  "type":"IR",     "rmt":"KST", "manufacturer":"Cisco",
		"model":"3250HD", "iface":"GC1", "zone":1, "path":"SciAtl_4200HD", "IRid":"STB" },
	     {"name":"Aqualink",     "type":"TCP",    "rmt":"AQU", "manufacturer":"Jandy", 
		"model":"RS_4",     "path":"JandyAqualink" }
	    ], // end of interface configuration entries for Devices
 
 "modules":[ {"name":"ISY99_System", "id":"ISY", 
				"log":"Interface Configuration: Includes ISY99i"}, 
 	      {"name":"Homeseer",     "id":"HS",  
				"log":"Interface Configuration: Includes Homeseer" }, 
 	      {"name":"IRdevices",    "id":"IR", 
				"log":"Interface Configuration: Includes IRdevices" }, 
 	     {"name":"Autelis",      "id":"PL",  
				"log":"Interface Configuration: Includes Autelis Pool Control" },
 	     {"name":"PictureFrame", "id":"PF",  
				"log":"Interface Configuration: Includes Digital Picture Frame" }, 
 	     {"name":"HouseModes",   "id":"HM",  
				"log":"Interface Configuration: Includes House Modes" } 
] // End of interface  Configuration for Modules
}, // End of Interface configuration
case-studies/barry-gordon.1380254204.txt.gz · Last modified: 2013/09/27 03:56 by aaron