Showing posts with label HAL. Show all posts
Showing posts with label HAL. Show all posts

Sunday, April 26, 2009

Not Much Going On

I haven't been doing a whole lot lately. Part of that is a little HA burnout from my manic March. Part of that is a little disappointment over SageTV and the smushed screen. That's been finally resolved after beta updates of the server and the HD Theater firmware.

I did make the decision to turn off HAL Deluxe. It's always been a resource pig occasionally prone to 100% CPU attacks. The lack of voice mail functionality due to it crapping itself after a Windows update didn't help. And my failed experiment with microphone VR put another nail in the coffin.

Of course, turning off HAL comes with great benefits - lots of free memory and more stability. My two HALi apps also get turned off as well. The extra resources is letting me play with SageTV on my HA server. I moved the 1.5TB disk from the DVR machine to the HA server, migrated my SageTV settings over and have been running for a couple days. It's not a CPU pig but it is as fat as HAL. I've seen it well over 200MB and that has me thinking of bumping the HA server memory from 2GB to 4GB. The DVR machine will probably move over to our other house as the machines there are a little slow.

Finally, I snagged an HP T5700 (256MB RAM & flash) thin client off eBay 60 bucks (less 14% Live cashback and 1% FatCash). I'm going to see if I can use these as little xPL boxes. I want to distribute them around the house where I don't have enough wiring to support all the inputs I want to add to the system. For example, I want to move 3 current switches from DS10a's to a gameport (and add a few more contact closures). I don't have enough wiring there to get those outputs to the wiring closet nor is there enough wiring to put a gameport there using Cat-5 USB extenders. I thought about USB over IP devices but they cost twice as much as a thin client and obviously have much less functionality.

Monday, March 2, 2009

HAL Thinks the Piano is a Person

I was messing around with HAL microphone VR last week and ran a mic from the HA server to the living room. It worked decently when I was the only one home. However, when my kids started practicing piano, HAL went crazy. Every 10 seconds, it would think its attention word was called - despite attempts to adjust the selectivity higher. Not only that, but once the piano had HAL's attention, it was able to tell it to "set the mode to normal" and "turn on nook light" and "good bye." Needless to say, the microphone has been disconnected.

Monday, January 26, 2009

HAL is a Piece of Crap

