DirecTV HTTP Binding Setup

I have the HTTP Binding working with DirecTV and Alexa and I want to share my work. The scope of this work includes one DirecTV Genie and one or more Mini Genies. JSON parsing is not included since I only want to send voice commands to Alexa and control my set-top boxes. I modeled this solution from @TrevorG’s recent post, but I will provide some details that I have not found elsewhere in OpenHAB topics.

The first step is to port forward the internal IP address for the DirecTV Genie to 8080. The Mini Genie communicates through the same IP address, so its only necessary to port forward the DirecTV Genie. The IP address of the DirecTV Genie is found at: Menu -> Settings -> Internet Setup -> Advanced Setup. Port forward the Server IP address to 8080. It is best to set this as static ip address on your router.

Before leaving the DirecTV Genie Settings, go to Menu -> Settings -> Whole-Home -> External Devices. Make sure that “External Access” is set to “Allow”. Also, Menu -> Settings -> Whole-Home -> Manage Clients -> Network Details. Copy the MAC Address(es) of the client(s) i.e. Mini Genies. MAC address of each Mini Genie will be used in the HTTP Binding protocol to send commands.

I use two different HTTP syntax commands for DirecTV Genie:
1.) The Remote Keys Request Commands. Remote Keys Commands mimics a button press on DirecTV remote controls. An example for the “Menu Button” command is:
http=">[*:GET:http://IPaddress:port/remote/processKey?key=menu&hold=keyPress:default]"
Where you would replace IPaddress:port with the ip address identified earlier, such as:

http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=menu&hold=keyPress:default]"

2.) The second type of command is the Tune Request Command which I use for favorite channels. An example of a tune request for channel 9 is:

http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=009]

Mini Genie Commands:
Since Mini Genies do not have their own IP address, the http bining communicates with Mini Genies by appending their MAC address to DirecTV Genie commands. For example, if the MAC address of a Genie is:99F7C76B68BE, the “Menu Button” command is:

http=">[*:GET:http://192.168.1.210:8080/remote/processKey?key=menu&hold=keyPress&clientAddr=99F7C76B68BE:default]"

.

The Mini Genie request for channel 9 is:

 http=">[*:GET:http://192.168.1.210:8080/tv/tune?major=009&clientAddr=99F7C76B68BE]"

My http.cfg file is

GenieCache.url=http://192.168.1.210:8080/tv/getTuned
GenieCache.updateInterval=50000

To control http functions with Alexa, I turned them into lights. To make it easy for me to distiguish between my set-top boxes, I refer to the Genie as “TV” and I refer to the Mini Genie as “Cable”. My items file is as follows:

Switch HDDVR_GUIDE "TV Guide" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=guide&hold=keyPress:default]" }
Switch HDDVR_RED "TV Delete" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=red&hold=keyPress:default]" }
Switch HDDVR_EXIT "TV Exit" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=exit&hold=keyPress:default]" }
Switch HDDVR_PREV "TV Last Channel" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=prev&hold=keyPress:default]" }
Switch HDDVR_MENU "TV Menu" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=menu&hold=keyPress:default]" }
Switch HDDVR_LIST "TV List" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=list&hold=keyPress:default]" }
Switch HDDVR_RECORD "TV Record" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=record&hold=keyPress:default]" }
Switch HDDVR_BACK "TV Back" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=back&hold=keyPress:default]" }
Switch HDDVR_INFO "TV INFO" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=info&hold=keyPress:default]" }
Switch HDDVR_SELECT "TV SELECT" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=select&hold=keyPress:default]" }
Switch HDDVR_UP "TV UP" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=up&hold=keyPress:default]" }
Switch HDDVR_DOWN "TV DOWN" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=down&hold=keyPress:default]" }
Switch HDDVR_ENTER "TV ENTER" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=enter&hold=keyPress:default]" }
Switch HDDVR_PAUSE "TV PAUSE" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=pause&hold=keyPress:default]" }
Switch HDDVR_PLAY "TV PLAY" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=play&hold=keyPress:default]" }
Switch HDDVR_CNN "TV CNN" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=202]" }
Switch HDDVR_MSNBC "TV MSNBC" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=356]" }
Switch HDDVR_NBC "TV NBC" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=004]" }
Switch HDDVR_ABC "TV ABC" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=007]" }
Switch HDDVR_CBS "TV CBS" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=009]" }
Switch HDDVR_SPIKE "TV SPIKE" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=241]" }
Switch HDDVR_USA "TV USA" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=242]" }
Switch HDDVR_SCI_FI "TV SCI FI" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=244]" }
Switch HDDVR_TNT "TV TNT" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=245]" }
Switch HDDVR_FX "TV FX" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=248]" }
Switch HDDVR_COMEDY "TV COMEDY" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=249]" }
Switch HDDVR_AMC "TV AMC" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=254]" }
Switch HDDVR_HGTV "TV HGTV" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=229]" }
Switch HDDVR_ION "TV ION" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=305]" }
Switch HDDVR_FOOD "TV FOOD NETWORK" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=231]" }


