We have moved at community.getvera.com

Author Topic: DirecTV Plug-in C31 Clients  (Read 6563 times)

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
DirecTV Plug-in C31 Clients
« on: November 19, 2013, 01:13:03 pm »
I was able to successfully control my Genie HR34 unit via it's IP using the plug-in. However, my question is in regards to the C31 clients. I discovered that the clients actually have an assigned IP address but perhaps their not API capable. Just looking to see if anyone has any knowledge they can share.

Also, does anyone use LUUP code to control their main unit ? I can't seem to find the correct syntax for DiscretePower1 and NumericEntry1.. Samples would be great

Thanks in advance
openLuup, AltUI, Zway and HomeWave, enough said...

Offline strangely

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3722
  • Karma: +34/-2
  • Vera 1,3 & V light
Re: DirecTV Plug-in C31 Clients
« Reply #1 on: November 19, 2013, 01:42:19 pm »
Not sure of the syntax at the moment, but you do know that if you use the advanced tab of a scene, you can control it all from there?

For the SHEF commands with RVU clients, you might want to ask that question on dbstalk.com
Kwickset locks, HA01C, HA14C, HA02C, HA03C, HA05C, HA04C, HA07C, HA09C, Aeon HEM, GE 45604, 45606, 45609, ZDP100, VRF01-1LZ, WDTC-20, HA18WD, WDHA-12R, HRDS1, HM-TS001, AC1-ZW, TV-IP110, BL-C210A, LUUP control- EtherRain8, DSC Alarm, HDMI matrix, HR24-200, Panasonic TV, SQblaster

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: DirecTV Plug-in C31 Clients
« Reply #2 on: November 19, 2013, 03:29:36 pm »
I've been using the Advanced tab with success, just wanted to see if I could reduce the number of scenes. AH yes, RVU... I'll check on the DBS forum and see if there's any information there.

Thanks

Not sure of the syntax at the moment, but you do know that if you use the advanced tab of a scene, you can control it all from there?

For the SHEF commands with RVU clients, you might want to ask that question on dbstalk.com
openLuup, AltUI, Zway and HomeWave, enough said...

Offline strangely

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3722
  • Karma: +34/-2
  • Vera 1,3 & V light
Re: DirecTV Plug-in C31 Clients
« Reply #3 on: November 19, 2013, 04:58:04 pm »
I'll have a go later and try and work out the code.
Kwickset locks, HA01C, HA14C, HA02C, HA03C, HA05C, HA04C, HA07C, HA09C, Aeon HEM, GE 45604, 45606, 45609, ZDP100, VRF01-1LZ, WDTC-20, HA18WD, WDHA-12R, HRDS1, HM-TS001, AC1-ZW, TV-IP110, BL-C210A, LUUP control- EtherRain8, DSC Alarm, HDMI matrix, HR24-200, Panasonic TV, SQblaster

Offline strangely

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3722
  • Karma: +34/-2
  • Vera 1,3 & V light
Re: DirecTV Plug-in C31 Clients
« Reply #4 on: November 19, 2013, 10:14:28 pm »
@CudaNet,

The code for On would be:

Code: [Select]
luup.call_action("urn:micasaverde-com:serviceId:DiscretePower1","On",{},XX)
The Code for Off would be:

Code: [Select]
luup.call_action("urn:micasaverde-com:serviceId:DiscretePower1","Off",{},XX)
You just need to replace the XX at the end with the device ID of DirecTV plugin.

NumericEntry1 should just be:

Code: [Select]
luup.call_action("urn:micasaverde-com:serviceId:NumericEntry1","1",{},XX)
Again replace XX and also the numeric value before it for the applicable channel. The above is for Channel 1, but bear in mind, you will need to use additional lines for multiple digits. For Channel 12 you you would repeat it with something like this:

