i want to implement a “pause”/“stop” call to kodi. in kodi RPC the call body to use is:
{“jsonrpc”: “2.0”, “method”: “Player.PlayPause”, “params”: { “playerid”: 0 }, “id”: 1}
the problem is, it might not be playerid:0 - can also be 1 (or other id).
using a call body:
{“jsonrpc”: “2.0”, “method”: “Player.GetActivePlayers”, “id”: 1}
returns the active player in json which can be used in the call to PlayPause - but how can i achieve that in home assistant? i thought about python script, but do regular REST calls are supported?