I thought I would re-engineer the Plex Webhook Automation and try and do something with Jellyfin. I am not a Jellyfin user, Plex is my go to media server, at the moment this blueprint does the basics detects Movie, TV Show and Music and can set actions against PlayStart and PlayStopped events.
Prerequisites:
- Jellfin: Install Jellyfin Webhook Plugin
- Understanding of Webhooks (Optional):
- Home Assistant: Webhook Trigger Documentation
- Jellyfin: Webhooks Support Article
Setup:
Generate a Unique Webhook ID:
- Use a tool like GUID Generator to create a random string.
Configure Jellyfin Webhook:
- In Jellyfin, create a webhook pointing to your Home Assistant server:
Menu/Settings > Administration > Dashboard > Plugins > My Plugins > Webhook
Add a Generic Destination.
Give the webhook a Name (i.e. Home Assistant)
Enter the webhook url (treat this as a password)
Use a tool like GUID Generator to create a random string for the <webhook_id>.
example:
http://<home_assistant_ip>:8123/api/webhook/<webhook_id>
http://10.0.1.2:8123/api/webhook/4ed1c518-9131-4c59-8f4e-08ccdc8d7f7d
Check Status: Enable
The following should then be checked:
Notification:
Playback Start
Playback Stop
Item Type:
Movies
Episodes
Songs
Within the Template, paste the contents of webhook_template.handlebars
Add A Request Header and place the following in:
Key: Content-Type
Value: application/json
Click on Save.
Create Automation:
- Create a new automation using the imported blueprint.
- Enter your generated webhook ID and the Jellyfin device name.
Determine Jellyfin Device Name:
- If unsure of the device name:
- Enable the option ‘Jellyfin Device Name ?’.
- Play media on Jellyfin (Movie, TV Show, Music).
- In Home Assistant, assuming you have setup the webhook ID properly, look out for the notification with the device name.
- Enter this value into the blueprint’s Jellyfin device field (case-insensitive).
Configure Automation Actions:
- Define actions to trigger based on Jellyfin playback events.