Making The Most of xPLHal - Part 2
Making the most of xPLHal - Part 1
John Bent has been a member of the core xPLHal Development Team for over 2 years, and has played a major role in the creation of features such as the Determinator engine, and the xPLHal Manager application.
In the second article about xPLHal users, John takes us through some of the technologies that he has integrated into xPLHal throughout his home.
I moved into my current house about 18 months ago, and have taken the opportunity to install a good deal of automation, along with the infrastructure to expand the system in the future. Whilst I did have some automation in the old house, it was nice to start with a clean sheet, particularly as I now had the benefit of several years worth of knowledge from my fellow UKHA members.
Comfort Security System
My house is equipped with a Comfort Pro security system, and is interfaced to xPL using the Ethernet UCM, and the xPL Comfort service.
Comfort handles all the tasks traditionally associated with a security alarm system, but has the added advantage that it can be controlled and monitored using xPL. This means that xPLHal can monitor every device that is connected to Comfort, including movement sensors, door/window contacts, panic buttons, smoke detectors and so on. It also means that xPLHal can control the house based on the state of the security alarm.
If the security alarm is activated whilst we are away from the house, xPLHal sends me an email at work, and I am able to log in via the xPL web interface to see exactly what series of events have lead to the alarm activation.
Smart Lighting
All the lights in my house are controlled using Clipsal's C-Bus. This is a hard-wired lighting control system which offers amazing flexibility, 100% reliability and complete responsiveness - all things which I felt were missing in my previous X10 installation.
C-Bus interfaces with xPL using C-Gate and the xPL C-Gate connector. xPLHal knows which lights are on, and the exact brightness level that they are currently set to.
When I leave the house and arm my Comfort security system, xPLHal automatically switches off all the lights, and simulates a lived-in look while we are away.
When Comfort is armed to night mode, all lights apart from those in the bedrooms are automatically switched off.
When I come home at night, the porch and hall lights are automatically switched on by xPLHal when I enter the house.
If the alarm is activated while we're asleep, all the lights inside and outside the house are switched on.
We have various outdoor lighting controlled by PIR movement detectors during the hours of darkness - any activation of the outdoor PIRs during the night will cause xPLHal to alert us by broadcasting a text-to-speech announcement.
We get a lot of wildlife visiting the garden during the night, which can cause a lot of false triggering of the PIRs. To reduce this problem, I have several PIRs monitoring the whole of the outside of the house, and use some logic within xPLHal to try and determine whether it's a false alarm, or whether it's a real person.
We also have automated lighting in a number of rooms within the house. Using xPLHal scripting allows me to set up some pretty complex logic to control the automated lighting, which really makes a big difference to how useful it can be. For example, if someone switched the lights on using the light switch, the automated lighting system won't try and switch them off after a period of inactivity.
The other great thing about C-Bus is that you know exactly which light switch was responsible for switching on a light, so you can perform basic occupancy detection by tracking which light switches have been operated. As well as controlling lighting, C-Bus also controls my extractor and sweap fans, and I have some logic within xPLHal to control their timings.
Detection of the ambient outdoor light level is achieved using a C-Bus outdoor PIR. This unit sends a C-Bus message at dusk, and another at dawn, which signals xPLHal to update it's Period flag accordingly.
As a backup to the light sensor, I use the xPL DawnDusk service, which calculates sunset and sunrise times for my location, based on the latitude and longitude of my house. The disadvantage of this is that it does not take into account the local weather conditions, so the light sensor usually provides a more accurate indication of dawn/dusk.
At dusk, all downstairs curtains are automatically closed by xPLHal, and 15 minutes after dusk, all upstairs curtains are also closed. The AutoGlide electric curtain rails are controlled using outputs on the Comfort panel, so operating the curtains is simply a case of sending a control message to Comfort to pulse the appropriate output.
In addition to closing the curtains, the outdoor low-energy driveway lighting is switched on, and remains on until 10:30PM, when it is switched off by xPLHal.
The automatic lighting within the house becomes active, and any movement in the driveway or garden will result in all outside lights being switched on for several minutes. If xPLHal detects that the TV is being operated (by detecting infra-red codes from the TV or Sky+ remote controls), the lighting in the lounge will automatically be configured to a "watching TV" scene.
When the alarm is set to night mode, automatic lighting operates at a much reduced level - this has the advantage of providing low levels of illumination for anyone who gets up in the middle of the night.
At dawn, all curtains (apart from the ones in the bedrooms) are automatically opened. We open the bedroom curtains manually, either by using the manual push buttons by the side of the windows, by pressing a button on the C-Bus bedroom light switches, or by using some unused buttons on the TV remote control. xPLHal detects the key presses and sends out the appropriate commands to Comfort to operate the curtains.
If we are on holiday and the house is unoccupied, the bedroom curtains will be opened between 8:00 and 9:00.
On dark mornings, the bedroom lights are configured to come on gradually about half an hour before my alarm goes off - this is a great help during the Winter, and is very easy to achieve using a simple xPLHal determinator and the C-Bus ramp command, as C-Bus is able to ramp lights to a specific level over very long periods of time.
My alarm clock is actually a SliMP3 controlled by xPLRioNet. This plays a series of TTS announcements and can either play a pre-defined playlist, an Internet radio stream, or any local DAB radio station (by using a Psion Wavefinder).
DMX512 Lighting
I have a couple of LED colour-changers - these are light fittings that can output any colour of the rainbow (65,535 different colours in total!) - very effective for mood lighting.
Like a lot of professional lighting equipment, these units are controlled using DMX512. I use the Milfords DMX512 transmitter, along with it's xPL connector, to have complete control over the DMX equipment using xPLHal.
This means I can control the DMX lighting using normal C-Bus light switches - and the end user isn't even aware that xPLHal is actually translating the C-Bus button presses into DMX512 commands.
Temperature Monitoring
I currently have 3 1-wire temperature sensors monitoring temperatures within the house, and a further one to measure outside temperature.
These are integrated into xPLHal using Steve Cooper's 1-wire xPL Interface. The temperature values are logged to a database, and are available for monitoring via the web.
I don't currently use the temperature values to control anything, though I do intend to install some underfloor heating in the bathroom which will probably be linked to a C-Bus relay, so I may end up using the 1-wire temperature values to control it.
I use the xPL plug-in for Motherboard Monitor (MBM) to monitor the health of my servers. Any abnormalities (such as high temperature, fan failure etc.) will result in warning announcements being broadcast throughout the house using text-to-speech.
Caller ID
I use a Meteor to provide caller ID information to xPLHal using the xPL Meteor connector. When a call comes in, the details are stored in global variables within xPLHal, and an entry is written to the incoming calls database.
xPLHal does a lookup against my contacts database and will announce the caller's name (if known).
If the number is not in my contacts database, xPLHal attempts to determine the geographical area of the country where the call originated by looking up the area code against a database of all regional codes.
xPLHal also logs all outgoing calls to a database by detecting the DTMF digits received from the Meteor.
Infra-Red Control
I use Frank's FirM Jr in combination with a USB UIRT (and the USB UIRT xPL connector) to integrate infra-red transmission and reception into xPLHal.
This means that xPLHal is aware of every single infra-red signal that is sent, and can control any infra-red device in the house that is linked to FirM.
Control via the Web
Most aspects of my xPL installation can be controlled and monitored via the web, using a set of ASP.NET pages that I wrote myself.
There is a DLL available with xPLHal Web Access that lets you easily build your own dynamic web pages that can display information from your xPLHal server and easily send out xPL messages to control devices. Even if you've never written an ASP or ASP.NET web page before, you should find it pretty straight-forward to put a page together that displays dynamic information from xPLHal, and there are some code samples included with xPLHal Web Access to help you out.
When I'm working from home, my xPL installation is linked to our corporate HelpDesk so that I can be alerted using text-to-speech announcements if a new call comes in that requires my attention - great for when I'm not at my desk! I can even customise the response based on certain parameters within the call, e.g. the priority of the call, the person who logged the call and so on. For example, high priority calls could cause all lights in the house to flash - and this can all be done simply by editing a determinator within xPLHal Manager.
The Future
One of the most exciting things about being involved in home automation at the present time is that the market is moving very quickly, and new technologies are appearing all the time - especially as the idea of having a "smart home" continues to grow in popularity within the UK. The extensibility of the xPL protocol means that it should be a simple and straight-forward task to integrate any new technologies into my home when they come along.