Code: [Select]
luup.call_action("urn:micasaverde-com:serviceId:NumericEntry1","1",{},XX)
luup.call_action("urn:micasaverde-com:serviceId:NumericEntry1","2",{},XX)
« Last Edit: November 19, 2013, 10:25:42 pm by strangely »
Kwickset locks, HA01C, HA14C, HA02C, HA03C, HA05C, HA04C, HA07C, HA09C, Aeon HEM, GE 45604, 45606, 45609, ZDP100, VRF01-1LZ, WDTC-20, HA18WD, WDHA-12R, HRDS1, HM-TS001, AC1-ZW, TV-IP110, BL-C210A, LUUP control- EtherRain8, DSC Alarm, HDMI matrix, HR24-200, Panasonic TV, SQblaster

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: DirecTV Plug-in C31 Clients
« Reply #5 on: November 19, 2013, 10:25:55 pm »
Strangely,

Thanks so much for getting this information, this definitely helps...


@CudaNet,

The code for On would be:

Code: [Select]
luup.call_action("urn:micasaverde-com:serviceId:DiscretePower1","On",{},XX)
The Code for Off would be:

Code: [Select]
luup.call_action("urn:micasaverde-com:serviceId:DiscretePower1","Off",{},XX)
You just need to replace the XX at the end with the device ID of DirecTV plugin.

NumericEntry1 should just be:

