PVR - Previous Channel
#1
Is there a way to send a json command to the PVR of previous channel? I know that pressing 0 on the keyboard will do previous channel, I tried sending
{"jsonrpc":"2.0","method":"Input.SendText","params": {"text": "0", "done":false},"id":1}
and I got
{"id":1,"jsonrpc":"2.0","result":"OK"}

but I didn't get the previous channel. Searching around appeared to explain the the sendtext puts text in the OS keyboard, not emulation the physical keyboard.

Kodi is translating the keystroke to the command, wondering if there's a json way to do it.
Reply
#2
I was able to get this to work. I wrote an addon that will run a script. The script runs xdotool which in turn does the sending of the key. I then used JSON to initiate the addon with the key I want to send.
Reply
#3
Good, if you want a pure JSON-RPC solution you could also try:

Code:
{"jsonrpc":"2.0","method":"Input.ExecuteAction","id":884484246,"params":{"action":"number0"}}
Reply
#4
Thanks I'll give that a try.
Reply
#5
That worked and it is so much simpler. Is there any documentation on this?
Reply
#6
Yep, not updated with the latest changes but it's a good start point:

http://kodi.wiki/view/JSON-RPC_API/v6

Anyway, you can see all the current services description by issuing JSONRPC Introspect:

Code:
{"jsonrpc":"2.0","method":"JSONRPC.Introspect","id":-269769921,"params":{}}
Reply
#7
(2017-08-28, 10:49)joethefox Wrote: Good, if you want a pure JSON-RPC solution you could also try:
Code:
{"jsonrpc":"2.0","method":"Input.ExecuteAction","id":884484246,"params":{"action":"number0"}}
 Thank you for this... I was pulling my hair out Smile
Reply
#8
(2017-08-28, 10:49)joethefox Wrote: Good, if you want a pure JSON-RPC solution you could also try:
Code:
{"jsonrpc":"2.0","method":"Input.ExecuteAction","id":884484246,"params":{"action":"number0"}}

Hello, I just tried this command but I get error
Code:
error
code-32099
message"Bad client permission."
id884484246
jsonrpc"2.0"

Whis is that? I can run other JSON commands like this {"jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1} without any problems
Reply
#9
Reply
#10
Reply

Logout Mark Read Team Forum Stats Members Help
PVR - Previous Channel0