Separating out 2 results into their own entities

Hey, newbie here. I have TraktTV integration set up and what I want to achieve is to get the title of the TV shows that were released yesterday, separated out into their our entities.

Currently the integration spits out 100’s of show but I want to filter to just yesterday’s results. This is my current template so far and it’s got me half there.

{% set tv_shows = state_attr('sensor.trakt_next_to_watch_only_aired', 'data' ) | selectattr('title', 'defined')   %}
{% set yesterday_date = (as_timestamp(now()) - (24*3600)) | timestamp_custom('%Y-%m-%d') %} 
{% for tvshow in tv_shows %}
  {% if yesterday_date in tvshow.airdate %} 
    {{ tvshow.title }}
  {% endif %}
{% endfor %}

This is the current output:
Result type: string

Below Deck Down Under
The Block

How can I separate these 2 results into their own entities, 1 for TV show 1 (Below Deck Down Under) and another for TV show 2 (The Block).

Cheers

What’s the vision for the end goal? Maybe there’s another way to approach reaching that goal.

Essentially I want to send an actionable notification to my phone of any new shows released and I can just click on it and it will automatically turn the TV on and start the show.

But in order to do that, I need to know the name of the TV show on it’s own, that I can use in both the notification sent to the phone, and also what to pass to Google Assistant on the TV in order to start the show.

It works fine when there is only 1 TV show released yesterday, but it breaks once there are more than 1.

Any suggestion would be fantastic. Cheers

What script or action are you using to actually call the services to start the show?

It is an ADB command to trigger the TV internal search, which is the Google Assistant voice call on the TV, to say play TV show X on app Y.

Hopefully that all makes sense. I figured the TV part of it out, but it’s just passing the single TV show title which is causing the issue

Could you wrap the {{tvshow.title}} inside of a hyperlink that triggers a script via a webhook, then pass the information you need to the script?

Another question, since I’m not really familiar with actionable notifications, is it possible for the actionable notification to have multiple options?

Thanks, I think I have figured out a way to separating out the show titles. I done this by filtering on the unique episode number. It’s not pretty but it seems to be working pretty well. Thanks for the help.

Yeah I think for iOS you can have up to 10 different options for actionable notifications, while Android is limited to 3.