How does the Advanced HTTP option work in the Volume Plugin?

Most network-enabled devices allow control by posting data to them.  This is where the Advanced HTTP option comes in!  With this option you stand a very good chance of being able to control your device without having to wait for me to get around to it.  With a little Googling, you may be able to find sample POST or GET commands that allow you to control your device.  If you do, be sure to send me an email through the button in the app so that I can add built-in support so that others can control that device brand as well!n nFor an example, I will include a real sample of how to control a Panasonic VIERA television.  This has already been added to the Volume Plugin as a built-in supported device but it will help demonstrate how you would use the advanced HTTP option.n nHere is the POST data that needs to be submitted to the device in order to send the mute command:n

POST /nrc/control_0 HTTP/1.1User-Agent: Panasonic iOS VR-CP UPnP/2.0Host: 10.0.1.155:55000Content-Type: text/xml; charset="utf-8"SOAPACTION: "urn:panasonic-com:service:p00NetworkControl:1#X_SendKey"Content-Length: 331      NRC_MUTE-ONOFF   

nIn the Plugin app, you would do the following:n1) Set the IP address to the actual IP address of your television.  It is recommended that you use a static IP address or DHCP reservation so that the address will never change.  If that happens, you will need to change that setting in the plugin app.  The sample above shows the address as 10.0.1.155 with a port of 55000.  Your address will likely be different, but the port should be the same.n2) Edit the commands for each button in the plugin that are available on the device.  For example, for the Mute button you would enter NRC_MUTE-ONOFF.  Not all commands are available for all devices.  The plugin detects which commands are available and tries to act accordingly when you try pressing buttons in the main app.n3) Press on the ‘Set Header/Body” button in the upper-right corner of the Commands screen.  This is where you enter the POST data.nFor the header, you would enter the following into the app:n

POST /nrc/control_0 HTTP/1.1User-Agent: Panasonic iOS VR-CP UPnP/2.0Host: $IP$:$PORT$Content-Type: text/xml; charset="utf-8"SOAPACTION: "urn:panasonic-com:service:p00NetworkControl:1#X_SendKey"Content-Length: $LENGTH$

n nFor the body, you would enter the following into the app:n

      $COMMAND$   

n nIf you are following along, you will see that we pretty much entered the original elements except that we replaced a few things with variables.  This will allow the POST data to change itself depending on which buttons you press in the app.nIn the headers:nWe replaced the original IP address and port (10.0.1.155:55000) with $IP$:$PORT$nWe replaced the original Content-Length (331) with $LENGTH$nIn the body:nWe replaced the original command (NRC_MUTE-ONOFF) with $COMMAND$n nHopefully this helps give you an idea of how this option works.  It really can allow you to add support for your own device but it will take some Googling and some patience.  If you have problems, feel free to send me an email with a link to the information you have found.  I will either try to help you get it working and/or just add built-in support for it to the plugin app so that others can use it as well.

Did you find this FAQ helpful?
Thumbs Up Icon 0
Thumbs Down Icon 0

Leave a Comment

Copying content from this page is strictly forbidden without explicit consent from the site owner