Kodi - Get last episode to watch

Hi,

Hope someone can help because I can’t seem to get it working.
My ultimate goal is to say a series name and then the last episode of that serie will play on Kodi.

First step is to get the episodes and get the latest unwatched.
I have succesfully setup Kodi - Home Assistant integration.
Kodi is accessable by http and by external apps on port 8080.

But I can’t get the episodes whatever i do.
In development

action: kodi.call_method
data:
method: VideoLibrary.GetRecentlyAddedEpisodes
target:
device_id: xxxx

This call is succesfull but I don’t get any results.
Anybody who can help? I first tried Trakt integration but was even worse :slight_smile:
Thanks in advance.

Kind regards.

According to the documentation, any API results are in a kodi_call_method_result event. If you have two browser windows open and go to the Events tab of the developer tools, you can listen to that event. Then on the other tab trigger the event. Go back to the first tab and you’ll see all the results.

Even with that data, you’re not going to be able to do what you want. That gives back literally a list of episodes with no information on what show the episodes are attached to. You do also get an episode ID, so I think you can do a different JSON call to get the details for each episode, and I think that contains at least a series ID. But then you have to look up each series ID to get the series name. I’m not sure HA is really well designed to do that much data munging.