Page 1 of 1

xPL or xAP integration

Posted: Thu Sep 13, 2007 3:40 pm
by CollinR
This seems logical to me, all have similar ideals. I think EventGhost dominates the human interface and OS control and they do a very good job of hardware controls and interfaces.

Is this possible?

Re: xPL or xAP integration

Posted: Thu Sep 13, 2007 3:50 pm
by fforde
I was reading up on xPL the other day and I agree this would be a good idea for integration. The API is pretty large though, deals with a lot of different types of devices, may be a better idea to start with a specific device subset first and slowly expand it over time. I am thinking about picking up a CM11A (which xPL has a gateway for) for some automation for my home lighting. If I do that I may look at doing a plugin for EventGhost for some xPL lighting features...

Re: xPL or xAP integration

Posted: Thu Sep 13, 2007 4:07 pm
by CollinR
If you search my history you'll see I use the CM11a via CLI, it works nothing special.
http://www.eventghost.org/forum/viewtopic.php?f=5&t=371

Then came a discussion about x10 security stuffs...
http://www.eventghost.org/forum/viewtopic.php?f=2&t=509

I tried to find out why Bitmonster gets messages from his security device and I do not with my automation device. They are totally different... security, entertainment and automation. IIRC security and entertainment run at the same frequency so the remote reciever can see the motions.

Sure enough xPL has support for not only the CM11a but also a seemingly universal RF tranciever. If EG and xPL became well integrated all of those hardware devices would be good to go with EG. The CM11a medusa for xPL has full on bidirectional buffered support for the CM11a.


I'm thinking this would be a modification of the network reciever and network send plugins currently available. However I don't know just how different.

Re: xPL or xAP integration

Posted: Fri Sep 14, 2007 3:07 pm
by Bitmonster
I don't have any xPL/xAP capable device, so I can't help you much with this. But it shouldn't be that hard to solve this with the "asynchat" module and some fair Python skills.

Re: xPL or xAP integration

Posted: Fri Sep 14, 2007 3:25 pm
by fforde
For what it's worth this guy wrote a CM11A emulator when creating an xPL gateway for it. Basically he created it so he could continue development on his laptop when he was away from home and didn't have access to the actual hardware. Food for thought...

Re: xPL or xAP integration

Posted: Fri Sep 14, 2007 11:52 pm
by CollinR
Bitmonster wrote:I don't have any xPL/xAP capable device, so I can't help you much with this. But it shouldn't be that hard to solve this with the "asynchat" module and some fair Python skills.
You actually don't need any hardware at all, however the USBUIRT is also supported. All you need is xPL HAL and an xPL hub, it's very similar to EventGhost in that you can simply monitor if you like. The message structure even seem similar however it has a few more levels to denote the devices on a single IP address.

Basically all thats needed is to send a general command to the xPL network. It need not be the full on auto discovery stuff as nobody is IMHO going to actually use that dynamically with EventGhost. However being able to send a command to the xPL network would allow for much more hardware intensive stuff. xPL also runs as a service in Windows, as such the desktop interaction is nothing compared to EventGhost however the hardware IO control and stability are superior.

Once EventGhost can talk to and recieve from the xPL network you can obviously make a remote button do anything (as you can now) but also make any of the xPL devices trigger events in the local EventGhost session or any remote session.

And xPL and xAP already support a whole lot of neato hardware that wouldn't be easy to control with EventGhost directly. Z Wave devices, Ademco alarms, DSC alarms many many hardware devices.

Re: xPL or xAP integration

Posted: Mon Sep 17, 2007 6:38 pm
by CollinR
xPL toolkit for Python
http://www.xpl.myby.co.uk/downloads/uti ... oolkit.zip

Pretty far beyond my skill set but I'm going to try and make plugin to send xPL messages from EG. The toolkit provides means of monitoring for triggers as well however I know that is well beyond my skills. Ya never know though. :?

Re: xPL or xAP integration

Posted: Tue Sep 18, 2007 12:40 pm
by Bitmonster
The code is actually very easy. It mostly sends/receives plain text messages. But to use it, you need to know how the text must look like, so a basic understanding of the xPL syntax is needed. For sending xPL messages you can use a PythonScript code like this:

Code: Select all

msg_type = "xpl-cmnd"
target = "acme-cm12.server"
schema = "x10.basic"

body = """\
command=dim
device=a1
level=75
"""

# Prepare the socket for transmitting the message
addr = ("255.255.255.255",3865)
UDPSock = socket(AF_INET,SOCK_DGRAM)
UDPSock.setsockopt(SOL_SOCKET,SO_BROADCAST,1)

msg = msg_type + "\n{\nhop=1\nsource=johnb-sender.python\ntarget=" + target + "\n}\n" + schema + "\n{\n" + body + "\n}\n"

# Send the message
UDPSock.sendto(msg,addr)

This is some example data I've just grabbed from this site:
http://wiki.xplproject.org.uk/index.php ... n_Document
I don't know if this message would actually make sense, but you only have to edit the msg_type, target, schema and body variables to experiment with other messages.

Re: xPL or xAP integration

Posted: Tue Sep 18, 2007 2:16 pm
by CollinR
Way beyond my skill set. :(


It would probably need provisions for the heartbeats, you can actually have it update the xPL network whenever you add or remove an EG plugin. Same if a plugin fails to load properly.

Re: xPL or xAP integration

Posted: Tue Nov 13, 2007 12:16 am
by CollinR
^^^ BTT ^^^

xPL now has support for Z Wave automation devices, this will kill x10. This would also put EventGhost smack dab in the middle of the OS home automation scene.

This would require 2 way support though.