# Controlling Kodi

**URL:** https://discourse.nodered.org/t/controlling-kodi/47041
**Category:** General
**Created:** [11 June 2021 15:41 UTC](https://discourse.nodered.org/t/controlling-kodi/47041 "2021-06-11T15:41:07Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![alexander77](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@alexander77](https://discourse.nodered.org/u/alexander77)
#### Post date: [11 June 2021 15:41 UTC](https://discourse.nodered.org/t/controlling-kodi/47041/1 "2021-06-11T15:41:08Z")

</div>

I did some searching to find out how to control Kodi.  
I can start audioplaylists with the help of a function containing  
return {  
payload:  
{  
"cmd":"Player.Open",  
"args":{  
"item":{  
"file": "C:/Users/Kodi/AppData/Roaming/Kodi/userdata/playlists/music/playlist1.m3u"  
}

```
        }
    }

```

};  
(Windows file system).  
I can control play/pause by configuring a koni-node, placing  
{"jsonrpc": "2.0", "method": "Player.PlayPause", "params": { "playerid": 1 }, "id": 1}  
in the command line of the node.

I was happy and tried more.  
Usind this description  
[https://kodi.wiki/view/JSON-RPC\_API/v12#Player.PlayPause](https://kodi.wiki/view/JSON-RPC_API/v12#Player.PlayPause)  
i tried to turn on and off repeat and shuffle, trying it with  
{"jsonrpc": "2.0", "method": "Player.SetShuffle", "params": { "playerid": 1 }, "id": 1}  
Nope, did not work.

I'm also looking to control a seek +/- 5 and 10 seconds. Tried it with a similar sceme. No, did not work.

Can anyone help me please to correct read and interprete the API or has anyone a working example?

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [12 June 2021 04:54 UTC](https://discourse.nodered.org/t/controlling-kodi/47041/2 "2021-06-12T04:54:53Z")

</div>

note that there is a kodi node with examples

> **[node-red-contrib-kodi](https://flows.nodered.org/node/node-red-contrib-kodi)**
>
> Node-RED nodes for communicating with a Kodi (former XBMC).

---

<div class="post-metadata">

### Author: ![alexander77](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@alexander77](https://discourse.nodered.org/u/alexander77)
#### Post date: [12 June 2021 06:36 UTC](https://discourse.nodered.org/t/controlling-kodi/47041/3 "2021-06-12T06:36:53Z")

</div>

This was my template to start playlists. But it does not show anything how to control all the other functions.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [11 August 2021 06:37 UTC](https://discourse.nodered.org/t/controlling-kodi/47041/4 "2021-08-11T06:37:28Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
