xPL

Is there any interest in controlling Vera from xPL?

I took a little time today and started writing a perl program that polls Vera (with the the UI Simple example) and generates xPL events. The reason I’m looking into this in the first place is I’m interested in using EventGhost or Girder (see my posts under “Remote”) to interface some more complicated Android control panels with Vera, and both of those have xPL plugins.

I went with perl just because AnyEvent makes it pretty simple to do non-blocking I/O without using threads. I was trying to keep this pretty simple as I just wanted a proof of concept. To run it you would just need Perl and a few Perl Modules: AnyEvent, AnyEvent::HTTP, and JSON. It should be cross platform and probably plug computer friendly. I figure handling xPL events on a different machine is preferable to not tax Vera too much and because you will need an xPL hub running somewhere else anyway.

Right now I’ve only sending lighting.device trigger messages when something changes. The lighting scheme is surprisingly complicated, and I’ve coded up a bit more of the protocol but I’m not familiar at all with xPL and want to make sure I’m doing it right. I am not listening for events yet but there isn’t much code needed for that.

If there isn’t any interest I’m just going to clean this up enough for my own use. If there is I’m looking for someone who is willing to test out my code and tell me when I’m being dumb. If anyone has a good xPL enabled program to recommend to try controlling some devices I would also appreciate it.

If anyone is interested in xPL you can find more information here:

http://xplproject.org.uk/wiki/index.php?title=XPL_Message_Schema
http://xplproject.org.uk/wiki/index.php?title=XPL_Specification_Document

EDIT:

I now handle xPL lighting.basic messages to set the level of a light. So now I have sending and receiving of a subset of xPL messages working, all the basic functionality is there, it is just a matter of adding the ability to handle all the proper xPL schemas…

Hey radarengineer,

I’d never heard of xPL until you mentioned it, but I went and looked at its website. My interest is piqued. This could be useful to me too (though I don’t know how yet).

I’m interested in theory too, but not sure about how much I would use it in practice. Are you using xPL in your home already for controlling and monitoring other automation devices? Can you give us a brief ‘real world’ example of it’s benefits to you?

@radarengineer: could you please provide me the link of the ( UI Simple example), you’re referring? Thanks.

I’m just copying/pasting here

About XPL: To create a unified protocol to allow the control and monitoring of all devices within the home

What I’m curious about is the following:

  1. Unified protocol to combine various existing / future technologies like z-wave/insteon/zigbee/x-10/dontknowwhat etc,. or

  2. A new protocol that would work well with devices that understand xPL?

Not sure…

@mysticjay, here is the wiki page on UI Simple: http://wiki.micasaverde.com/index.php/UI_Simple

Micasaverde provides an example written in C. I basically did the same thing but in Perl. It is actually a pretty straightforward way for essentially complete control over Vera. I’m still not sure this is the best way to add xPL support, as it might be better to just write a xPL plugin that runs on Vera. I’m may look into that if I decide to use xPL long term.

@fall-line, I’ve never used xPL before, but yesterday I messed around with dimming lights with both Girder and EventGhost using their respective xPL plugins. I understand that xPL has a pretty good following.

Basically I have just been researching ways to integrate Vera with other devices and programs. Mostly out of curiosity, but I am also working on a whole house audio system and want integrated control over all my A/V equipment and Vera devices from my Android. xPL opens up to additional ways to control Vera from my Android:

Andre (on Android) -> Girder -> xPL -> Vera
Eventghost for Android -> EventGhost -> xPL -> Vera

I use HomeBuddy and appreciate rakstar’s work on it. But it isn’t sufficient to control my fairly complicated setup, mostly because I run most of my media off of a Windows 7 machine. I have it in my office and run HDMI and speaker wire through my attic to my living room. As an example I can use either program (Girder/Eventghost) to run a simple script that turned on all my A/V equipment and TV and start playing a random episode of my favorite TV series from my NAS.

Not necessarily a typical use case, but I decided to use it as a test. Somewhat fun, and it fairly involved because it involves changing my computer display settings, starting the right program, and making it full screen on a second monitor (TV). Plus with Vera integration I can have my lights dim to the right level and pause the TV when my motion sensor in the hall detects I’m running to bathroom (haven’t set that part up yet, but this integration makes it possible!).

Not sure that this is the best way to do this all, but it is an option and I figured I would try it out. If anyone else has other ideas I would love to hear them!

Here are some links for these programs:
http://www.promixis.com/forums/showthread.php?21079-Native-Android-control-client (Andre)
http://www.promixis.com/ (Girder)
http://timhoeck.com/2009/09/01/eventghost-for-android/ (EventGhost for Android)
http://www.eventghost.org/ (EventGhost)

@radarengineer - Totally appreciate the link. Do I need to create an account to see the wiki -pages? Not sure.

I’m all Android and would love to be able to do that. There is this SQBlaster, unfortunately works only on iPhone. I ordered Monster AVL Revolution 200 some remote which is supposed to be a universal remote + Z-wave but it wasn’t working well for me.

I’m rather new to MCV - just installed it couple of days ago and still learning a lot of things from the post. But I’m pretty sure with little effort, something what SQBlaster does for iPhone can be done with Native android apps.

I’m wondering if there would be any advantage on building Perl for MCV…? (Just because there are zillions of libs out there already )

No account needed to see the wiki. The SQBlaster looks very slick. They are supposedly coming out with an Android version and if they do I’ll probably be the first to buy/install it. They also support designing custom interface screens and when they come out with Adobe AIR / Android versions any custom interfaces should work on all platforms.

However, I need something to tide me over! Also, I would still need something running on my desktop to control the media applications.

I don’t think there is a big advantage on using Perl on Vera. Lua is a pretty nice language. Of course, as Vera runs on OpenWRT, if you really wanted to you could install Perl.

Personally I like using one of my PogoPlugs to run programs that I want running all the time that aren’t hosted on Vera. That would be a great target for any Perl programs you wanted to run. Pogoplugs are ~$35, run linux, use about 5 watts of power, and provide gigabit ethernet and 4 usb ports. I think they are great Vera extenders!

Are you sure that UPnP would not be a simpler and more versatile way to go? It seems to me like xPL is destined for obscurity since it’s usually reserved for only the most hardcore home automation geeks.
Are there consumer electronics like audio amplifiers available that use xPL out of the box?

@Quixote, UPnP is certainly a more universally supported solution and you are probably right about xPL.

However, I can get xPL working now, and I should be able to do it all in a native Vera plugin now that I have done a bit more research into it. I don’t necessarily view UPnP/xPL as exclusive to each other.