Kodi Community Forum

Full Version: PVR - Previous Channel
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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.
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"}}
Thanks I'll give that a try.
That worked and it is so much simpler. Is there any documentation on this?
Yep, not updated with the latest changes but it's a good start point:

JSON-RPC_API/v6 (wiki)

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

Code:
{"jsonrpc":"2.0","method":"JSONRPC.Introspect","id":-269769921,"params":{}}
(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
(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
(2019-08-27, 10:11)LordSlash Wrote: [ -> ]
(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 

I read that the Bad Client permission is due to the HTTP Get. I did an HTTP Post via curl but I get a parse error code:

(2019-08-27, 11:43)LordSlash Wrote: [ -> ]
(2019-08-27, 10:11)LordSlash Wrote: [ -> ]
(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  

I read that the Bad Client permission is due to the HTTP Get. I did an HTTP Post via curl but I get a parse error code:

 

Ok I got the right code, but it just toggles between the last two used channels. I am looking for the ChannelUP and ChannelDown JSON code, anyone knows it? Thank you so much!