💾 Archived View for danq.me › posts › sonarr-huginn-slack captured on 2024-03-21 at 14:45:57. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

Sonarr > Huginn > Slack

2024-02-22

I use a tool called Sonarr to, uhh, keep track of when new episodes of television shows are released, regardless of what platform they're on (Netflix, Prime, iPlayer, whatever) and notify me so I remember to watch it.

For several years, I've used IFTTT as the intermediary, receiving webhooks from Sonarr and translating them for Slack:

Sonarr --> IFTTT --> Slack

IFTTT's move to kill its Legacy Pro plan[1] - which I was on - gave me reason to re-assess this configuration. It turns that the only Pro feature I was using was an IFTTT "filter" to convert the Sonarr webhooks to a Slack-friendly-format.

Given that I'm running an installation of Huginn on my home network anyway, I resolved to re-implement this flow in Huginn and cancel my IFTTT subscription.

Sonarr --> Huginn --> Slack

This turned out to be so easy I wonder why I never did it before.

First, I created a Webhook Agent and gave the URL to Sonarr.

Then I connected that to a Slack Agent with the following configuration (I've omitted my Slack webhook URL so you don't spam me):

{
 "webhook_url": "https://hooks.slack.com/services/...",
 "channel": "#sonarr",
 "username": "Sonarr",
 "message": "**\nNew episodes:{% for episode in episodes %}\n• S{{episode.seasonNumber}}E{{episode.episodeNumber}} {{episode.title}}{% endfor %}",
 "icon": ":tv:"
}

I tried for far too long to get the pluralize filter to work so it'd say "episode" or "episodes" as appropriate before realising I didn't care enough and gave up.

Then all I needed to do was re-emit some of the previous webhooks to test it:

Screenshot showing the results of my tests, in Slack

Now I'll continue to know when there's new television to watch[2]!

I love the power and flexibility that Huginn provides to help automate your life. It does many of the things that I used to do with a handful of cron jobs and shell scripts, but all in one convenient place.

Footnotes

[1] Like many others, I originally signed up to the plan under the promise that the price would be honoured forever. Turns out "forever" means "three years": who knew?

[2] It's especially useful when you're between seasons or a show is on hiatus to be reminded that it's back and I should go and watch it. Hey, there's a thought: I wonder if I can extract the subtitles from shows and run them through a summarising LLM to give me a couple of paragraphs reminding me "what happened last series" if the show's been on a long break?

Links

Sonarr

IFTTT

Huginn

Code of my former IFTTT filter

Screenshot somebody else took of IFTT's "forever" promise