Saturday 8 December 2007, 11:02 PM
Cosmic - The RF to PC Gateway
In essence I have a PalmPad Hand Held Remote Control which sends RF signals to the X10 RF Receiver, which in turn places signals on the powerline. These signals are then picked up by the computer, and translated into instructions by the custom software, "Cosmic"
Now, because these X10 signals will also control any lights on these addresses I have split control into two. The first set of controls (1-8, on/off) control the lights, kettle, and standard appliances as normal. The second set uses address not found by any devices in my house, and are used solely by "Cosmic". There is a switch on the remote itself which I am re-appropriate for this task.

The pad is split into three main areas:
1. Common handling. Volume change, mute and pause are used so commonly, they deserve to be present in all modes.
2. Mode-specfific. The central 8 buttons.
3. Common system. These change the mode, and report on the general status of Cosmic, and the house in general.
The modes I have are:
Multimedia - CD playing, MP3 jukebox control
Timer - Start a timer for 5 minutes, and the voice will remind you at the appropriate time. Very useful since it can be used from the kitchen, with the audio pumped downstairs through the house wiring looms.
News - Basic status information, such as weather, news, and calendar events.
The functionality is then handled by a number of small scripts on the machine itself, executed whenever the appropriate X10 signal is heard on the powerline. The current version is temporarily held as Cosmic handler script but a formal release will be available later. The configuration, fwiw, is done simply by adding lines to /etc/heyu/x10.conf
SCRIPT e1 on :: /usr/local/minerva/bin/mixer dec master 10
SCRIPT e1 off :: /usr/local/minerva/bin/mixer inc master 10
SCRIPT e2 on :: /usr/local/minerva/bin/mixer toggle
SCRIPT e2 off :: /usr/local/minerva/bin/pmedia
SCRIPT e7 on :: /usr/local/minerva/bin/cosmic modestatus
SCRIPT e7 off :: /usr/local/minerva/bin/cosmic nextmode
SCRIPT e8 on :: /usr/local/minerva/bin/status
SCRIPT e8 off :: /usr/local/minerva/bin/cosmic root
# real cosmic handlers
SCRIPT e3 off :: /usr/local/minerva/bin/cosmic e3off
SCRIPT e3 on :: /usr/local/minerva/bin/cosmic e3on
SCRIPT e4 off :: /usr/local/minerva/bin/cosmic e4off
SCRIPT e4 on :: /usr/local/minerva/bin/cosmic e4on
SCRIPT e5 off :: /usr/local/minerva/bin/cosmic e5off
SCRIPT e5 on :: /usr/local/minerva/bin/cosmic e5on
SCRIPT e6 off :: /usr/local/minerva/bin/cosmic e6off
SCRIPT e6 on :: /usr/local/minerva/bin/cosmic e6on
Friday 7 December 2007, 1:04 PM
A few more pictures
The weather is downloaded, parsed, and presented here. It is also spoken by the in-house voice synthesizer when it wakes you up in the morning
By clicking on the light bulb, or the switch, the appropriate light in the house turns on and off. Also note the 'Make A Cuppa' button:)
The simple news page. It grabs RSS feeds, and summarizes them on a separate set of pages. The next step is to incorporate this information into the spoken status reports, so you can listen to the news while getting up in the morning
If I haven't mentioned it before, I use Festival for the speech synth, and am moving as much reporting as possible to it, so I can operate the house without needing a monitor. I think this is good from a generalized standpoint as it becomes more natural, and helps less able users understand the system. e.g. guests, who are generally confused by HA.
Tuesday 4 December 2007, 9:39 AM
Five Subtleties
When the lights switch of at night, they fade out over the course of 20 minutes or so to aid more natural sleep. The code is simply,
#!/bin/bash
for i in `seq 1 22`;
do
/usr/local/bin/heyu dim studio 2
sleep 30
done
The sequenced lights come on and slightly randomized times each day, so it's not obvious that it's machine controlled. Because this stems from crontab, and not the X10 module, I have control over this.
The timings on the lights as you go up stairs looks real. That is, the '2upstairs' script puts the landing light on, waits for a minute, then turns the downstairs light off, then shortly afterwards, turns the upstairs bedroom light on. This gives a more natural, lived-in, approach.
The voice may be artificial, but the content is real. I've written a small script that speaks the time in a more humanistic manner. Consequently, 18:39 is read as 21 minutes to 7 PM. It's less than 70 lines of script, but it does make a difference. (See my humanistic time script!)
As I hope you'll see on the forthcoming video, the volume of the music drops when any voice announcement is played. This only works because the voice and music are on different mixer channels.
There are others, but this is enough to whet your proverbial appetite for now... :)


