This is Version 1, please find Version 2 here which is compatible with 2022.5 onwards.
##########################
A simple Blueprint that pauses SABnzbd downloads whilst external users are watching content on your Plex server. This Blueprint requires the use of the Tautulli & SABnzbd integrations, along with a pre-created Input Boolean to override the automation in the event that you’d like downloads to continue whilst users are watching content.
I created this as an automation for myself a while back due to users experiencing issues whilst my server was busy.
blueprint:
name: SABnzbd Download Handling
description: Pause SABnzbd downloads whilst external users are watching Plex
domain: automation
input:
tautulli:
name: Tautulli
description: The entity of your Tautulli integration
selector:
entity:
domain: sensor
sabnzbd_status:
name: SABnzbd Status
description: The entity that shows the current status of SABnzbd
selector:
entity:
domain: sensor
sabnzbd_override:
name: SABnzbd Override
description: The input boolean you have created to act as an override switch for this automation
selector:
entity:
domain: input_boolean
mode: restart
max_exceeded: silent
trigger:
- entity_id: !input sabnzbd_status
platform: state
to: Downloading
- platform: numeric_state
entity_id: !input tautulli
below: '1'
- platform: numeric_state
entity_id: !input tautulli
above: '0'
attribute: wan_bandwidth
- platform: state
entity_id: !input sabnzbd_override
action:
- choose:
- conditions:
- condition: state
entity_id: !input sabnzbd_status
state: Downloading
- condition: numeric_state
entity_id: !input tautulli
above: '0'
attribute: wan_bandwidth
- condition: state
entity_id: !input sabnzbd_override
state: 'off'
sequence:
- data: {}
service: sabnzbd.pause
default:
- data: {}
service: sabnzbd.resume