Kodi Community Forum

Full Version: Keymaps and JSON RPC?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey all,

I'm currently using openelec, and I'm doing some fancy stuff so I can trigger `irsend` from my wii mote. So my keymap looks like this:

Code:
<?xml version="1.0" encoding="utf-8"?>
<keymap>
    <global>
        <remote>
            <volumeplus>
                XBMC.RunScript(/storage/configfiles/lirc/sendIr.py, Panasonic/VolumeUp)
            </volumeplus>
            <volumeminus>
                XBMC.RunScript(/storage/configfiles/lirc/sendIr.py, Panasonic/VolumeDown)
            </volumeminus>
            <home>
                XBMC.RunScript(/storage/configfiles/lirc/sendIr.py, Panasonic/Power)
            </home>
        </remote>
        <keyboard>
            <key id="166">
                XBMC.RunScript(/storage/configfiles/lirc/sendIr.py, up)
            </key>
            <key id="167">
                XBMC.RunScript(/storage/configfiles/lirc/sendIr.py, down)
            </key>
            <key id="169">
                XBMC.RunScript(/storage/configfiles/lirc/sendIr.py, left)
            </key>
            <key id="168">
                XBMC.RunScript(/storage/configfiles/lirc/sendIr.py, right)
            </key>
            <key id="211">
                XBMC.RunScript(/storage/configfiles/lirc/sendIr.py, select)
            </key>
            <key id="216">
                XBMC.RunScript(/storage/configfiles/lirc/sendIr.py, back)
            </key>
            <key id="37">
                XBMC.RunScript(/storage/configfiles/lirc/sendIr.py, Panasonic/Power)
            </key>
            <home>
                XBMC.RunScript(/storage/configfiles/lirc/sendIr.py, Panasonic/Power)
            </home>
            <key id="210">
                XBMC.RunScript(/storage/configfiles/lirc/sendIr.py, Panasonic/InputDTV)
            </key>
            <key id="211">
                XBMC.RunScript(/storage/configfiles/lirc/sendIr.py, Panasonic/InputKodi)
            </key>
        </keyboard>
    </global>
</keymap>

This is all fine and working well. Now, I would like to trigger these same keys via the JSON RPC api.

I've tried a bunch of combinations and I can't figure it out.

Suppose I wanted to send volumeplus, i've tried
Code:
http://192.168.1.85/jsonrpc?request={"jsonrpc":"2.0","method":"Input.ExecuteAction","params":{"action":"volumeplus"},"id":1}
but volumeplus is not valid param
Also, what if I wanted to send the code behind key id="37"?


I've read the forums and as I understand it, key codes can't be triggered via JSON RPC, but keymaps are the recommended approach. So how does that work? Would I have an xml entry like

Code:
<keymap>
    <global>
        <JSON_RPC??>
            <home>
                XBMC.RunScript(/storage/configfiles/lirc/sendIr.py, Panasonic/Power)
            </home>
        </JSON_RPC> ...

Then I send the home param to Input.ExecuteAction?

Thanks for any and all help on this Big Grin
Long time asking Smile

And official answer is : Not supported and won't be supported because we do not want this, triggering functions without predictable action is bad.

Let's hope one day, discussion is open again.

You can achieve that from Event Server.
Yea thats a shame.. there's obviously a need because there are a ton of threads for this.

Anyways, I worked around it by running a separate web server as a proxy