Author Topic: Thoughts on integrating with HAI OmniPro  (Read 2092 times)

archived

  • Hello, I'm new here
  • Posts: 0
    • View Profile
Thoughts on integrating with HAI OmniPro
« on: October 26, 2006, 02:21:32 am »
I will be closing on a new house in a month and will be installing a omnipro II system with security, ~30 upb switches, 9 thermostats, 3 video units and either a nuvo or russound audio system.  I'm a total linux geek, so naturally I want plutohome as a interface into this system.

The omnipro has a well documented protocol over both serial and ethernet connections, and newbielink:http://home.austin.rr.com/ccannon7/downloads.htm [nonactive] has a great GPL'd C++ library and command line client to access the unit, taking care of encryption and authentication.  Charlie's (the author) code is very complete and up to date and handles everything in the spec ( as far as I can tell)

I would love it if someone at Pluto would create a device template for the omnipro, if not I could try adding it using the gsd template.  I read over the documentation on the wiki, but I have a few more questions.

My first quuestion is should I use this command line client to do the talking or try and send the codes raw?  The library above has all the network login logic (including AES encryption if its turned on) which I'm not sure how to do with the point and click interface.  If I do use the client, I'm guesing I will have to write the logic in Ruby (I have never used it, but it looks simple enough)?  If it comes down to me and C++, then I'm afraid this may take awhile :-)

Second, the omnipro is really an interface to many other things plutohome understands (light, security, etc).  How do I create the GSD device so that I can add lights and such to it under the lighting second in the wizard web interface?  Or do I need to add every device under the omnipro manually as a generic child device (or is this the same thing?).  If I add a light under  the omnipro gsd and give it a port/channel of 1, how do I map that to the correct commands from pluto to the omnipro device?

I'm really hoping someone at Pluto has a way of quickly adding this... but if not I will try my best to get something working, I just need some help if I'm going and try to do this by my self.

Any help would be greatly appreciated.
Thanks!
Dan

archived

  • Hello, I'm new here
  • Posts: 0
    • View Profile
Thoughts on integrating with HAI OmniPro
« Reply #1 on: October 27, 2006, 08:49:49 pm »
Any ideas here?  

I do have a few questions about GSD and ruby.

1. Where are the pluto specific ruby objects documented?  In the weeder example there are cmd, device and con objects, where can I find out more on this.?

2. how would a persistant connection to the omnipro be refrenced?  If I need to exectue the command line client to create this connection, how do I recieve events from it and how do I send commands to an object wrapping this connection? I'm under the assumption that this will need to be consistantly logged in so it can recieve lighting, security and thermo events, or is this done through polling?  

3. How do I find other devices that use GSD and ruby to help guide me?  I'm very proficient in myql so if there's a table and column i need to get this from what are they (I'm guesing thats where the ruby code is stored)?

4. How does the IP address field come into play in the template (it seems to be on all templates)?  If I'm not using the command line client from the library in the previous post, how does pluto talk to an IP device?  does it just make a raw socket connection to the IP and port specifed in the template and try and send ascii or charactors?

I don't yet have an omnipro to test this with, but  i would like to get a head start on this before I purchase and install the system.

Thanks for your help
Dan-

archived

  • Hello, I'm new here
  • Posts: 0
    • View Profile
Talking to myself
« Reply #2 on: November 02, 2006, 10:32:32 pm »
I found these on the wiki by searching, didn't see them linked through the the programming docs.

newbielink:http://plutohome.com/wiki/index.php/Generic_Serial_Device [nonactive]
newbielink:http://plutohome.com/wiki/index.php/GSD_Ruby_Interface [nonactive]

archived

  • Hello, I'm new here
  • Posts: 0
    • View Profile
Thoughts on integrating with HAI OmniPro
« Reply #3 on: November 03, 2006, 01:19:54 pm »
Hi,
First of all, you should have the Generic_Serial_Devices sources available from our svn server.

1. The C++ to Ruby interface is contained in Generic_Serial_Devices, see the file names which are ending with Wrapper. We are using the swig application.
When you want to play with a ruby object which comes from pluto, you should check the API described into the related wrapper.

2. There is a persistent connection with the device, this connection can be via a serial connection or a TCP/IP connection, it depends on your GSD template. See the conn_ ruby object. Sure, you can make it not persistent if you use conn_.Close
When there are bytes available, your ProcessIncommingData ruby function will be called.

3. You can take a look into the Generic_Serial_Devices/Embedded Devices/ ruby files.
Also all the ruby code is available in the database, you have to run the following command
SELECT PK_InfraredGroup_Command,IRData
FROM InfraredGroup_Command
INNER JOIN InfraredGroup ON
InfraredGroup_Command.FK_InfraredGroup=PK_InfraredGroup
INNER JOIN DeviceTemplate ON
DeviceTemplate.FK_InfraredGroup=PK_InfraredGroup
WHERE PK_DeviceTemplate=TheGSDDeviceTemplate;
Or just click on the device template web page to "Edit ruby codes" link.

4. Pluto is using the device data fields to initiate the connection, the connection is sending/receiving binary data so that you will be able to communicate with any device. See the API for RubySerialIOConnectionWrapper.
It's up to you to format the data as required by the protocol.
Regards,
Eugen

archived

  • Hello, I'm new here
  • Posts: 0
    • View Profile
Thoughts on integrating with HAI OmniPro
« Reply #4 on: November 03, 2006, 03:04:07 pm »
Thanks, I think I have enough to go on.  I was looking at other GSD devices and the power5020 template will be a good learning tool for creating my own.

archived

  • Hello, I'm new here
  • Posts: 0
    • View Profile
Thoughts on integrating with HAI OmniPro
« Reply #5 on: November 03, 2006, 05:28:16 pm »
Quote from: "eugen.c"
Hi,
First of all, you should have the Generic_Serial_Devices sources available from our svn server.

1. The C++ to Ruby interface is contained in Generic_Serial_Devices, see the file names which are ending with Wrapper. We are using the swig application.
When you want to play with a ruby object which comes from pluto, you should check the API described into the related wrapper.

...

Regards,
Eugen

Hi,

I have following question (since I'm much better in Perl that in Ruby).

Does this mean that if I use swig to generate Perl wrapper am I somewhere near that goal ?

Are there any other obstacles on embedding Perl into Pluto ? Who is the most familiar with Ruby&Swig in your team ?

If we get Perl running, there is a huge repository of available code snippets, a lot of things could be contributed (for instance Misterhouse has a large repository of useful stuff)...

Thanks in advance,

regards,

Rob.

archived

  • Hello, I'm new here
  • Posts: 0
    • View Profile
Thoughts on integrating with HAI OmniPro
« Reply #6 on: November 06, 2006, 08:03:40 am »
Hi Rob,
For sure it is possible to use swig to create the interface between GSD and perl.
I can add it as wishlist because I am not sure how much changes have to be made so that we can support many scripts languages.

But please consider to learn the basics of ruby first. GSD doesn't require advanced ruby (you didn't build a web page engine or a full ruby application). All you have to do is to implement some ruby functions.
I didn't know ruby at all before doing some GSD support and I can tell you from my experience and other developers experience that you need just few days to be able to work in ruby for GSD.
Thanks,
Eugen