Tuesday, February 17, 2009

Blabber - an xPL Jabber Gateway

A couple months ago, I added Jabber functionality to my xPL sCU application. I've decided to make the Jabber portion available as a standalone xPL app called Blabber. This app will let you use IM to send it messages, which you can use in your automation scripts. It also allows your automation system to send instant messages back to you.

First, you'll need to set up a Jabber account which Blabber will use. Google probably has the most reliable Jabber server and it's what I use. Add your personal IM account to the Blabber account's roster. Once that's done, you can set up your config.txt file. It's just a single line file:

<user name>,<server>,<password>

For example, assuming your Blabber account is xplblabber@gmail.com then your config.txt file would be as follows:

xplblabber,gmail.com,your_password

After you've saved config.txt in the Blabber directory, you can start it up. You'll notice a debug window that prints information messages. Now you can interface to it.

When you IM with Blabber, it will generate sensor.basic messages:
source = doghouse-blabber.xyz
dest = *
type = xpl-trig

sensor.basic
{
   device=your_email@gmail.com/gmail.some_resource_numbers
   type=message
   current=the text of the message you sent
}

Blabber will also keep track of your status:

source = doghouse-blabber.xyz
dest = *
type = xpl-trig

sensor.basic
{
   device=your_email@gmail.com/gmail.some_resource_numbers
   type=status
   current=available
}

One thing you can use IM for is if you're not home, you can create a script that will forward the contents of osd.basic messages to you over IM. Just create a control.basic packet like this:

dest = doghouse-blabber.xyz
type = xpl-cmnd

control.basic
{
   device=your_email@gmail.com/gmail.some_resource_numbers
   current=somebody rang the doorbell
}

Download Blabber. I've only tested this on XP, but it should work on Win2k.

9 comments:

  1. I tried it on WS2003, it works fine !
    Good work.

    ReplyDelete
  2. I've been able to receive status, send message from gtalk to blabber but not in the opposite way.

    ReplyDelete
  3. make sure you are using the full IM address including the resource name - you can see what that is by running an xPL logger. i will update Blabber at some point to show the fully address in its log window.

    ReplyDelete
  4. I've just reached the same conclusion a few seconds away :-)
    It works as soon as you add "/Talk. xxxx...."

    ReplyDelete
  5. I've observed that when blabber receives an incoming message from gtalk, it first sends an empty one after the full control.basic message.
    Is there any reason ?

    ReplyDelete
  6. i just did some testing with the gtalk client and didn't see an empty message being sent. i mostly use gchat within gmail & have never noticed this before. i'll leave the dcm logger open for a while to see if anything comes up.

    ReplyDelete
  7. This empty message behaviour seems to happend when using the gtalk ajax client directly in iGoogle

    ReplyDelete
  8. found it. not sure if it's an igoogle thing or w/ the .net library i used. in any case, it's fixed. you can get it from the dl link above. thanks

    ReplyDelete