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).
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.
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.