liri
Newbie

Posts: 6
|
 |
« on: June 09, 2009, 03:51:13 pm » |
|
Hey,
I have had exchanged some ideas with Hari on #linuxmce about the Z-Wave driver though that was long ago and I am returning to this project now, where it is much more imminent.
I am planing on having a linux box running the z-wave driver to control house accessories but I won't be putting linuxmce on it as it is supposed to be a dedicated z-wave box. I'm planing to write a web interface to provide complete management for it.
This isn't going to be a commercial product, it's a personal project and I'm only interested in the z-wave functionality for my smart home so I am not going to dive into developing my own z-wave driver by reading the current's driver source code or docs, the only development which I'll be pursuing is the web development for the GUI (something nice, ajax and stuff :-) ).
I'd like to get a better understanding at where does this stand on having the z-wave driver running on an environment outside of LinuxMCE.
Thanks.
|
|
|
|
|
Logged
|
|
|
|
|
tschak909
|
 |
« Reply #1 on: June 09, 2009, 05:47:08 pm » |
|
Hari's Z-Wave device is a DCE device, and thus should be used within the construct of DCE. This means you would need, * DCE Router * LibDCE * PlutoUtils * SerializeClass * MySQL for the database * Lighting Plugin (to provide some abstracted functionality) * Climate Plugin (same thing) * Security Plugin (same thing) * The ZWave device template in the database * the templates for each child device You can then build a complete system around this, using LibDCE to send messages to the lighting plugin and to the ZWave device. You get in return: * A stable architecture * an extensible architecture * interoperability with our stuff or, you could just reinvent the wheel like any other programmer...but in my view that would be retarded.  -Thom
|
|
|
|
|
Logged
|
|
|
|
liri
Newbie

Posts: 6
|
 |
« Reply #2 on: June 09, 2009, 08:14:41 pm » |
|
How does the current Z-Wave driver work? In simple terms it is passed commands to put "jobs" in queue and then there's another component to poll for these jobs and execute them.
Assuming that is correct, what is used to send the Z-Wave driver the commands? what kind of interface is it? (is it like heyu? a binary which you call with some arguments) I'm guessing those "queued jobs" are simply entries in a mysql database table which the poller side checks and execute.
Regards,
|
|
|
|
|
Logged
|
|
|
|
|
tschak909
|
 |
« Reply #3 on: June 09, 2009, 11:02:57 pm » |
|
The Z-Wave driver is a DCE device, it sends and recieves DCE messages, which are generated and recieved by every other part of LinuxMCE. DCE is defined here: http://wiki.linuxmce.org/index.php/Developers_GuideAnd is implemented by the DCE library, and is utilized by DCERouter and the other DCE devices. -Thom
|
|
|
|
|
Logged
|
|
|
|
liri
Newbie

Posts: 6
|
 |
