An easy way to write a plugin for HouseBot (via xAP)

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
CouchPotatoe
Senior Member
Posts: 103
Joined: Sun Jul 31, 2005 2:43 pm
Location: Yorkshire UK

An easy way to write a plugin for HouseBot (via xAP)

Post by CouchPotatoe »

There are probably many people who would love to see a favourite device supported within HouseBot but don't have the experience to write a device driver in C++. Well now there's another way and you can use a wide variety of languages including old favourites like Visual Basic or even plain VB script. I've posted this in the 'General' forum rather than the plugins one as I suspect the latter is one that a lot of people feel is beyond them.

The thing that makes this possible is Edwards newly released xAP plugin for HouseBot. As well as a large library of existing xAP devices/applications it's really easy to 'roll your own' if you have even just a hobbyist level of programming skill. There is example code in many languages , Active X controls and a .Net Framework. Basically xAP devices send human readable status and control messages to each other over your network. The xAP plugin for HouseBot eavesdrops on these messages allowing it to fully monitor and control all these xAP devices. So you just need to write a small application that attaches to your device and presents suitable messages on your network, and voila you can totally integrate the device into HouseBot. It's about as simple as these things can ever get.

You can think of xAP as an Esperanto or 'pigeon English' for devices in your home to chat to each other. It's a cut down , simple , readable language that is easy to understand.

Just as a taster here is a simple xAP message from a C-Bus Lighting system - you can ignore most of this but the key lines are the source= and the state and level lines ie the Courtyard Floodlights are on at half brightness .

xap-header
{
v=13
hop=1
uid=FF.6E17:005F
class=xAPBSC.info
source=UKUSA.gateway.C-Bus:Courtyard.Floodlights
}
output.state
{
state=on
level=128/255

}

and here as a contrast is a much more involved message from Slim Devices SqueezeCentre application showing what is now playing from the playlist on the kitchen Squeezebox player. An 80's revival moment it seems.
The xAP conduit supports full multi zone player control, on screen display messaging and IR reporting, all of which could be integrated into HouseBot. You can even use a free PC application as player to try it out (SoftSqueeze).
From a HouseBot perspective the player is created as a device and each parameter in the xAP message eg 'Album' is linked to a HouseBot parameter and they are updated in realtime.

xap-header
{
v=13
hop=1
uid=FF.05E72201:0002
class=xAP-Audio.Playlist.Info
source=ersp.SlimServer.MusicPC:Kitchen
}
Now.Playing
{
Album=You And Me Both (Remastered 2008 Edition)
AlbumID=1448
Artist=Yazoo
Duration=4:32
Genre=No Genre
Index=1
Path=file:///M:/Yazoo/You And Me Both (2008)/01 - Nobody's Diary.flac
Title=Nobody's Diary
TrackID=8144
Tracks=11
}

Hope that gives you an insight as to how easy it is to create xAP messages , and the xAP plugin does all the work of integrating this with HouseBot. If you use VB6 or VBA/VBS then the xAP Active X manages all the xAP bits for you too. You just have to attach to your device, perhaps via a serial link and then choose parameters to report. Devices can be pure software too - for example there are weather forecast, TV listings, traffic report etc applications already. There's a load of people who can help you along the way too.

Cheers Kevin
Post Reply