Switch GENIE_MINI_GUIDE "Cable Guide" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=guide&hold=keyPress&clientAddr=99F7C76B68BE:default]" }
Switch GENIE_MINI_RED "Cable Delete" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=red&hold=keyPress&clientAddr=99F7C76B68BE:default]" }
Switch GENIE_MINI_EXIT "Cable Exit" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=exit&hold=keyPress&clientAddr=99F7C76B68BE:default]" }
Switch GENIE_MINI_PREV "Cable Last Channel" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=prev&hold=keyPress&clientAddr=99F7C76B68BE:default]" }
Switch GENIE_MINI_MENU "Cable Menu" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=menu&hold=keyPress&clientAddr=99F7C76B68BE:default]" }
Switch GENIE_MINI_LIST "Cable List" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=list&hold=keyPress&clientAddr=99F7C76B68BE:default]" }
Switch GENIE_MINI_RECORD "Cable Record" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=record&hold=keyPress&clientAddr=99F7C76B68BE:default]" }
Switch GENIE_MINI_BACK "Cable Back" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=back&hold=keyPress&clientAddr=99F7C76B68BE:default]" }
Switch GENIE_MINI_INFO "Cable Info" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=info&hold=keyPress&clientAddr=99F7C76B68BE:default]" }
Switch GENIE_MINI_SELECT "Cable SELECT" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=select&hold=keyPress&clientAddr=99F7C76B68BE:default]" }
Switch GENIE_MINI_UP "Cable UP" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=up&hold=keyPress&clientAddr=99F7C76B68BE:default]" }
Switch GENIE_MINI_DOWN "Cable DOWN" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=down&hold=keyPress&clientAddr=99F7C76B68BE:default]" }
Switch GENIE_MINI_ENTER "Cable ENTER" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=enter&hold=keyPress&clientAddr=99F7C76B68BE:default]" }
Switch GENIE_MINI_PAUSE "Cable PAUSE" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=pause&hold=keyPress&clientAddr=99F7C76B68BE:default]" }
Switch GENIE_MINI_PLAY "Cable PLAY" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/remote/processKey?key=playr&hold=keyPress&clientAddr=99F7C76B68BE:default]" }
Switch GENIE_MINI_CNN "Cable CNN" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=202&clientAddr=99F7C76B68BE]" }
Switch GENIE_MINI_MSNBC "Cable MSNBC" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=356&clientAddr=99F7C76B68BE]" }
Switch GENIE_MINI_NBC "Cable NBC" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=004&clientAddr=99F7C76B68BE]" }
Switch GENIE_MINI_ABC "Cable ABC" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=007&clientAddr=99F7C76B68BE]" }
Switch GENIE_MINI_CBS "Cable CBS" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=009&clientAddr=99F7C76B68BE]" }
Switch GENIE_MINI_SPIKE "Cable SPIKE" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=241&clientAddr=99F7C76B68BE]" }
Switch GENIE_MINI_USA "Cable USA" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=242&clientAddr=99F7C76B68BE]" }
Switch GENIE_MINI_SCI_FI "Cable SCI FI" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=244&clientAddr=99F7C76B68BE]" }
Switch GENIE_MINI_TNT "Cable TNT" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=245&clientAddr=99F7C76B68BE]" }
Switch GENIE_MINI_FX "Cable FX" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=248&clientAddr=99F7C76B68BE]" }
Switch GENIE_MINI_COMEDY "Cable COMEDY" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=249&clientAddr=99F7C76B68BE]" }
Switch GENIE_MINI_AMC "Cable AMC" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=254&clientAddr=99F7C76B68BE]" }
Switch GENIE_MINI_HGTV "Cable HGTV" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=229&clientAddr=99F7C76B68BE]" }
Switch GENIE_MINI_ION "Cable ION" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=305&clientAddr=99F7C76B68BE]" }
Switch GENIE_MINI_FOOD "Cable FOOD NETWORK" <light> ["Lighting"] { http=">[*:GET:http://192.168.1.10:8080/tv/tune?major=231&clientAddr=99F7C76B68BE]" }

