Thursday, February 28, 2008

Another xPLHALi Feature

I have just added support for Google Calendar events. Now you can ask HAL "What do I have scheduled for today?" and it will read your schedule for the day. With the scripting engine, you can set up VR phrases to ask it "What do I have scheduled for tomorrow?" or "What do I have scheduled for Saturday?" Again, the scripting engine makes it so easy to do things that were formerly complex or impossible to do in HAL. Scripting engine code below:

function gCal0(eventDate)
' the url below is the google 'magic cookie'
gCal0=misc.gCalEvents( _
"", _
end function

sub SpeechNotify(e)
select case UCase(e.sSpeech)
xPLHALi.TTS.Speak "your calendar has the following items., " _
& gCal0(Date)
xPLHALi.TTS.Speak "your calendar has the following items., " _
& gCal0(DateAdd("d",1,Date))
end select
end sub

I'm not ready to release it. I have a few more things to try out before I do.

Tuesday, February 26, 2008

Added Serial Ports to xPLHALi

Now serving up version 0.3.5. I have added a popular feature - COM port support. You can now connect to serial devices not supported by HAL. All this can be done in the scripting engine. Sample code is included in script.vbs in the zip file to connect to a Cheapertronics RFID reader and track cars, people, etc. There is also sample code to connect to the W800 RF receiver. The app supports up to 2 serial connections. I will change the name of the app at some point since this is much more than just xPL now.

Monday, February 25, 2008

Quick Update to xPL HALi

I've added a couple new features, updated the example vbs script and updated the app to 0.3.1. Download link stays the same as in the previous post as I'm too lazy to update it.

I added a couple features for scripting: upon startup, the subroutine "Init" from your script file will execute. On shutdown of the app, the sub "Cleanup" will run. If you do a script reload, "Cleanup" will run followed by "Init".

The script.vbs file now has examples of Init and Cleanup. It shows how you can create a VR phrase in your script and has sample code showing how to handle the response to those phrases.

Another cool feature of the scripting engine is the ability to integrate all sorts of ActiveX objects. In the script.vbs sample, I've included commented out code to update an Excel spreadsheet every time a flag changes.

Sunday, February 24, 2008

xPL HALi 0.3 Released

I have released the latest version of xPL HALi. It features full scripting support for VBScript, JScript, Python and Perl. I have moved 99% of my logic out of HAL (which wasn't a lot to begin with) into the scripting engine. Code executes faster, is easier to edit and is a lot more flexible. There are previous posts in my blog with more information on the app (xPL and VR features).

In the zip file you'll find a directory called 'samples' that contains sample scripts in all 4 languages. In the main directory is 'script.vbs' that is a more thorough example and shows all the events of HALi that I have chosen to expose to the scripting engine. Note also, the call to print a message to the lower debug screen, which may be helpful debugging scripts. Since I use very few aspects of HAL, a majority of the events are not tested so good luck with those.

The lower debug screen will also print out standard error messages related to scripting either at load or runtime. If you have a script problem, you can edit it and click the reload button to re-initialize the scripting engine. No need to restart the app.

To run this app, you'll need .NET 2 and .NET 3.5 and obviously a version of HAL that supports HALi.

updated link to point to 0.3.5 version

Friday, February 22, 2008

HAL's New Scripting Engine - xPL HALi

I just finished adding a scripting engine into xPL HALi. Now, there's no reason at all to create any IF/THEN logic inside HAL. No more painful point and click to create logic. Now, it's possible and easy to create very complex logic. The engine currently uses only VBScript but it seems pretty easy to make it support JScript, Python and Perl. I uploaded a short video of it in action.

Wednesday, February 20, 2008

Windsurfer WiFi Antenna Booster

I just made one of these in about 10 minutes with a piece of aluminum foil, some glue and a printout of the template. I did a quick test and the signal strength went from about 80% to 100%. Not bad. Here are some YouTube videos about the antenna.

This is a picture of it on one of our wireless routers:

xPL HALi 0.2 Released

Testing went faster than I thought so I'm releasing version 0.2 of xPL HALi. Read the sample config.txt file in the zip for instructions on how to add commands. Have at it.

Tuesday, February 19, 2008

New Version of xPL HALi Coming

I've been working on changes to xPL HALi to make it more than just an xPL-HALi bridge. It will now read in a configuration file that specifies VR phrases and associates a number of xPL commands with that phrase. This will give you have the ability to directly issue xPL commands from VR.

A sample line in the config file will be a comma separated list:

turn off bass amp,i have turned off the bass amp,xpl-cmnd,,x10.basic,device=BassAmp,command=off

In response to the phrase "turn off bass amp", xPL HALi will issue an xpl-cmnd of schema x10.basic to app tellin it turn off the BassAmp. HAL will confirm the phrase by saying "i have turned off the bass amp" via TTS.

Look for it to drop in the next few days after I've had some time to test it.

Monday, February 18, 2008

Cheap 350VA UPS at Staples $19.99 AR

Cheap APC UPS $19.99 AR with free shipping too. Use the Staples Easy Rebate to file it online so there's nothing to mail or photocopy. This is perfect for security cameras, etc.

Saturday, February 16, 2008

Video of xPL Gmail in Action

Here's a video of the xPL Gmail script I hacked together the other day. On the right of the screen is an RDP session to the HA server showing xPL Gmail running in a command prompt and the DCM message viewer below that. To the left is our HA GUI. I just added the capability of displaying osd.basic messages to our GUI.

A test email is sent to the monitored Gmail account. xPL Gmail polls for new mail periodically and when it finds a new message, it issues an osd.basic xPL message which is captured by the DCM logger. xAP Floorplan grabs OSD messages and dumps them into the HA MySQL database which our GUI pulls data from. The message gets displayed in the GUI for a short time before disappearing.

Friday, February 15, 2008

xPL Gmail Notifier

I've taken the Python source for Gmail Notifier and modified it (with code from the Python xPL Toolkit) to issue an xPL osd.basic message when it encounters a new email message. Since it's Python, you can easily modify to change the xPL message to whatever you want. I'll leave that as an exercise to you. A few things, before you grab the zip file (comments I left in the code):

# * changes to remove the tray icon as pytrayicon is not
# supported in windows
# * removed the popup that notifies of a new email
# * added xPL support to generate osd.basic messages
# containing sender of new email
# * since there's no tray icon, you cannot reconfigure from the gui
# after you've configured once before. therefore if you need to
# change your settings again, edit .notifier.conf located in
# c:\documents and settings\your_login

You'll need to install a few things first besides Python - PyGTK and GTK. Go here and follow the directions for PyGTK for Microsoft Windows. Finally, here's my zip file.

Wednesday, February 13, 2008

AT&T DSL Pricing Going Up

We have Comcast at our main house and AT&T DSL at our other. The price of DSL is going up $5 per month starting this month! That's a 25% increase over what we're paying for 1.5Mbps service. The service is pretty bad as it is but we don't use it that much. No wonder the US has the worst/priciest Internet experience - pretty sad considering we invented the Internet. That's what happens when there's no competition and you allow all the regional bells to merge together. Funny that AT&T announced "free" hotspot access for many of their broadband customers a few weeks before they announced their raising broadband prices. Free my ass.

If you are staying with AT&T, like we are, because there's no cheaper alternative, then hit this link to lock in your current rate for 1 year before you start financing their "free" wifi hotspots.

More Details on xPL HALi App

You can edit the enclosed XML file (xpl_doghouse-hali.instance0.3.0) to change the name of your xPL HALi instance. In the file, the key newconf is set to "home", but you can change that to anything you want.

To install more than one xPL app on your PC, you'll need an xPL hub. Here's one.

A good thing to have around is the xPL command line sender or the GUI xPL sender.

Another helpful app is DCM. The message logger is a great utility for debugging.

So what can you do with all this? Let's just start with something simple. Send an xPL message to xPL HALi to change a flag using the command line sender. From the command shell type (all on one line with a space after 'home' and before 'control'):

xplsend xpl-cmnd doghouse-hali.home control.basic device=testflag\ntype=flag\ncurrent=1

This issues an xPL command to application doghouse-hali.home (where home is the default name in the XML file mentioned above). The command is a control.basic type that sets the flag named 'testflag' to 1 or TRUE. You can try out the other commands that xPL HALi supports by following the command guide in the previous post. Have fun.

Monday, February 11, 2008

xPL HALi App Available for Download

So I've decided to release my xPL HALi application that I mentioned here. You can get it here. I only implemented portions of HAL I use (no X10, no DMC, no alarm panels, etc.) Just the basics. Don't know what xPL is? Read this and visit the xPL Forums. You'll need to install .NET 2 and .NET 3.5

It issues xpl-trig sensor.basic commands in response to the following events:

  • Listening state changed
    This message is sent when HAL is listening via microphone. Type will change if VR is via handset.

  • Macro Executed
    Execute 'macroname' macro.

  • New Voice Mail

  • Phone Hook Changed
    Outgoing call started.

  • Phone Ringing
    Incoming call.

  • Sensor State Changed
    Flag 'sensorname' set to 1. Type can be flag, counter, variable or timer.

  • Speech Notify
      current="phrase recognized"
    Recognize the listed phrase via VR.

    The app responds to control.basic xpl-cmnd messages allowing some control of HAL devices:

  • Setting a Flag
    Set a flag to 1.

  • Setting a Variable
    Set a variable to 1

  • Setting a Timer
    Set timer to 60 seconds.

  • Increment a Counter

  • Decrement a Counter

  • Set a Counter

  • VOIP VR Video

    Here's another video I made. It shows how we use TeamSpeak voice chat software from remote PCs to talk to HAL.

    The video shows an RDP session to the HA server on the left of the screen and on the right is the TS client running on a laptop. In the RDP client, you'll see the HAL monitor, the xPL HALi app I wrote, starCOMUltra and our web based GUI. HAL, named Sara since the wife likes the show Eureka, responds to her name spoken into the laptop microphone. The TS client blinks as it hears me. The HAL monitor shows the name was recognized and enters listening mode. xPL HALi sends an xPL control.basic message with the listening status. xAP Floorplan (via its xPL bridge) sees the message and sends message.display to all OSD devices (in this case xAP Intranet Launcher) informing them that the system is listening. This is necessary since HAL's audio is not routed back through TS to the laptop and we may not be within earshot of HAL. A couple commands are spoken to turn on & off the kitchen light. You can hear the click of the switch as it toggles, see the commands being issued by starCOMUltra and see the kitchen light go on & off in the GUI.

    Sunday, February 10, 2008

    Home Automation GUI Video

    Here's a video of the HA interface I've been building. It's a few months old now and has been posted on a few HA forums here & there. Since Comcast bumped web page capacity, I decided to leave the video up and link to it from here

    This pretty much represents all systems interacting together - starCOMUltra, xPL, xAP, HAL - and tied together with AJAX, MySQL, PHP and DHTML running on Apache.

    Friday, February 1, 2008

    Farewell kJ :(

    Our beloved kJ passed away yesterday at the age of 13 years, 8 months. kJ has been with me since my interest in home automation began. He witnessed the mad wiring, connecting, soldering and programming, and was also the reason for a few automation tasks (ie: the computer yelling at him in his doghouse when he howled at night). He was always there to tilt his head when asked if he thought this was a safe spot to drill in the wall. When he didn't like something I did, like leave the landscape lighting wires exposed, he would promptly chew them up and make me do it better. Of course, his expert assistance was the reason behind how kJ's Doghouse came to be :) We miss you so much kJ.