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.
Version 2 updates:
As of 2022.5 the SABnzbd integration introduced the need for the API key to be a part of service calls, rather than the API key being a part of the integration configuration. As a result of this, I have reworked the blueprint.
Main changes are:
- API key added as an input - This is a ‘password’ input, however the key is stored in plaintext by Home Assistant so be aware of this in case you share your configuration on GitHub or similar.
- Introduction of “Bandwidth Threshold”. Previously 0KB/s was set in v1 and users would have to change this if they had different requirements. Now the users selects the Bandwidth Threshold (minimum of 1KB/s) - This allows for the users to choose when the automation should kick in and is therefore more flexible.
blueprint:
name: SABnzbd Download Handling
description: Pause SABnzbd downloads whilst external users are watching Plex
domain: automation
homeassistant:
min_version: 2022.7.0
input:
tautulli_wan_bandwidth:
name: Tautulli WAN Bandwidth
description: The Tautulli sensor for WAN Bandwidth
selector:
entity:
domain: sensor
integration: tautulli
sabnzbd_status:
name: SABnzbd Status
description: The entity that shows the current status of SABnzbd
selector:
entity:
domain: sensor
integration: sabnzbd
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
sabnzbd_api:
name: SABnzbd API Key
description: API key for your SABnzbd instance
selector:
text:
type: password
bandwidth_threshold:
name: Bandwidth Threshold
description: 'The threshold in KB/s you would like this automation to activate at eg. 10000 == 10MB/s'
selector:
number:
min: 1
max: 100000
unit_of_measurement: 'KB/s'
mode: box
mode: restart
max_exceeded: silent
trigger:
- entity_id: !input sabnzbd_status
platform: state
to: Downloading
- platform: numeric_state
entity_id: !input tautulli_wan_bandwidth
below: !input bandwidth_threshold
- platform: numeric_state
entity_id: !input tautulli_wan_bandwidth
above: !input bandwidth_threshold
- 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_wan_bandwidth
above: !input bandwidth_threshold
- condition: state
entity_id: !input sabnzbd_override
state: 'off'
sequence:
- data:
api_key: !input sabnzbd_api
service: sabnzbd.pause
default:
- data:
api_key: !input sabnzbd_api
service: sabnzbd.resume
Edits
- 22/03/2024
- Changed
min_version
to 2022.7.0 as the Tautulli integration moved to separate entities at that point. - Input name changed from
tautulli
totautulli_wan_bandwidth
. - Changed triggers and actions as a result of the changes made in 2022.7.0.
- Changed name and description for
tautulli
input to reflect the aforementioned changes in 2022.7.0. - Added
integration
option for the input selectors for SABnzbd & Tautulli to make it easier to select the correct entities.
- Changed