RedEye #6: Testing IP Control Codes

Knowing what a device returns after a command is received (sent by redid), helps design a control strategy.


Create System Variable, myInput, for the Control Code

  • Point your web browser at the RedEye.
  • Click Setup
  • Click the Room
  • Click Custom Variables


  1. Click Add New Variable
  2. For Name enter myInput
  3. Value can remain empty
  4. Click Save

Create a New Command


Click Add New Command

Create a Command to send an IP Control Code

  1. For Type select Other
  2. For Name enter Send IP Cmd
  3. Click Edit Script and go to the next step – Enter Script.
  4. When the next step is complete, click OK

Enter Script


Replace line 5, as indicated above, with the following script .

local c = string.upper(Scripting.GetVariable("myInput"))
local b = Scripting.GetVariable("HTMLbody")
    b = [[<tr>
    <td style="border-style: none; text-align:left;">(user)</td>
      <td style="border-style: none; text-align:left;">]]
        .. c .. " -----" ..
    </tr>]] .. b
Scripting.SetVariable("HTMLbody", b)
Scripting.SetVariable("HTMLmsg", [[<table style="font-size: 80%;">]] .. b .. [[</table>]])


Click Apply Changes
Complete step 4 of the previous step.

Edit Layout

  1. Click Save Changes
  2. Click Layout > Edit

Make Room on Layout

  1. Click on HTML field to highlight
  2. Click and drag to make room at the top

Add Text Field

  1. Select Text Field
  2. Click Add Control
  3. Position new Text Field

Link Variable to Field

  1. Click to highlight Text Field
  2. Click Text Field Values
  3. Select Text Variable, myInput

Add Button

  1. Select Button
  2. Click Add Control
  3. Drag to reposition button

Set Button Action

  1. Select button
  2. Click Actions / Toggles
  3. Select Type as Normal
  4. Select Action Type as Command
  5. Select VSX A/V Receiver (your device)
  6. Select Send IP Cmd
  7. Click green, Save Changes button

Test Changes


Return to Devices page and click (Exit)
Select the device (VSX A/V Receiver)

  1. Enter a command
  2. Click outside of the text box (so the entered text is stored in the System Variable)
  3. Click Send IP Cmd

After a short delay, the sent command should display, followed by the response sent by the VSX.