Author Topic: Ruby GSD codes help  (Read 12109 times)

digitaldan

  • Newbie
  • *
  • Posts: 13
    • View Profile
Ruby GSD codes help
« on: September 30, 2008, 04:21:38 pm »
Hi I'm very close to releasing a ruby/GSD interface to HAI's ( http://www.homeauto.com ) Omni line of home automation controllers.  As it stands I have the networking, 128 bit aes encryption, lights, security, thermostats and aux sensors working. I just have a few questions I'm hoping a GSD guru might help me out with.

1. How or who calls "#756 Report Child Devices" ? I can call this manually but I would assume LinuxMCE would do this for me.  My code will auto discover children, I would assume this is the right place to put it. Right now its not automatically being called.

2. On startup or reload LinuxMCE needs to know the state of lights, temps, etc.... Is this something that should be done in "#355 Process Initialize" or is there another method for reporting state?  If so, again what triggers linuxmce to do this?

3. How or where can I found out how methods are called and who calls them? I don't understand the relationship between  "command groups", "events" and the "device category" and how they effect what GSD methods get called and by what.  Could someone explain this a little more?

For what its worth my device is in the "Interfaces - Security Interface #80" and has the "Ruby Internal Commands" and "Security Panel" command groups.  It also has "Alarm panel mode change #67", "Reporting Child Devices #54" and  "Sensor Tripped #9" events.

Thanks!
Dan-

 

Amathus

  • Regular Poster
  • **
  • Posts: 37
    • View Profile
Re: Ruby GSD codes help
« Reply #1 on: October 01, 2008, 06:47:47 am »
I really wish I could help you technically, but I am a real dumb nut when it comes to code. However, I do resell HAI gear and would be VERY excited to test out the RUBY code once you have it finalised - PLEASE - Cheers.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Ruby GSD codes help
« Reply #2 on: October 02, 2008, 03:40:02 pm »
I would suggest sending a private message to ddamron. He is our resident GSD hacker.

-Thom

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Ruby GSD codes help
« Reply #3 on: October 03, 2008, 06:47:34 pm »
3. How or where can I found out how methods are called and who calls them? I don't understand the relationship between  "command groups", "events" and the "device category" and how they effect what GSD methods get called and by what.  Could someone explain this a little more?

A little note on command groups etc. On the orbiter when you click a button, a commandgroup gets executed. This commandgroup can contain multiple Command entries, which in turn send messages to devices or device categories. The difference is for example, if you just want to turn off all media devices in a room, you don't send a message to a single media device, but to a group "Media Devices" (I don't know if such a group really exists, but you hopefully get my point). Events happen and execute command groups.

hth
rgds
Oliver

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Ruby GSD codes help
« Reply #4 on: October 04, 2008, 12:50:59 am »
1. How or who calls "#756 Report Child Devices" ? I can call this manually but I would assume LinuxMCE would do this for me.  My code will auto discover children, I would assume this is the right place to put it. Right now its not automatically being called.
report child devices should send an event to lmce reporting all child devices. You can call this to report devices after you built a list at startup.

Quote
2. On startup or reload LinuxMCE needs to know the state of lights, temps, etc.... Is this something that should be done in "#355 Process Initialize" or is there another method for reporting state?  If so, again what triggers linuxmce to do this?
you usually send events for your child devices when e.g. a sensor is tripped or a light level changes.

Quote
3. How or where can I found out how methods are called and who calls them? I don't understand the relationship between  "command groups", "events" and the "device category" and how they effect what GSD methods get called and by what.  Could someone explain this a little more?
look at the dcerouter plugins.

best regards,
Hari
rock your home - http://www.agocontrol.com home automation

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Ruby GSD codes help
« Reply #5 on: October 04, 2008, 12:54:19 am »
look at the apex destiny device template for some ruby security interface examples

best regards,
Hari
rock your home - http://www.agocontrol.com home automation

dlewis

  • Guru
  • ****
  • Posts: 401
    • View Profile
Re: Ruby GSD codes help
« Reply #6 on: October 05, 2008, 09:11:37 pm »
DigitalDan,

Any updates on this? Got any screenshots? Thanks!

-D

digitaldan

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Ruby GSD codes help
« Reply #7 on: October 06, 2008, 09:00:35 pm »
Thanks, I used the DSC security panel as a model which is very similar.   I am very close to releasing it, what I have left to do is error handling, temperature control and omni -> linuxmce events of lights, security, temps, etc....  Hopefully I have the hardest part behind me.  For the record this will require at least version 2.16 to work (i'm using the new TCP based protocol to talk with the omni pro).  I will let people know here when it is ready. 

One more question, when I report on devices LinuxMCE is appending the device type to the name and then truncating the name after 30 characters, for example when I report a child with the description "Garage Lights", LinuxMCE adds it as "Light Switch (dimmable) Garage".  How can I prevent it from appending the type to the name/description?

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Ruby GSD codes help
« Reply #8 on: October 13, 2008, 04:02:21 pm »
digitaldan,

if you look at the pluto_main schema, you will find that column Description in table Device is 30 characters long.

rgds
Oliver

dlewis

  • Guru
  • ****
  • Posts: 401
    • View Profile
Re: Ruby GSD codes help
« Reply #9 on: October 13, 2008, 04:18:16 pm »
Hey Dan,

Thanks for the update. Please keep us posted on the progress.

I spoke to some of the LinuxMCE dev guys. They said that 30 is the default in the database. You can edit the descriptions to your liking. Also, you can alter the schema of pluto_main, but this is not suggested. Larger descriptions don't make sense on the orbiters, as they would not fit on the UI1 buttons (as far as they know). Thanks again!

-D

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Ruby GSD codes help
« Reply #10 on: October 13, 2008, 09:24:58 pm »
dlewis,

you are waaaay to slow.

rgds
Oliver

:)

digitaldan

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Ruby GSD codes help
« Reply #11 on: October 13, 2008, 09:32:29 pm »
Thanks, the problem is not so much the length but that LinuxMCE is appending things like "Light Switch (dimmable)" to the front of the name and eating much of that 30 char limit.

I'm taking a little break from the ruby code to work on a second release of my iPhone app "H@me" as well as a Java/Apache Axis frontend to my omni (how cool would it be to have a web service enable home?).  I will post here once I come back and get it fully working.

D-

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Ruby GSD codes help
« Reply #12 on: October 13, 2008, 09:40:34 pm »
This can already be done either:

(1) with the web orbiter
(2) from a mobile orbiter on a supported cell phone.

-Thom

digitaldan

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Ruby GSD codes help
« Reply #13 on: October 13, 2008, 10:01:26 pm »
This can already be done either:

(1) with the web orbiter
(2) from a mobile orbiter on a supported cell phone.

-Thom


I meant web service as in rest, soap and json, specifically with all the features of my omni, not just the ones that LinuxMCE overlap with.  Once that happens then integration with other systems like linuxmce, xbmc, etc... become much easier.

D

dlewis

  • Guru
  • ****
  • Posts: 401
    • View Profile
Re: Ruby GSD codes help
« Reply #14 on: October 13, 2008, 11:02:32 pm »
posde, I guess I am to slow... lol...

Dan, keep us updated on how this goes. Looks like you're working on some great stuff for LinuxMCE and the HAI Omni Pro...