LinuxMCE Forums

General => Users => Topic started by: randomfeelings on October 13, 2008, 04:22:03 pm

Title: Rako Lighting integration
Post by: randomfeelings on October 13, 2008, 04:22:03 pm
Hi

I'm a new user, looking to integrate Rako Lighting. http://www.rakocontrols.com/

Has anyone got any experience on this?

I've found an archived post on these forums which suggests that the user managed to get it integrated via the RS232 module using ruby scripts.

Can anyone point me in the right direction for this - ie where do I get started once I have plugged my RS232 Rako box into a serial port; creating scripts etc?
Title: Re: Rako Lighting integration
Post by: tschak909 on October 13, 2008, 04:41:19 pm
You should go to the wiki and do a search for GSD. This is the Generic Serial Device. GSD scripts are written in Ruby, so if you haven't any experience with Ruby, go check out http://www.ruby-lang.org/

The basic premise is, you create a device template explaining what the device is, what commands it can respond to, and what events it should be able to emit. Once you do this, you'll get boxes for each command and event, so that you can write code to respond to them.

-Thom
Title: Re: Rako Lighting integration
Post by: randomfeelings on October 13, 2008, 05:14:08 pm
Thanks Thom! :)
Title: Re: Rako Lighting integration
Post by: sp00nhead on October 13, 2008, 06:38:34 pm
I've got a basic template for rako. It's really rough but worked enough to demo the kit (was demoed at the Uk cedia expo two years ago)
I would really like to get it finished and have a go getting bi-directional control added to it. Here a dump of the code. I'll try and explain any questions IF i remember how i got it to work :)

Code: [Select]
RCODE:
   0:require 'Ruby_Generic_Serial_Device'
   1:class Command < Ruby_Generic_Serial_Device::RubyCommandWrapper
   2:end
   3:class Device_48 < Ruby_Generic_Serial_Device::RubySerialIOWrapper
   4:#### 350 ####################################################################
   5:def cmd_350(cmd=nil)
   6:@returnParamArray.clear
   7:buffer = conn_.Recv(100,500)
   8: print buffer
   9:
  10:return @returnParamArray
  11:end
  12:#### 355 ####################################################################
  13:def cmd_355(cmd=nil)
  14:@returnParamArray.clear
  15:rakoReset
  16:setHouse
  17:
  18:return @returnParamArray
  19:end
  20:#### PRIVATE METHODS ####################################################################
  21:#373 Private method Listing
  22:
  23:#Send Message out
  24:def sndgsd(message)
  25:   conn_.Send(message)
  26:end
  27:
  28:#Pull in lights room and channel from the device data
  29:def getRoom(myData)
  30:   print myData
  31:   getMyData = myData.split(',')
  32:   myRoomID = getMyData[0]
  33:
  34:end
  35:def getChannel(myData)
  36:   print myData
  37:   getMyData = myData.split(',')
  38:   myChannelID = getMyData[-1]
  39:end
  40:
  41:
  42:def setRoom(myData)
  43:   getMyData = myData.split(',')
  44:   myRoomID = getMyData[0]
  45:   sndgsd("RO:#{myRoomID}\r\n")
  46:end
  47:
  48:def setChannel(myData)
  49:   getMyData = myData.split(',')
  50:   myChannelID = getMyData[-1]
  51:   sndgsd("CH:#{myChannelID}\r\n")
  52:end
  53:def setHouse
  54:   house = device_.devid_[267]
  55:   sndgsd("HO:#{house}\r\n")
  56:end
  57:
  58:def rakoReset
  59:   sndgsd("RESET\r\n")
  60:end
  61:def cmd_ReceiveCommandForChild(cmd)
  62:childID = device_.childdevices_[cmd.devidto_].devdata_[12]
  63:#getRoom_Channel(childID)
  64:
  65:setRoom(childID)
  66:setChannel(childID)
  67:
  68:
  69:  if cmd.id_ == 192
  70:     serial_on = "LEVEL:255\r\n"
  71:     print( "Sending " + serial_on + " \n" )
  72:     sndgsd(serial_on)
  73:  end
  74:
  75:  if cmd.id_ == 193
  76:     serial_off = "OFF\r\n"
  77:     print( "Sending " + serial_off + " \n" )
  78:     sndgsd(serial_off)
  79:  end
  80:
  81:  print("We got cmd: " + cmd.id.to_s)
  82:
  83:  if cmd.id_ == 184
  84:     dim_level = cmd.params_[76]
  85:     serial_dim = "LEVEL:"+dim_level+"\r\n"
  86:     print( "Sending " + serial_dim + " \n")
  87:     sndgsd(serial_dim)
  88:  end
  89:end
  90:#### START SETTERS ####################################################################
  91:def initialize()
  92:super
  93:@returnParamArray=Array.new
  94:end
  95:####  END  SETTERS ####################################################################
  96:end
Title: Re: Rako Lighting integration
Post by: Marie.O on October 13, 2008, 09:14:43 pm
sp00nhead,

great!

Would you mind making a wiki entry out of it? You might want to look at the Insteon wiki entry made by ddamron

http://wiki.linuxmce.org/index.php/Setting_Up_PLM_Template (http://wiki.linuxmce.org/index.php/Setting_Up_PLM_Template)

Thanks again!

rgds
Oliver
Title: Re: Rako Lighting integration
Post by: totallymaxed on October 13, 2008, 09:27:23 pm
Hi

I'm a new user, looking to integrate Rako Lighting. http://www.rakocontrols.com/

Has anyone got any experience on this?

I've found an archived post on these forums which suggests that the user managed to get it integrated via the RS232 module using ruby scripts.

Can anyone point me in the right direction for this - ie where do I get started once I have plugged my RS232 Rako box into a serial port; creating scripts etc?


Hi,

You might also find this wiki page of use; http://wiki.linuxmce.org/index.php/Bash_dce_knx (http://wiki.linuxmce.org/index.php/Bash_dce_knx)

This is our almost 100% Bash based implementation (a small piece of C code is used) of a fully 2-way KNX-EIB interface driver. Look at the page and grab a copy of the sources (listed on the page).

I am sure that a fully bi-directional RAKO RS-232 driver could be created based on our experience developing the BashKNX code.

Hope this helps.

All the best

Andrew