I just did a long needed Windows update of my HA server and the only app on my machine that craps out? HAL Deluxe. After someone calls and leaves a message, the HAL System Server fatals. I restored my old db files. I re-installed HAL. I did a clean re-install of HAL. No luck. I had a similar problem with 2.066 (I'm using 3.7.3 now). I'm just about ready to go back to an answering machine...again.

Thursday, January 8, 2009

Finished up HAL Client-Server App

It's been a while since I wrote my app to link multiple HAL installations. I finally finished it up last night. I've linked the MacroPhrases from the master to the client so all voice commands are accessible from the client. It only does this at startup, so it will not update if the server phrases get updated.

Tuesday, June 17, 2008

Client-Server with HAL

With my xPL issues out of the way, I was able to get to testing my new app. I'm not quite sure what to call it. It started out as a way to make HAL talk via SAPI instead of HAL Voices or its default voices, as I have a 2nd copy of HAL Deluxe. However, I'm not really interested in forking out $30 again for HAL Voices, which are just repackaged AT&T Natural Voices and I already own that.

I finished up a first pass last night & learned more about GUI stuff using VB 2008 Express Edition. Here's a look at the app:



One copy of the app runs on the server, where the HAL master resides. Other copies can run on other machines, or clients. You configure it with the GUI. The client interfaces with the VR on the local machine and sends the recognized phrase, over xPL, to the server copy of this application. The server copy then pushes that into the master HAL copy, which performs whatever action is requested, and sends a TTS response back out over xPL to the client. The client will then play the TTS response using either SAPI or a HAL voice, depending on what's configured.

Here's a short video of it in action. The client is on the left, the master is on the right in an RDP session. The next thing to do will be to figure out how to push the VR phrases from the master HAL to the client so it's aware of all the added phrases in the master.

Thursday, June 12, 2008

Dusting off xPLHALi

It's been a while since I worked on xPLHALi. I made just a small change to it, making the xPL portion of the script engine more generic - meaning it can see all xPL messages (other than config and heartbeats) - so there's no need for an external scripting engine. It's more a feature for other users since I already have my xPL/xAP scripting engine. I plan on adding an option to disable this feature if desired. I may add support for xAP messages to the scripting engine and am thinking about a bridge to connect 2 instances of HAL over xPL.

I've finished up the config stuff for xPLAudreyTTS. I have a dropdown box to choose the default voice. I just need to create instructions and zip everything together. The rest of the config will be from a text file. It's a simple interface:



Saturday, March 8, 2008

xPLHALi 0.4 Released

I guess I've done enough testing with the new gCal and SlimServer support. Grab it.

Thursday, March 6, 2008

xPLHALi Now Controls SlimServer

Now you can use HAL to play music through SlimServer. I'm still testing it out, but it's working pretty well. It extracts all this info out of the SlimServer database and creates the voice commands that allow you to queue up music by artist, album or playlist. Click the screen cap below for a video of it in action.



Even cooler is it can be extended to support other media servers through the scripting engine. There's an option to just pass to the scripting engine the zone, category (album, artist, or playlist) and selection that were chosen. This way the scripting engine can issue a command to launch another player. Granted you'll need to have SlimServer installed but not use it for other than its database.

This works for us since we use SlimServer for our SliMP3s and Squeezeboxes and MediaNet for our Rio Receivers. So for MediaNet zones, xPLHALi will pass parameters that the scripting engine can use to issue xPL commands queueing up the desired music to those non-Slim zones.

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( _
"http://www.google.com/calendar/feeds/userID/private-magicCookie/full", _
eventDate)
end function

sub SpeechNotify(e)
select case UCase(e.sSpeech)
case "WHAT DO I HAVE SCHEDULED FOR TODAY"
xPLHALi.TTS.Speak "your calendar has the following items., " _
& gCal0(Date)
case "WHAT DO I HAVE SCHEDULED FOR TOMORROW"
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

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,doghouse-scu.xyz,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 doghouse-scu.xyz 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.

Wednesday, February 13, 2008

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
    sensor.basic
    {
      device=listen
      type=mic
      current=1
    }
    This message is sent when HAL is listening via microphone. Type will change if VR is via handset.

  • Macro Executed
    sensor.basic
    {
      device=macro
      current=macroname
    }
    Execute 'macroname' macro.

  • New Voice Mail
    sensor.basic
    {
      device=newvmail
      current=1
    }

  • Phone Hook Changed
    cid.meteor
    {
      CallType=outgoing
      CCS=initiated
    }
    Outgoing call started.

  • Phone Ringing
    cid.meteor
    {
      CallType=incoming
      CCS=ring
    }
    Incoming call.

  • Sensor State Changed
    sensor.basic
    {
      device=sensorname
      type=flag
      current=1
    }
    Flag 'sensorname' set to 1. Type can be flag, counter, variable or timer.

  • Speech Notify
    sensor.basic
    {
      device=VR
      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
    control.basic
    {
      device=sensorname
      type=flag
      current=1
    }
    Set a flag to 1.

  • Setting a Variable
    control.basic
    {
      device=sensorname
      type=variable
      current=1
    }
    Set a variable to 1

  • Setting a Timer
    control.basic
    {
      device=sensorname
      type=timer
      current=60
    }
    Set timer to 60 seconds.

  • Increment a Counter
    control.basic
    {
      device=sensorname
      type=counter
      current=+1
    }

  • Decrement a Counter
    control.basic
    {
      device=sensorname
      type=counter
      current=-1
    }

  • Set a Counter
    control.basic
    {
      device=sensorname
      type=counter
      current=20
    }


  • 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.


    Thursday, January 24, 2008

    More HAL Bugs

    Hard to imagine I've been playing with HALi for about a week and I keep finding problems. Why does the SensorStateChanged event fire even though the sensor was set to the same value (it hasn't actually changed)? This brings me to another problem, which uncovered this one.

    I have a simple rule NewVM that should set a flag when I have new voice mail. If a call comes in and the caller leaves a voicemail, this rule fires 3 times! Why?

    NewVM
    IF:
      NewVoice Message in All Mailboxes >= 1 (TE)
    THEN:
      SetFlag NEWVMAIL to TRUE

    On the other hand, if I have no voicemail, I want to clear that flag via this rule:

    NoVM
    IF:
      NewVoice Message in All Mailboxes = 0 (TE)
    THEN:
      SetFlag NEWVMAIL to FALSE

    What's retarded about this is if you playback all the messages and have them automatically changed from NEW to SAVED, this rule doesn't trigger despite there being no more new messages. Also, if you delete all messages from the phone pad app the rule still won't trigger. If you delete new messages one at a time from the phone pad it finally does trigger.

    I came up with these rules so HAL generates events that my xPLHALi app can translate to xPL messages, informing other devices/apps in my system. But HAL can't actually generate a reliable NEWVMAIL flag so it's pretty much useless to me.

    HAL guru posted on the HAL message board that a "new" feature in 4.0 will be ability to check if something actually changed! HALi 4.0 now won't waste extra CPU cycles generating the same events for things that haven't actually changed. Hooray. WinEVM for my TimeCommander+ added that feature in 1997.

    Monday, January 21, 2008

    My First VB.net App

    I've been testing out the VB.net app I wrote despite the problems I was finding with HALi. I ended up writing an xPL bridge to HAL and called it xPLHALi (I know, it will be confused with xPLHAL, but only if I release it). I started off using xAP but stopped because I wasn't sure how to go about implementing subUIDs for all the HAL sensors, since each would be it's own target in xAP. I figured it out later so I may finish it at some point. Anyway, here's a screen shot of the xPL logger of DCM showing the messages generated by my app. You can see status of what's going on in the application window. HAL sensor events are generated as sensor.basic messages and can be changed by sending control.basic messages to my app. Not sure I'll release it as I haven't figured out how to bundle it all up and I don't think people who use HAL know what xPL is. It is useful to me however. I am no longer limited to HAL's point and click interface to create tasks. I'll write my own VBscripts in xAP Floorplan (its built-in xPL bridge makes me not sure I'll need to create a xAP version, especially since I run a hybrid xAP/xPL system anyway).