Hi,
I want to write a plugin that will be an interface to multiple devices via a single tcp/ip socket. I think it should be pretty straightforward, I just want to make sure I do it the right way.
I’ve messed around with plugins for a single device over tcp/ip (controlling a Denon 3808 over Ethernet, which incidentally I promised I would upload sometime ago. I’ve been testing it tonight, will upload it soon :o).
Basically I am interfacing to mochad, which is a linux driver for the cm15a/cm19a usb x10 controllers. Please don’t tell me I’m wasting my time with x10, I just installed a dozen x10 motion sensors at $6 each and they are working great! I can’t afford to replace them all with z-wave right now 
But this question is really more general than that. I want to be able to install a controller device, give it an IP address, but then install other devices in vera (lights, motion sensors, etc) and have them interface through the controller (I guess it would be their “parent” device?).
Anyway, I would appreciate any advice. Also, if anyone is interested in using x10 with vera, mochad is a great little driver. A refurbished cm15a is ~$16, motion sensors are about $5, and other than that you just need an old linux box or router than can run openwrt (eventually I might try to get this running on the vera itself, but one step at a time!). This is x10 wireless and/or wireless security protocals so all the compaints about x10 power don’t apply, but you can use those with mochad too and I would like to support them.
-re
One Parent device, setup to be configured to point to the IP Address of the remote adapter. Presumably the messages on the Bus have some sort of “id” associated with them, so each unique Light/Sensor/whatever on the bus.
For each of these, you create a child-device (in Vera), and use the Device name as the Id from the Bus so you can look them up easily later. The Parent device is set to [tt]handleChildren[/tt] so that all events/actions/IO is delivered to it, and handled by a single implementation file [tt]I_xxxxx.xml[/tt].
This implementation file has the logic to handle all the variations of Device Type(s), from Motion, to Lighting, etc. It’s [tt][/tt] block handles the responses from the devices, and it has a series of [tt][/tt] blocks, using the standard serviceId’s (for lights, motion, etc) so that Buttons can be pressed in Vera’s UI, and the corresponding message sent over Ethernet to the Device.
These [tt][/tt] blocks should likely be one as [tt][/tt] blocks, instead of [tt][/tt] blocks, of Lua code in case they take a while to deliver etc.
The main problem you run into with this stuff is that you need a way to “discover” what’s out there on the Bus, what types they are etc. You need to invoke this discovery mechanism [synchronously] and so that you can pre-create the MiOS Child devices.
The Alarm Panels all do this, but the EnOcean driver may do it also… depending upon how complete it is. The GC100 doesn’t something like this @Startup also.
Anyhow, it’ll be something like the above… 
Thank you! That cleared things up quite a bit for me.
I can certainly put in a little wrapper code on the other end to handle the child device population if I have to, although eventually it would probably be easier if I figure out a way to allow these to be added in Vera.
Anyway, I very much appreciate the help.
-re