2022-05-11, 18:15
Im having a mess about with home assistant and currentlytesting out the kodi integration to see if it will suit my purposes
Its quite a leaning curve for me as I dont know how JSON calls work in general let alone how you set up scripts in home assistant !!
But I have managed to get a playlist to play using the information From https://forum.kodi.tv/showthread.php?tid...pid2694920
where I found this from Dave
[{"jsonrpc": "2.0", "id": 0, "method": "Playlist.Clear", "params": {"playlistid": 0}},
{"jsonrpc":"2.0","id":0,"method":"Playlist.Add","params":{"playlistid":0,"item":{"recursive":true, "directory":"special://profile/playlists/music/zzzz.xsp"}}},
{"jsonrpc":"2.0","id":0,"method":"Player.Open","params":{"item":{"playlistid":0,"position":0}}}]
from which I have created home assistant scripts that look like the following
kodi_party_mode:
alias: Kodi 1950s
sequence:
- service: kodi.call_method
data:
entity_id: media_player.rasp3libre
method: Playlist.Clear
playlistid: 0
- service: kodi.call_method
data:
method: Playlist.Add
playlistid: 0
item:
recursive: true
directory: special://profile/playlists/music/1950s.xsp
target:
entity_id: media_player.rasp3libre
- service: kodi.call_method
data:
entity_id: media_player.rasp3libre
method: Player.SetPartymode
playlistid: 0
item:
playerid: 0
partymode: true
- service: kodi.call_method
data:
entity_id: media_player.rasp3libre
method: Player.Open
item:
playlistid: 0
position: 0
mode: single
icon: mdi:disc-player
The playlist plays perfectly but I am unable to workout how to play it in party mode, I have tried Player.SetPartymode both before and after Playlist.Add but without success
Looking at the json api details on the wiki I'm beginning to think I need to set partymode in Player.open but I dont know enough json to workout how to supply all the parameters
Could someone with some JSON knowledge post a sample call whch opens an existing call in party mode, from that I'm pretty sure I'll be able to workout the homeassistant script entries
thanks in advance
Its quite a leaning curve for me as I dont know how JSON calls work in general let alone how you set up scripts in home assistant !!
But I have managed to get a playlist to play using the information From https://forum.kodi.tv/showthread.php?tid...pid2694920
where I found this from Dave
[{"jsonrpc": "2.0", "id": 0, "method": "Playlist.Clear", "params": {"playlistid": 0}},
{"jsonrpc":"2.0","id":0,"method":"Playlist.Add","params":{"playlistid":0,"item":{"recursive":true, "directory":"special://profile/playlists/music/zzzz.xsp"}}},
{"jsonrpc":"2.0","id":0,"method":"Player.Open","params":{"item":{"playlistid":0,"position":0}}}]
from which I have created home assistant scripts that look like the following
kodi_party_mode:
alias: Kodi 1950s
sequence:
- service: kodi.call_method
data:
entity_id: media_player.rasp3libre
method: Playlist.Clear
playlistid: 0
- service: kodi.call_method
data:
method: Playlist.Add
playlistid: 0
item:
recursive: true
directory: special://profile/playlists/music/1950s.xsp
target:
entity_id: media_player.rasp3libre
- service: kodi.call_method
data:
entity_id: media_player.rasp3libre
method: Player.SetPartymode
playlistid: 0
item:
playerid: 0
partymode: true
- service: kodi.call_method
data:
entity_id: media_player.rasp3libre
method: Player.Open
item:
playlistid: 0
position: 0
mode: single
icon: mdi:disc-player
The playlist plays perfectly but I am unable to workout how to play it in party mode, I have tried Player.SetPartymode both before and after Playlist.Add but without success
Looking at the json api details on the wiki I'm beginning to think I need to set partymode in Player.open but I dont know enough json to workout how to supply all the parameters
Could someone with some JSON knowledge post a sample call whch opens an existing call in party mode, from that I'm pretty sure I'll be able to workout the homeassistant script entries
thanks in advance