Help with KODI Call_Method with Params and JSON

Hello, I’m trying to get Home Assistant to load a playlist in KODI and have some trouble with the syntax/formatting converting the following JSON call into an HA script.

http://kodi:[email protected]:8080/jsonrpc?request={"jsonrpc":"2.0","id":1,"method":"Player.Open","params":{"item":{"file":"special://profile/playlists/video/playlist.xsp"}}}

My best attempt at formatting this in HA looks like this:

alias: Turn on Playlist
sequence:
  - service: kodi.call_method
    data:
      method: Player.Open
      params:
        item: 
        file: special://profile/playlists/video/playlist.xsp
    target:
      entity_id: media_player.kodi_livingroom
mode: single

I’ve gotten simple commands to work, but I’m having trouble when adding in “Params”. I would greatly appreciate any help, I’ve probably spent 2-3 hours googling and attempting to no avail. Thanks!

After some more searching this works!

  - service: kodi.call_method
    data:
      entity_id: media_player.kodi_livingroom
      method: Playlist.Clear
      playlistid: 1
  - service: kodi.call_method
    data:
      entity_id: media_player.kodi_livingroom
      method: Playlist.Add
      playlistid: 1
      item:
        recursive: true
        directory: special://profile/playlists/video/playlist.xsp
  - service: kodi.call_method
    data:
      entity_id: media_player.kodi_livingroom
      method: Player.Open
      item:
        playlistid: 1
        position: 0
mode: single