« Reply #4 on: June 10, 2009, 07:50:01 am » |
|
Alright, that's a good doc, thanks.
I don't have a problem installing all of these components, I'm just trying to figure out how it all fits together.
To get more practical on this - once all of these components are installed, telling the DCE system (let's just call it that instead of z-wave driver) to turn on/off some z-wave lamp device is involved in doing what? sending a command to the listening port of the DCERouter? inserting a mysql record?
Regards,
|
|
|
|
|
Logged
|
|
|
|
|
tschak909
|
 |
« Reply #5 on: June 10, 2009, 07:57:28 am » |
|
It involves sending a message through the DCERouter to the ZWave device, either by:
(1) connecting to port 3450 and fashioning a raw DCE message (2) using libDCE and the generated classes from sql2cpp, etc.. to fabricate a message, (look at different DCE devices, there are methods for each and every DCE command, these are generated by DCEGen). (3) using MessageSend to send the message to the DCERouter.
-Thom
|
|
|
|
|
Logged
|
|
|
|
liri
Newbie

Posts: 6
|
 |
« Reply #6 on: June 10, 2009, 08:01:07 am » |
|
Hey Thom,
Thanks for the quick reply once more. I am not looking to invent the wheel or spend too much time on a "driver" interface, like I said before, the only development I'm looking at would be the web interface for myself.
So options 1 and 2 involve either writing my own dce router client pretty much which is too time consuming and do not serve my goal.
I'm hoping that MessageSend is a binary/shell script tool which provides me easy interfacing with the DCE router?
Regards,
|
|
|
|
|
Logged
|
|
|
|
liri
Newbie

Posts: 6
|
 |
« Reply #7 on: June 10, 2009, 09:03:40 am » |
|
Googling a bit I have found the answer to MessageSend, being http://wiki.linuxmce.org/index.php/MessageSendwhich is described pretty good. I guess I can count on using that. This brings me to another layer of this integration... device, category, templates, a bit confusing. So a z-wave lamp controller for example would need to be known to the dce for that to be able to control it, meaning it would need to be inserted into the database. Is this a complex entity building for the z-wave lamp controller or does it conclude with some general record describing the device?
|
|
|
|
|
Logged
|
|
|
|
|
hari
|
 |
« Reply #8 on: June 10, 2009, 10:35:50 am » |
|
the z-wave dce device will create all childs from the node list in the dongle with help of the general info plugin. The childs are "regular" LinuxMCE devices, like dimmable lights, switch, generic sensor, ...
best regards, Hari
|
|
|
|
|
Logged
|
|
|
|
|
posde
|
 |
« Reply #9 on: June 10, 2009, 12:06:09 pm » |
|
liri, if I were in your shoes, I'd get me a MiCasaVerde box ( http://www.micasaverde.com). It is exactly what you need.
|
|
|
|
|
Logged
|
|
|
|
|
tschak909
|
 |
« Reply #10 on: June 10, 2009, 04:06:10 pm » |
|
I would use sqlcvs and get a copy of our database to use for the database information.
-Thom
|
|
|
|
|
Logged
|
|
|
|
tmetro
Newbie

Posts: 1
|
 |
« Reply #11 on: July 10, 2009, 11:36:51 pm » |
|
Hari's Z-Wave device is a DCE device, and thus should be used within the construct of DCE. ...or, you could just reinvent the wheel like any other programmer...but in my view that would be retarded.  A quick look at the code shows that ZWave.cpp seems to implement the "DCE" interface needed by LinuxMCE, while ZWApi.cpp implements the Z-Wave primitives and actual interface to the USB device (via a serial library). So it seems quite probable that these two pieces could be split, and thus avoiding reinvention, as well as the need to provide a lot of support infrastructure that may not be needed by simpler projects. I ran across discussion on the MisterHouse list about how some of the developers aren't happy with the MH driver architecture and they mentioned the idea of using xPL/xAP as the API: http://www.xplproject.org.uk/http://www.xapautomation.org/which appears to be a community developed protocol designed to layer over proprietary automation protocols, such that you might have say a gateway box (or daemon) that talks Z-Wave, and another gateway box that talks INSTEON, with both connected to Ethernet and speaking xPL/xAP to the main controller. The LinuxMCE driver could then be split into two components: a DCE wrapper around an xPL/xAP client, and a Z-Wave driver that implements the xPL/xAP network interface. Then HA software in any language can interact with your Z-Wave driver, and you can gain contributors to it from multiple projects. Plus LinuxMCE gains access to other xPL/xAP devices. -Tom
|
|
|
|
|
Logged
|
|
|
|
|
tschak909
|
 |
« Reply #12 on: July 11, 2009, 12:40:38 am » |
|
Okay, go for it.  -Thom
|
|
|
|
|
Logged
|
|
|
|
|
hari
|
 |
« Reply #13 on: July 11, 2009, 12:13:19 pm » |
|
you could also expose all DCE devices with xPL/xAP..
|
|
|
|
|
Logged
|
|
|
|
|
|
|