Insteon PLM Ruby Code 760

From LinuxMCE
Revision as of 00:16, 12 March 2008 by Ddamron (Talk | contribs)

Jump to: navigation, search
        1. Written by Dan Damron
        2. #760 Send Command to Child ####


@insteonID = id.chomp.split('.') @parameters = parameters @command = pk_command @cmd = cmd

log('#760:id=' + id.inspect) log('#760:parameters=' + parameters.inspect) log('#760:pk_command=' + pk_command.inspect) log('#760:cmd=' + cmd.inspect)

      1. ok, I get the insteonID in @insteonID
  1. pk_command has one of THREE values, 192, 193, or NOTHING
  2. when I click 50%, I get in parameters: 76
  3. but NOTHING in pk_command.

case pk_command when '192' #ON

 param = {'Command' => 'SndIns',
   'Parameter1' => @insteonID[0],
   'Parameter2' => @insteonID[1],
   'Parameter3' => @insteonID[2],
   'Parameter4' => 'OF', # Flags
   'Parameter5' => '11', # Insteon SetLevel
   'Parameter6' => 'FF'} # FULL ON
 $cmdqueue << param
 SndIns()

when '193' #OFF

 param = {'Command' => 'SndIns',
   'Parameter1' => @insteonID[0], 
   'Parameter2' => @insteonID[1],
   'Parameter3' => @insteonID[2],
   'Parameter4' => '0F', 
   'Parameter5' => '13', #OFF
   'Parameter6' => '00'}
 $cmdqueue << param
 SndIns()


when

 if parameters=='76'
   #SetLevel 50%
   param = {'Command' => 'SndIns',
     'Parameter1' => @insteonID[0],
     'Parameter2' => @insteonID[1],
     'Parameter3' => @insteonID[2],
     'Parameter4' => 'OF', # Flags
     'Parameter5' => '11', # Insteon SetLevel
     'Parameter6' => '76'} # 50%
   $cmdqueue << param
   SndIns()
 end

end