Solved How to control a Pioneer VSX via telnet with the Kodi remote control
#1
Lightbulb 
Hi!

I'm trying to integrate my HTPC (Asrock N3150) with my AVR, (VSX-930).

To control it, I’m using a Flirc receiver with Xbox One Media remote, so the configuration was really easy to do in terms of controlling the interactions with the Kodi menu.

My problem is now with the volume and mute. What I want is, with the same remote, control the volume on my VSX. I guess the normal solution would be HDMI CEC, but this board doesn’t have it.

As a workaround, I know that I can control my VSX via Telnet (by sending VD to the VSX_IPTongueort, I’m able to increase the volume).

Now, my question. Is there any way to do this actions with Kodi? If I can associate that action (Send VD via telnet to VSX_IPTongueort) to a physical key, I could afterwards associate that key with my Xbox One remote. At the end, the final result would be with the same remote control the HTPC and the AVR.

Is this possible? Any other workaround?

Thanks!!

EDIT1:
Well, thanks to faugusztin for the hints, I finally have this working as I wanted to.

Basically, I have an infrared remote control (Xbox One) which I previously mapped properly. (I use Flirc)

The volume UP/Down and Mute, has been also mapped to three different keys. Once one of this keys is pressed, it runs a little Python script to send a command via Telnet to the Pioneer VSX.

So, first I created three scripts:

Code:
import getpass
import sys
import telnetlib


tn = telnetlib.Telnet("192.168.1.44",8102)

tn.write("VU\n\r")

tn.close()

8102 is the default control port.

The other scripts are the same, just changing the VU (Volume Up) for VD (Volume Down) and MZ (Mute). The full list can easily be found in Google. Smile

I save them in /home/kodi/Scripts with the names volume_down.py, volume_up.py and mute.py

Then, I created a keyboard.xml file in ~/.kodi/userdata/keymaps with the following:

Code:
<keymap>
    <global>
        <keyboard>
            <F5>RunScript(/home/kodi/Scripts/volume_down.py)</F5>
            <F6>RunScript(/home/kodi/Scripts/mute.py)</F6>
            <F7>RunScript(/home/kodi/Scripts/volume_up.py)</F7>
        </keyboard>
    </global>
</keymap>

So the volume up is F7, down F6 and mute F5.

I just had to map again this three buttons in my remote to emulate this keys and that's it. Big Grin
Reply
#2
For CEC you could use https://www.pulse-eight.com/p/104/usb-hdmi-cec-adapter . Unfortunately i think you would have to use the AVR remote. That would be my solution, but then i am lazy enough to go the easy route Big Grin.
Reply
#3
Thanks for the hint! I’ll take a look at it.

Anyway, and taking in consideration that the AVR can be controlled via Telnet, I’d prefer to find a solution rather than buying extra hardware.

Actually, I am able to control it from a telnet terminal. I just want to trigger that action with a key from Kodi and then map that key into my remote.
Reply
#4
Use the RunScript to run a python script on keypress, via keymap ?

http://kodi.wiki/view/List_of_built-in_functions
RunScript(script[,args]*) Runs the python script. You must specify the full path to the script. One way to specify the full path is through the special protocol. If the script is an add-on, you can also execute it using its add-on id. As of 2007/02/24, all extra parameters are passed to the script as arguments and can be accessed by python using sys.argv

Example (see EDIT5) :
https://www.reddit.com/r/xbmc/comments/3..._built_in/
Reply
#5
Yes!! That's it! I have it working like a charm!

Thanks a lot!!! I will update the first post with the HOW just in case someone is looking for the same solution. Wink
Reply
#6
You could have it made a bit more universal by using parameters and one script. But that is a minor detail.
Reply
#7
(2016-05-13, 12:21)norickabe28 Wrote: Hi!

I'm trying to integrate my HTPC (Asrock N3150) with my AVR, (VSX-930).

To control it, I’m using a Flirc receiver with Xbox One Media remote, so the configuration was really easy to do in terms of controlling the interactions with the Kodi menu.

My problem is now with the volume and mute. What I want is, with the same remote, control the volume on my VSX. I guess the normal solution would be HDMI CEC, but this board doesn’t have it.

As a workaround, I know that I can control my VSX via Telnet (by sending VD to the VSX_IPTongueort, I’m able to increase the volume).

Now, my question. Is there any way to do this actions with Kodi? If I can associate that action (Send VD via telnet to VSX_IPTongueort) to a physical key, I could afterwards associate that key with my Xbox One remote. At the end, the final result would be with the same remote control the HTPC and the AVR.

Is this possible? Any other workaround?

Thanks!!

EDIT1:
Well, thanks to faugusztin for the hints, I finally have this working as I wanted to.

Basically, I have an infrared remote control (Xbox One) which I previously mapped properly. (I use Flirc)

The volume UP/Down and Mute, has been also mapped to three different keys. Once one of this keys is pressed, it runs a little Python script to send a command via Telnet to the Pioneer VSX.

So, first I created three scripts:

Code:
import getpass
import sys
import telnetlib


tn = telnetlib.Telnet("192.168.1.44",8102)

tn.write("VU\n\r")

tn.close()

8102 is the default control port.

The other scripts are the same, just changing the VU (Volume Up) for VD (Volume Down) and MZ (Mute). The full list can easily be found in Google. Smile

I save them in /home/kodi/Scripts with the names volume_down.py, volume_up.py and mute.py

Then, I created a keyboard.xml file in ~/.kodi/userdata/keymaps with the following:

Code:
<keymap>
    <global>
        <keyboard>
            <F5>RunScript(/home/kodi/Scripts/volume_down.py)</F5>
            <F6>RunScript(/home/kodi/Scripts/mute.py)</F6>
            <F7>RunScript(/home/kodi/Scripts/volume_up.py)</F7>
        </keyboard>
    </global>
</keymap>

So the volume up is F7, down F6 and mute F5.

I just had to map again this three buttons in my remote to emulate this keys and that's it. Big Grin

Oh thanks for this it worked great with eventghost python script. I dont know much about python and After a month of scratching my brain. I read your post and everything works
Reply

Logout Mark Read Team Forum Stats Members Help
How to control a Pioneer VSX via telnet with the Kodi remote control0