Code: [Select]
luup.call_action("urn:micasaverde-com:serviceId:NumericEntry1","1",{},XX
Again replace XX and also the numeric value before it for the applicable channel. The above is for Channel 1, but bear in mind with the above, you will need to use additional lines for multiple digits so for Channel 12 you you would repeat it with something like this:

Code: [Select]
luup.call_action("urn:micasaverde-com:serviceId:NumericEntry1","1",{},XX
luup.call_action("urn:micasaverde-com:serviceId:NumericEntry1","2",{},XX
openLuup, AltUI, Zway and HomeWave, enough said...

Offline strangely

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3722
  • Karma: +34/-2
  • Vera 1,3 & V light
Re: DirecTV Plug-in C31 Clients
« Reply #6 on: November 19, 2013, 11:17:15 pm »
No Problem!

By the way, I edited the examples since I missed a couple of the closing brackets.
Kwickset locks, HA01C, HA14C, HA02C, HA03C, HA05C, HA04C, HA07C, HA09C, Aeon HEM, GE 45604, 45606, 45609, ZDP100, VRF01-1LZ, WDTC-20, HA18WD, WDHA-12R, HRDS1, HM-TS001, AC1-ZW, TV-IP110, BL-C210A, LUUP control- EtherRain8, DSC Alarm, HDMI matrix, HR24-200, Panasonic TV, SQblaster

Offline strangely

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3722
  • Karma: +34/-2
  • Vera 1,3 & V light
Re: DirecTV Plug-in C31 Clients
« Reply #7 on: November 19, 2013, 11:31:50 pm »
I was able to successfully control my Genie HR34 unit via it's IP using the plug-in. However, my question is in regards to the C31 clients. I discovered that the clients actually have an assigned IP address but perhaps their not API capable. Just looking to see if anyone has any knowledge they can share.

Looking at the following link, control of RVU clients or the C31 boxes in particular do seem to be supported by the SHEF API, it would just need to be supported by the plugin.

http://support.iruleathome.com/customer/portal/questions/659934-directv-genie-hr34-and-client-c31-control
Kwickset locks, HA01C, HA14C, HA02C, HA03C, HA05C, HA04C, HA07C, HA09C, Aeon HEM, GE 45604, 45606, 45609, ZDP100, VRF01-1LZ, WDTC-20, HA18WD, WDHA-12R, HRDS1, HM-TS001, AC1-ZW, TV-IP110, BL-C210A, LUUP control- EtherRain8, DSC Alarm, HDMI matrix, HR24-200, Panasonic TV, SQblaster

Offline strangely

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3722
  • Karma: +34/-2
  • Vera 1,3 & V light
Re: DirecTV Plug-in C31 Clients
« Reply #8 on: November 21, 2013, 12:46:22 am »
As a follow up to this, I was testing this myself with a scene to Open Pandora directly, and my HR44 can handle multiple inputs in a row, however my older HR24 needs some delays between each command to avoid them being missed.

Not sure of the cleanest way to do this (sure its very hacky), but I found using os.execute("sleep 2") between each command works.

Here's how Pandora looks:

Code: [Select]
luup.call_action("urn:micasaverde-com:serviceId:DiscretePower1","On",{},254)
os.execute("sleep 2")
luup.call_action("urn:micasaverde-com:serviceId:MenuNavigation1","Menu",{},254)
os.execute("sleep 2")
luup.call_action("urn:micasaverde-com:serviceId:MenuNavigation1","Down",{},254)
os.execute("sleep 2")
luup.call_action("urn:micasaverde-com:serviceId:MenuNavigation1","Down",{},254)
os.execute("sleep 2")
luup.call_action("urn:micasaverde-com:serviceId:MenuNavigation1","Down",{},254)
os.execute("sleep 2")
luup.call_action("urn:micasaverde-com:serviceId:MenuNavigation1","Right",{},254)
os.execute("sleep 2")
luup.call_action("urn:micasaverde-com:serviceId:MenuNavigation1","Right",{},254)
os.execute("sleep 2")
luup.call_action("urn:micasaverde-com:serviceId:MenuNavigation1","Right",{},254)
os.execute("sleep 2")
luup.call_action("urn:micasaverde-com:serviceId:MenuNavigation1","Down",{},254)
os.execute("sleep 2")
luup.call_action("urn:micasaverde-com:serviceId:MenuNavigation1","Select",{},254)
« Last Edit: November 21, 2013, 03:04:10 am by strangely »
Kwickset locks, HA01C, HA14C, HA02C, HA03C, HA05C, HA04C, HA07C, HA09C, Aeon HEM, GE 45604, 45606, 45609, ZDP100, VRF01-1LZ, WDTC-20, HA18WD, WDHA-12R, HRDS1, HM-TS001, AC1-ZW, TV-IP110, BL-C210A, LUUP control- EtherRain8, DSC Alarm, HDMI matrix, HR24-200, Panasonic TV, SQblaster

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: DirecTV Plug-in C31 Clients
« Reply #9 on: November 21, 2013, 04:35:34 pm »
Again, good stuff - this definitely helps. I'll have to test multiples against the H34 when I get some time, I'll report my findings on this thread. Honestly, I need to spend some time thinking about how to best use this DirecTV plug-in. I can see why it's driven by scenes and or LUUP code rather than the device itself however it would be nice if the device reported if the unit was powered on or off (something that might be achieved via a virtual and LUUP code polling the unit).

As a follow up to this, I was testing this myself with a scene to Open Pandora directly, and my HR44 can handle multiple inputs in a row, however my older HR24 needs some delays between each command to avoid them being missed.

Not sure of the cleanest way to do this (sure its very hacky), but I found using os.execute("sleep 2") between each command works.

Here's how Pandora looks:

Code: [Select]
luup.call_action("urn:micasaverde-com:serviceId:DiscretePower1","On",{},254)
os.execute("sleep 2")
luup.call_action("urn:micasaverde-com:serviceId:MenuNavigation1","Menu",{},254)
os.execute("sleep 2")
luup.call_action("urn:micasaverde-com:serviceId:MenuNavigation1","Down",{},254)
os.execute("sleep 2")
luup.call_action("urn:micasaverde-com:serviceId:MenuNavigation1","Down",{},254)
os.execute("sleep 2")
luup.call_action("urn:micasaverde-com:serviceId:MenuNavigation1","Down",{},254)
os.execute("sleep 2")
luup.call_action("urn:micasaverde-com:serviceId:MenuNavigation1","Right",{},254)
os.execute("sleep 2")
luup.call_action("urn:micasaverde-com:serviceId:MenuNavigation1","Right",{},254)
os.execute("sleep 2")
luup.call_action("urn:micasaverde-com:serviceId:MenuNavigation1","Right",{},254)
os.execute("sleep 2")
luup.call_action("urn:micasaverde-com:serviceId:MenuNavigation1","Down",{},254)
os.execute("sleep 2")
luup.call_action("urn:micasaverde-com:serviceId:MenuNavigation1","Select",{},254)
openLuup, AltUI, Zway and HomeWave, enough said...

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: DirecTV Plug-in C31 Clients
« Reply #10 on: December 04, 2013, 02:27:26 pm »
Well it appears that SHEF works extremely well on my HR34 but I haven't figured out how/why I can't control the clients (2x C31's). Alternating the parameter [clientAddr=] does nothing (0=server) and addressing them via their IP just causes a timeout (when posted in a browser window). Keep in mind I'm not spending as much time as I should but if anyone else is playing around, here is a link to the 'Command Set' and a few code snippets. I'll continue to work on this when I get time and post what I find out.

Link:
http://www.satinstalltraining.com/homeautomation/DTV-MD-0359-DIRECTV_SHEF_Command_Set-V1.3.C.pdf

And here is a simple line which executes a channel change to '281' (Vehicle TV):
Code: [Select]
luup.inet.wget("http://ipAddress:8080/tv/tune?major=281&clientAddr=0", 5)
And if you want to know what's currently playing:
Code: [Select]
luup.inet.wget("http://ipAddress:8080/tv/getTuned?&clientAddr=0", 5)
Returns the following:
Code: [Select]
{
  "callsign": "VEL",
  "date": "20130913",
  "duration": 1800,
  "isOffAir": false,
  "isPclocked": 3,
  "isPpv": false,
  "isRecording": false,
  "isVod": false,
  "major": 281,
  "minor": 65535,
  "offset": 2624,
  "programId": "10901693",
  "rating": "TV-G",
  "startTime": 1386079200,
  "stationId": 4345215,
  "status": {
    "code": 200,
    "commandResult": 0,
    "msg": "OK.",
    "query": "/tv/getTuned?clientAddr=0"
  },
  "title": "MotorWeek"
}

openLuup, AltUI, Zway and HomeWave, enough said...

Offline strangely

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3722
  • Karma: +34/-2
  • Vera 1,3 & V light
Re: DirecTV Plug-in C31 Clients
« Reply #11 on: December 04, 2013, 02:36:42 pm »
I believe the plugin would need to be updated to include client control, and it would likely need some child devices added for those clients.
Kwickset locks, HA01C, HA14C, HA02C, HA03C, HA05C, HA04C, HA07C, HA09C, Aeon HEM, GE 45604, 45606, 45609, ZDP100, VRF01-1LZ, WDTC-20, HA18WD, WDHA-12R, HRDS1, HM-TS001, AC1-ZW, TV-IP110, BL-C210A, LUUP control- EtherRain8, DSC Alarm, HDMI matrix, HR24-200, Panasonic TV, SQblaster

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: DirecTV Plug-in C31 Clients
« Reply #12 on: December 04, 2013, 03:41:24 pm »
Yes, agreed.
It also appears the clients need to be addressed via there MAC address (no colon separators). So basically the command is issued to the server who pushes the request to the client. I'll test tonight ...

I believe the plugin would need to be updated to include client control, and it would likely need some child devices added for those clients.
openLuup, AltUI, Zway and HomeWave, enough said...

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: DirecTV Plug-in C31 Clients
« Reply #13 on: December 05, 2013, 11:45:34 am »
So it appears addressing the clients via MAC works but must be performed directly (ipAddress) to the main receiver. The 'clientAddr=' must contain the MAC address in all caps (no colon separator) of the client you intend on controlling. One must also keep in mind that SHEF is single threaded (good to know).

Code sample:
Code: [Select]
luup.inet.wget("http://ipAddress:8080/tv/tune?major=281&clientAddr=A1B2C3D4E5F6", 5)
Doing so returned the following result:
Code: [Select]
{"status": {
  "code": 200,
  "commandResult": 0,
  "msg": "OK.",
  "query": "/tv/tune?major=281&clientAddr=A1B2C3D4E5F6"
}}
openLuup, AltUI, Zway and HomeWave, enough said...