My Sitemap is:

       Frame label="DirecTV Genie - AKA - TV"{
               Switch item=HDDVR_GUIDE    label="TV Guide"
               Switch item=HDDVR_RED      label="TV Delete"
               Switch item=HDDVR_EXIT     label="TV Exit"
               Switch item=HDDVR_PREV     label="TV Last Channel"
               Switch item=HDDVR_EXIT     label="TV Menu"
               Switch item=HDDVR_RECORD   label="TV Record"
               Switch item=HDDVR_BACK     label="TV Back"
               Switch item=HDDVR_INFO     label="TV Info"
               Switch item=HDDVR_SELECT   label="TV SELECT"
               Switch item=HDDVR_UP       label="TV UP"
               Switch item=HDDVR_DOWN     label="TV DOWN"
               Switch item=HDDVR_ENTER    label="TV ENTER"
               Switch item=HDDVR_PAUSE    label="TV PAUSE"
               Switch item=HDDVR_PLAY     label="TV PLAY"
               Switch item=HDDVR_CNN      label="TV CNN"
               Switch item=HDDVR_MSNBC    label="TV MSNBC"
               Switch item=HDDVR_NBC      label="TV NBC"
               Switch item=HDDVR_ABC      label="TV ABC"
               Switch item=HDDVR_CBS      label="TV CBS"
               Switch item=HDDVR_SPIKE    label="TV SPIKE"
               Switch item=HDDVR_SCI_FI   label="TV SCI FI"
               Switch item=HDDVR_TNT      label="TV TNT"
               Switch item=HDDVR_FX       label="TV FX"
               Switch item=HDDVR_COMEDY   label="TV COMEDY"
               Switch item=HDDVR_AMC      label="TV AMC" 
               Switch item=HDDVR_HGTV     label="TV HGTV"
               Switch item=HDDVR_ION      label="TV ION"
               Switch item=HDDVR_FOOD     label="TV FOOD NETWORK"  
       }

       Frame label="Genie Mini - AKA - Cable"{
               Switch item=GENIE_MINI_GUIDE     label="Cable Guide"
               Switch item=GENIE_MINI_RED       label="Cable Delete"
               Switch item=GENIE_MINI_EXIT      label="Cable Exit"
               Switch item=GENIE_MINI_PREV      label="Cable Last Channel"
               Switch item=GENIE_MINI_MENU      label="Cable Menu"
               Switch item=GENIE_MINI_LIST      label="Cable List"
               Switch item=GENIE_MINI_RECORD    label="Cable Record"
               Switch item=GENIE_MINI_BACK      label="Cable Back"
               Switch item=GENIE_MINI_INFO      label="Cable Info"
               Switch item=GENIE_MINI_SELECT    label="Cable SELECT"
               Switch item=GENIE_MINI_UP        label="Cable UP"
               Switch item=GENIE_MINI_DOWN      label="Cable DOWN"
               Switch item=GENIE_MINI_ENTER     label="Cable ENTER"
               Switch item=GENIE_MINI_PAUSE     label="Cable PAUSE"
               Switch item=GENIE_MINI_PLAY      label="Cable PLAY"
               Switch item=GENIE_MINI_CNN       label="Cable CNN"
               Switch item=GENIE_MINI_MSNBC     label="Cable MSNBC"
               Switch item=GENIE_MINI_NBC       label="Cable NBC"
               Switch item=GENIE_MINI_ABC       label="Cable ABC"
               Switch item=GENIE_MINI_CBS       label="Cable CBS"
               Switch item=GENIE_MINI_SPIKE     label="Cable SPIKE"
               Switch item=GENIE_MINI_USA       label="Cable USA"
               Switch item=GENIE_MINI_SCI_FI    label="Cable SCI FI"
               Switch item=GENIE_MINI_TNT       label="Cable TNT"
               Switch item=GENIE_MINI_FX        label="Cable FX"
               Switch item=GENIE_MINI_COMEDY    label="Cable COMEDY"
               Switch item=GENIE_MINI_AMC       label="Cable AMC"
               Switch item=GENIE_MINI_HGTV      label="Cable HGTV"
               Switch item=GENIE_MINI_ION       label="Cable ION"
               Switch item=GENIE_MINI_FOOD      label="Cable FOOD NETWORK"   
       }

