Hi,
i am fairly new to HA but thanks to the forum I managed to send a library query to kodi with a script and receive a proper result with an automation, eg.
kodi_get_next_episode_id:
alias: Get next Episode ID
sequence:
service: kodi.call_method
data_template:
entity_id: media_player.kodi
method: VideoLibrary.GetEpisodes
limits:
start: 0
end: 1
filter:
field: playcount
operator: is
value: ‘0’
tvshowid: ‘{{ (‘input_number.kodi_tvshow_id’) | int }}’
mode: single
Expecting a JSON result like
{
"id": "kodi_message_id",
"jsonrpc": "2.0",
"result": {
"episodes": [
{
"episodeid": 8201,
"label": "3x08. Dicke Luft",
"playcount": 0
}
],
}
}
So I am able to retrieve {{trigger.event.data.result.episodes.0.label}} for example.
My question is in order to have different queries to kodi (and that is when the ‘id’ field comes into play) how can I have an automation that reacts to a certain ‘id’ only. If I try to put it in the condition field, it would not fire at all and I figured out that I can’t access the ‘id’ field. I assumed it would be {{trigger.event.data.id}} ?