|
|
Some notes on the HCA sample MyHome.HCA
|
| Battery Charger. The sample home contains a gas backup generator with a remote start feature that uses a battery. To make sure the battery is keep fully changed the sample home has a trickle charger connected to the battery and the charger itself plugged in through a heavy duty appliance module. The sample schedules in the home contain entries for the charger to have it go on for a few hours each month. |
| Bedroom Light 1. This light is controlled by a PCS Smart Switch. The important feature of this X10 controllable switch is that it accepts preset dim commands. These are a slightly different set of dim and bright commands than most inexpensive lamp modules accept. Suppose a lamp is connected to a lamp module and is off. If a command to dim it to 50% illumination is sent to that lamp, it first comes on full bright then dims halfway down. The PCS switch doesnt work that way. It can come on from off directly to halfway dim. One other feature of the PCS switch is that it responds to the All Lights OFF command. If you look at the Advanced tab in the properties for this device you will see that the capabilities have been set to describe this switch. | |
| Chime. This is SC546 remote chime. This X10 device plugs into any outlet and when an ON command is sent it makes a chime sound. Nothing happens when an OFF command is received. | |
| Deck Lights A D. These may appear to be four devices but are really only one. They are have the X10 address D2. We created four devices to match the four lights on the deck just to make the floor plan look more like whats in the sample home. Since they all have the same X10 settings, an X10 command sent to Deck Light A is the same as if sent to Deck Light D. | |
| Garage Door. The garage door in the sample home is connected to a garage door opener. Rather than use the remote supplied with the door opener we are going to control it using X10. The Garage Door device is a UM506 Universal Module. Most garage door openers come with a push button switch mounted in the garage so you can open the door without the remote. The UM506 is an X10 remote relay that gives us the ability to remotely press that button. We will return to this device when we look at the Leave / Arrive by Garage program. | |
| Garage light 1 2. Like the deck lights this is really only one device. | |
| Garden Sprinkler. This is another UM506 module controlling the electric value in a built-in sprinkler system in the garden. | |
| Great Room lights pod A D. These are four different devices. When we look at groups you will see how we combine them into one group for easy control. | |
| Hot tub filter and heater. The home hot tub is controlled by a number of HCA programs examined later. These two devices use heavy duty appliance modules wired in when the hot tub was installed. | |
| Hot tub room light 1 2. Same as the deck lights, really just one device. | |
| Kids room light. This is the ceiling light in the kids room. We are going to control it a way that makes it work a lot like the PCS switch in the master bedroom. More on this later. | |
| Outside lights. There are five independent devices for the outside lighting. Two of them, the garden light and the light at the right side of the house, are PR511 motion detector lights. These lights have a number of cool features we can use in the sample home. One feature is that they can report their status. A special X10 command is sent out and the device tells us if it is on or off. This is one of a very few X10 devices that do this. In the advanced properties for this device we tell HCA about its status reporting capabilities. The front and garage door lights are simple wall mounted lights that can be dimmed. The back light is a flood type lamp, but not a PR511 and it cant be dimmed. | |
| Picture Gallery 1 2. Another place where we have two HCA devices that are really a single X10 device. |
One of the hardest things to do when working with X10 is decide the housecode and unitcode settings for each device. Later on we will look at the reasoning behind some of the settings we used in the sample home.
We chose to make two groups in the sample home:
| Outside Lights. Its members are each of the outside light devices. | |
| Great Room Lights. Its members are each the four ceiling mounted great room lighting pods and the one freestanding lamp. |
The sample home contains 18 programs and thats a lot. Not all programs are complete in themselves. That is, some programs are used to provide functions to other programs. Rather than examine each one in turn, well look at the task we are trying to accomplish and see how we do that with one or more HCA programs. Our discussion starts with the simpler programs and works up to the more complex ones.
Program Go To Bed
This is a simple program designed to be started when its time to call it a day and head upstairs to the bedroom. It works in three stages:This program has its own X10 housecode and unitcode so we can start it from a control panel.
Program Forgotten Lights
This program is designed to be scheduled for some time after were in bed. It turns off lights that we sometimes forget. In a house with more than one floor its easy to forget lights in rooms out of sight. We didnt use an All Lights Off element in this program because so few of our devices respond to it. We also didnt want to use the All Units Off element since we didnt want everything off. What we did was turn off those lights we seem to forget most. If they are already off, sending them an OFF command has no effect.This program doesnt have a house and unit code since its something that we never want to do from a control panel only from a schedule.
Program Leave and Return
The sample home design contains two schedules: At Home and Away. The Away schedule contains many entries for interior lights in an attempt to give the home a lived in look. The At Home schedule controls only those devices we want to have automatically go on or off when were home, like the outside lights, the fish tank light, the picture gallery lights, etc.When we leave the house we want to switch to the Away schedule, and when we return we want to switch to the At Home schedule. Since we have just these two schedules we wrote a simple program that toggles between the two. Run the program when the current schedule is Away, and the At Home schedule becomes current. Run it again, and the Away schedule is made current. This program uses the Test element to see which schedule is current. Based upon that test, the other schedule is made current.
This program is assigned a housecode and unitcode so it can be started from a control panel mounted near the door to the garage and near the front door. We made the program start only with an ON button since we used the toggle method described above. We could have used the ON press for "were home" and the OFF press for "Were out of here", but we thought it would be simpler to just remember to press the button at every entry and exit and let HCA figure out what to do.
One other small feature of this program is that it uses a custom icon. Using the Windows Paint program we drew a (somewhat crude we admit) house. In the ON representation it has lighted windows, the OFF representation has dark windows. These two icons were added to the sample home using the icon gallery. This program uses the Change Icon element to control the icon shown for this program. Since the program itself is controlling its icon, we need to check the Changed by Program option in the programs advanced properties.
Programs Sunrise and Sunset
These programs do almost nothing. Program Sunrise starts at sunrise and program Sunset starts at sunset. All they do is display a message on the HCA display. In the future, we may change them to use the "Play Sound" element to play appropriate music at these times.Program Leave / Arrive by Garage
This program is a bit more complex then those described above. This program is designed to be started using a wireless remote from our car as we approach the house coming home, or as we are driving away. The program is assigned a housecode and unitcode and is started by either an ON or OFF command. If I press my remote in the ON position, Im coming home. I press in the OFF direction when leaving. To have the program be able to start upon ON and OFF commands, I need to set its advanced properties appropriately.Here is what the program does:
The Wake Up program set
There are two programs that comprise this set: program Wake Up and program Bedroom Soft Light. The Wake up program is designed to be both scheduled and started from a control panel.Before we get into what exactly these programs do its best to understand what we want to accomplish. We would like to be awoken gently, not with the harsh blare of the radio and all the bedroom lights on, but slowly as the room gradually brightens. We would like the morning bread to be ready and the coffee fit to drink. Finally we want to use this program in both the At Home and Away schedules but we dont want to control the appliances when we are not at home.
Its also important to consider the time table of when things need to start. For example, lets say that I want to get out of bed at 4:45am. It takes me about 30 minutes to get ready for the day and then I want to eat. In my home I have a bread maker that takes about 2 hours to go from off to bread ready to eat. So if I really want to get up at 4:45 and eat 30 minutes later I need to start the bread maker at 3:15am. Here is my timetable:
| 3:15am: Start the bread maker | |
| 3:15am + 1 hr: Start turning on the bed room lights slowly takes 30 minutes to be full on | |
| 3:15am + 1 hr 30 minutes: All lights and radio on | |
| 3:15am + 1 hr 50 minutes: Start coffee | |
| 3:15am + 2 hours: Ready to eat | |
| 9am: Everything off |
Whats important about this timetable is that I need to schedule the process to start 1 and ½ hours before I want to be really awake, and 2 hours before I want to eat.
Here is what the program does:
A few important observations. This program uses both the Delay and Wait Until elements. Using the Delay element we can schedule the program to start anytime and still have its actions happen according to our timetable the bread maker always gets two hours to make the bread. The Wait Until element sets a specific time something happens. Since we know we always are gone by 9am, it's safe to use that time in the wait until element.
The next program in this set, the Bedroom Soft Light program uses a technique that slowly turns on a light. During the 30 minutes this program runs, the light gets brighter slowly.
This program uses a Repeat element to execute two elements 30 times. These two elements are:
Once these two elements are executed 30 times, the bedroom light is at 100% illumination and 30 minutes have passed. You may note that if you increase by 5% 30 times, the light should be at 150% - not 100%. This apparent inconsistency is due to the method used by the dim element to compute the number of levels to increases or decreases for a percentage. This is fully explained in the Users Guide. In this case, using 5% causes the light to increase one level at a time.
As described in the devices section, the light we are using in the bedroom is controlled by a PCS switch that supports preset dim. This allows the light to go from full off to 5% illumination without going full on and then dimming down.
Another point to consider about this program is that we didnt perform this light control directly in the Wake Up program. We use another program to do the actual work. This is an important point if possible break down what you want to do into a series of HCA programs and have them start each other. This keeps each program small and oriented to just one task.
The problem with PCS switches is that they are substantially more expensive then non-preset dim capable X10 wall switches. There is a method to use a non-PCS switch such that you get something that approximates preset dim. The trick to this is never turn the light on or off control it only using dim and brighten commands. If the light is full dim it appears off, when full bright it appears on. BUT, the good part is that you can go from, what appears to be off, to any dim level without having the light go first full bright.
The sample program contains a light we control in that manner. Here is what we did:
| The Kids room light has X10 address C16. The X10 module was wired in when we installed this light in the ceiling. There is no switch in the home that directly controls this light. | |
| In this bedroom there is what appears to be a wall switch for this light. Actually it is a wired in X10 control panel with two buttons. The first button is set for C8 and the second for C9. | |
| There are two programs, Kids room light control and Kids room soft light. The first is started by a C8 on or off, and the second by a C9 on or off. | |
| To turn the light on, the first button (C8) is pressed ON. Likewise to turn it off, the same button is pressed OFF. | |
| To turn the light on or off slowly the second button is used. Like the main bedroom light it takes 30 minutes to complete its task. |
This is an important example of a powerful method you can use with HCA. Rather then directly controlling a light or appliance from a control panel, have a program start when the control panel button is pressed and have that program control the devices. This allows you to do much more than just turn something on or off.
The Kids room light control program is simple. Depending upon if it's started by an ON or OFF, it either sets the light to full bright or full dim. The Kids room soft light program is very similar to the Bedroom soft light program we explored above. It slowly brightens or dims the light in small steps over 30 minutes.
The motion detector program set
The next set of programs to explore works in conjunction with the two PR511 motion detectors in the sample home. First, a bit about how these work. Each PR511 has a motion detector and a photocell. There is a switch to select when the lights come on when the motion detector is tripped or when its dark. The PR511 is assigned an X10 house and unit code and can be controlled remotely on or off (they dont dim).The PR511 can also send X10 signals when the motion detector trips or the photocell detects a change from light to dark or dark to light. Which unitcodes are sent X10 signals depends on switch settings in the PR511. Suppose the PR511 is set for housecode M and unitcode 1. When the motion detector trips it can send an ON command to M2, M3, M4, and M5. Four switches enable or disable sending to each unitcode. Likewise, when the photocell detects a lighting change, it can send an ON command (transition from light to dark) or an OFF command (dark to light) to M6, M7, M8, and M9. There are also four switches to enable or disable these unitcodes.
In the sample home there are two PR511s. Here is their setup:
| HCUC | Connected to in the HCA design |
| M1 | Device "Outside light Garden" |
| M2 | Program "Motion Garden" |
| M6 | Device "Outside light right" |
| M7 | Program "Motion Right" |
| M11 | Program "Light vs Dark" |
The PR511 on the right side of the house is set to M6. The first unitcode switch for the motion detector is enabled (M7) and the first unitcode switch for the photocell is enabled (M11).
Lets look at the two programs that are started when motion is detected. Both are almost the same. The Motion garden program consists of two steps:
The Motion right program does the same thing except the message it displays is different.
The Motion program they both start does the following:
The last point is always important to remember. In HCA everything is happening at the same time based upon the clock. In between starting a delay in a program and completing the delay, other programs or the current schedule may have altered the state of your home.
The test we do in step 5, "Are the outside lights on?", is a bit odd. Of course they are on we turned them on in step 3! But we did so using the All Lights On command and not by using the Outside Lights group. So the group is not in the ON state (at least that is how HCA sees it). The schedule turns on the outside lights using the group, so we can tell if the schedule has turned them on. If the group is on, the lights need to stay on. If the group is not on, they need to be turned off.
The final program, in this set is the Light vs Dark program. This program is very simple and does the following:
| If the program is started by an ON, the flag Its Dark is set to Yes. | |
| If the program is started by an OFF, the flag Its Dark is set to No. |
Why? The Its Dark flag can be tested in other programs to see if lights need to be turned on. Normally this test is done based upon time. After Sunset its probably dark but it may be a cloudy day and dark at noon. The PR511 photocell lets us create programs that can better respond to current conditions. Well see the use of the Its Dark flag in the next set of programs.
The hot tub program set
This set of programs is the most complex in the sample home. Like with the Wake Up program its important to see what our goals are:| The hot tub filter needs to run at least six hours a day. | |
| We want to press one button to get the hot tub ready to use, the heater and filter on and the room lights on if dark. | |
| The hot tub takes about 30 minutes to warm up. We want to be told it's ready 30 minutes after the hot tub heater is started. | |
| We want to be told when we have been in for 30 minutes, the maximum time we should be in. We want to be told after 20 minutes so we can get ready to get out. | |
| We want to press one button when we are done. It should turn off the heater and filter and the room lights too. | |
| We dont want to get in the hot tub and have the filter cut off because it was scheduled to go off. As long as we are in the tub, the filter must stay on. | |
| When we are shutting the tub down and were in the tub during the time the filter is normally on, we dont want the filter to go off before its had its six hour run for the day. |
Thats a lot of goals, but HCA can accomplish them all.
Program Hot tub maintenanceThis program is started by an ON or OFF command. We have scheduled it to start at 2pm by an ON command and again at 8pm by an OFF command. This schedule entry is in both the At Home and Away schedules. Here is what the program does:
| If started by an ON, it turns on the filter and sets the flag "Hot tub filter on for maintenance" to Yes. | |
| If started by an OFF, it first tests the flag "Hot tub in use". If that flag is No, the hot tub filter is turned off. Regardless of this test, the flag "Hot tub filter on for maintenance" is set to No. |
It also does some stuff with its icon so that during the time the hot tub filter is on, the program shows its icon in the ON representation.
The purpose of the two flags is important. Here is what they mean:
| Flag | Yes | No |
| Hot tub filter on for maintenance | The filter is on for its daily maintenance cycle | The filter need not be on for its daily cycle |
| Hot tub in use | The hot tub is being used | The hot tub is not being used |
Program Hot tub use
This program is also started by an ON or OFF command. Starting by an ON gets the tub ready to use. Starting by an OFF finishes up our use.Here is what the program does when started by an ON command:
Here is what happens when the program starts by an OFF command:
The program also manages its own icon so that the ON representation is shown on the HCA display when the hot tub is in use, and the OFF representation otherwise.
The crucial point in this program is the use of the ON element to start the Hot tub watchdog program. When HCA is running a program you cant start it again. If you try from the HCA user interface, the Start selection on the context menu is replaced by Stop. If a program is running and a schedule would have it start, that schedule entry has no effect. This prevents multiple copies of the same program from running concurrently.
Why is this important to this set of programs? While we have not looked into the Hot tub watchdog program in detail, its function is to let us know when its time to get out of the tub. The important point is that it runs for a while. We can get out of the tub anytime. When we get out, we want to be able to start the Hot tub use program with an OFF command. The hot tub use program cant still be running or we could not start it. The Start Program element starts another program and waits until it's finished before continuing on. Starting a program using an ON element causes that program to run concurrently with the program that started it.
By using the ON element, we get the watchdog program running and then exit the hot tub use program. Since the program is now not running, HCA can start it as soon as we press the OFF button when we leave the hot tub. This happens regardless of whether the hot tub watchdog program is still running.
Finally, lets look at the hot tub watchdog program. Here is what it does:
These three programs working together, complex though they are, establish the goals that we set for automating our hot tub use.
Program All Lights
There is one final program to look at, and it's very simple. This program is designed to be started from a one button control panel mounted near our bed. With one press it turns on most interior lights and all outside lights. It does this using the All Lights On command for the B, C, D, and M housecodes.Its important when figuring out X10 settings for each device in your home that you carefully consider this sort of program. Since you may want to not only turn lights on but also off using the X10 All commands you must remember that most modules dont respond to the All lights off command. You need to use the All units off command instead. If you have housecodes that contains both lights and appliances, use of the All units off command may turn off some appliances when you really only wanted lights to go off.
Because of this, the All Lights program in the sample home doesnt get all the house lights on, just most of them.
Schedules There is very little to say about the schedules in the sample home. You may want to note:| Use of the "These days" date type in controlling the sprinkler system. | |
| Use of the "This day of the month" in controlling the battery charger. | |
| Scheduling programs and groups as well as devices. |
As you would expect, the Away schedule contains many more entries as it controls inside lights as well as outside lights.
Thats the sample. While a bit contrived in points, it does show off most of the facilities in HCA devices, programs, groups, and schedules. The sample also contains a custom icon we added using the icon gallery, and even some sample date book entries we added for your amusement.
We hope it can serve as a starting point for your home design.