These items are discoverable by Alexa and voice commands work well.

Finally, I found that navigating the DirecTV Menu or List pages was tedious with a single up or down command. I would have to say, “Alexa, Turn On TV UP”, multiple times. So, I’m experiementing with rules that repeat commands. This isn’t pretty, so I’m open to more elegant solutions. I added the following to my Items file:

Switch Switch_forRule_2x_TV_Up_Command "2 TV UP" <light> ["Lighting"]
Switch Switch_forRule_3x_TV_Up_Command "3 TV UP" <light> ["Lighting"]
Switch Switch_forRule_4x_TV_Up_Command "4 TV UP" <light> ["Lighting"]
Switch Switch_forRule_5x_TV_Up_Command "5 TV UP" <light> ["Lighting"]
Switch Switch_forRule_2x_TV_DOWN_Command "2 TV DOWN" <light> ["Lighting"]
Switch Switch_forRule_3x_TV_DOWN_Command "3 TV DOWN" <light> ["Lighting"]
Switch Switch_forRule_4x_TV_DOWN_Command "4 TV DOWN" <light> ["Lighting"]
Switch Switch_forRule_5x_TV_DOWN_Command "5 TV DOWN" <light> ["Lighting"]

Switch Switch_forRule_2x_Cable_Up_Command "2 Cable UP" <light> ["Lighting"]
Switch Switch_forRule_3x_Cable_Up_Command "3 Cable UP" <light> ["Lighting"]
Switch Switch_forRule_4x_Cable_Up_Command "4 Cable UP" <light> ["Lighting"]
Switch Switch_forRule_5x_Cable_Up_Command "5 Cable UP" <light> ["Lighting"]
Switch Switch_forRule_2x_Cable_DOWN_Command "2 Cable DOWN" <light> ["Lighting"]
Switch Switch_forRule_3x_Cable_DOWN_Command "3 Cable DOWN" <light> ["Lighting"]
Switch Switch_forRule_4x_Cable_DOWN_Command "4 Cable DOWN" <light> ["Lighting"]
Switch Switch_forRule_5x_Cable_DOWN_Command "5 Cable DOWN" <light> ["Lighting"]

Then, the corresponding Sitemap additions are:

       Frame label="DirecTV Genie - AKA - TV"{
               Switch item=Switch_forRule_2x_TV_Up_Command   label="2 TV UP"
               Switch item=Switch_forRule_3x_TV_Up_Command   label="3 TV UP"
               Switch item=Switch_forRule_4x_TV_Up_Command   label="4 TV UP"
               Switch item=Switch_forRule_5x_TV_Up_Command   label="5 TV UP"
               Switch item=Switch_forRule_2x_TV_DOWN_Command label="2 TV DOWN"
               Switch item=Switch_forRule_3x_TV_DOWN_Command label="3 TV DOWN"
               Switch item=Switch_forRule_4x_TV_DOWN_Command label="4 TV DOWN"
               Switch item=Switch_forRule_5x_TV_DOWN_Command label="5 TV DOWN"
       }

       Frame label="Genie Mini - AKA - Cable"{
               Switch item=Switch_forRule_2x_Cable_Up_Command   label="2 Cable UP"
               Switch item=Switch_forRule_3x_Cable_Up_Command   label="3 Cable UP"
               Switch item=Switch_forRule_4x_Cable_Up_Command   label="4 Cable UP"
               Switch item=Switch_forRule_5x_Cable_Up_Command   label="5 Cable UP"
               Switch item=Switch_forRule_2x_Cable_DOWN_Command label="2 Cable DOWN"
               Switch item=Switch_forRule_3x_Cable_DOWN_Command label="3 Cable DOWN"
               Switch item=Switch_forRule_4x_Cable_DOWN_Command label="4 Cable DOWN"
               Switch item=Switch_forRule_5x_Cable_DOWN_Command label="5 Cable DOWN"

Now, for example, if I’m on the List page and I want to select a recorded program that is fifth from the top, I can say, “Alexa Turn On 5 TV Down”. DirecTV will highlight the fifth program and then I can say “Alexa Turn On TV Select”. Then DirecTV will play the recorded program.I added rules to move up or down between 1 and 5 steps. My rules file is shown below.

rule "2x_TV_Up"
when
    Item Switch_forRule_2x_TV_Up_Command received command

then
    if(receivedCommand == ON) {
       HDDVR_UP.sendCommand(ON)
       HDDVR_UP.sendCommand(ON)
    }
end

rule "3x_TV_Up"
when
    Item Switch_forRule_3x_TV_Up_Command received command

then
    if(receivedCommand == ON) {
       HDDVR_UP.sendCommand(ON)
       HDDVR_UP.sendCommand(ON)
       HDDVR_UP.sendCommand(ON)
    }
end

rule "4x_TV_Up"
when
    Item Switch_forRule_4x_TV_Up_Command received command

then
    if(receivedCommand == ON) {
       HDDVR_UP.sendCommand(ON)
       HDDVR_UP.sendCommand(ON)
       HDDVR_UP.sendCommand(ON)
       HDDVR_UP.sendCommand(ON)       
    }
end

rule "5x_TV_Up"
when
    Item Switch_forRule_5x_TV_Up_Command received command

then
    if(receivedCommand == ON) {
       HDDVR_UP.sendCommand(ON)
       HDDVR_UP.sendCommand(ON)
       HDDVR_UP.sendCommand(ON)
       HDDVR_UP.sendCommand(ON)
       HDDVR_UP.sendCommand(ON)
    }
end

rule "2x_TV_DOWN"
when
    Item Switch_forRule_2x_TV_DOWN_Command received command

then
    if(receivedCommand == ON) {
        HDDVR_DOWN.sendCommand(ON)
        HDDVR_DOWN.sendCommand(ON)
    }
end

rule "3x_TV_Up"
when
    Item Switch_forRule_3x_TV_DOWN_Command received command

then
    if(receivedCommand == ON) {
        HDDVR_DOWN.sendCommand(ON)
        HDDVR_DOWN.sendCommand(ON)
        HDDVR_DOWN.sendCommand(ON)
    }
end

rule "4x_TV_DOWN"
when
    Item Switch_forRule_4x_TV_DOWN_Command received command

then
    if(receivedCommand == ON) {
        HDDVR_DOWN.sendCommand(ON)
        HDDVR_DOWN.sendCommand(ON)
        HDDVR_DOWN.sendCommand(ON)
        HDDVR_DOWN.sendCommand(ON)
    }
end

rule "5x_TV_Down"
when
    Item Switch_forRule_5x_TV_DOWN_Command received command

then
    if(receivedCommand == ON) {
        HDDVR_DOWN.sendCommand(ON)
        HDDVR_DOWN.sendCommand(ON)
        HDDVR_DOWN.sendCommand(ON)
        HDDVR_DOWN.sendCommand(ON)
        HDDVR_DOWN.sendCommand(ON)
    }
end

rule "2x_Cable_Up"
when
    Item Switch_forRule_2x_Cable_Up_Command received command

then
    if(receivedCommand == ON) {
        GENIE_MINI_UP.sendCommand(ON)
        GENIE_MINI_UP.sendCommand(ON)
    }
end

rule "3x_Cable_Up"
when
    Item Switch_forRule_3x_Cable_Up_Command received command

then
    if(receivedCommand == ON) {
        GENIE_MINI_UP.sendCommand(ON)
        GENIE_MINI_UP.sendCommand(ON)
        GENIE_MINI_UP.sendCommand(ON)
    }
end

rule "4x_Cable_Up"
when
    Item Switch_forRule_4x_Cable_Up_Command received command

then
    if(receivedCommand == ON) {
        GENIE_MINI_UP.sendCommand(ON)
        GENIE_MINI_UP.sendCommand(ON)
        GENIE_MINI_UP.sendCommand(ON)
        GENIE_MINI_UP.sendCommand(ON)
    }
end

rule "5x_Cable_Up"
when
    Item Switch_forRule_5x_Cable_Up_Command received command

then
    if(receivedCommand == ON) {
        GENIE_MINI_UP.sendCommand(ON)
        GENIE_MINI_UP.sendCommand(ON)
        GENIE_MINI_UP.sendCommand(ON)
        GENIE_MINI_UP.sendCommand(ON)
        GENIE_MINI_UP.sendCommand(ON)
    }
end

rule "2x_Cable_DOWN"
when
    Item Switch_forRule_2x_Cable_DOWN_Command received command

then
    if(receivedCommand == ON) {
        GENIE_MINI_DOWN.sendCommand(ON)
        GENIE_MINI_DOWN.sendCommand(ON)
    }
end

rule "3x_Cable_DOWN"
when
    Item Switch_forRule_3x_Cable_DOWN_Command received command

then
    if(receivedCommand == ON) {
        GENIE_MINI_DOWN.sendCommand(ON)
        GENIE_MINI_DOWN.sendCommand(ON)
        GENIE_MINI_DOWN.sendCommand(ON)
    }
end

rule "4x_Cable_DOWN"
when
    Item Switch_forRule_4x_Cable_DOWN_Command received command

then
    if(receivedCommand == ON) {
        GENIE_MINI_DOWN.sendCommand(ON)
        GENIE_MINI_DOWN.sendCommand(ON)
        GENIE_MINI_DOWN.sendCommand(ON)
        GENIE_MINI_DOWN.sendCommand(ON)
    }
end

rule "5x_Cable_DOWN"
when
    Item Switch_forRule_5x_Cable_DOWN_Command received command

then
    if(receivedCommand == ON) {
        GENIE_MINI_DOWN.sendCommand(ON)
        GENIE_MINI_DOWN.sendCommand(ON)
        GENIE_MINI_DOWN.sendCommand(ON)
        GENIE_MINI_DOWN.sendCommand(ON)
        GENIE_MINI_DOWN.sendCommand(ON)
  }
end
3 Likes