Automatic SABnzbd Download Pausing v2

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.

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

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 to tautulli_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.
4 Likes

Great! Would love to try this, that would be amazing. Could you help me setup that BOOLEAN? I have no idea how to do that.

I’ve linked directly to the documentation for Input Booleans above - Could you be specific with what you need a hand with? :slight_smile:

I also am having the same confusion as Airyphyla above. I have spent numerous hours trying to work it out but with no avail.
I have managed to install home automation and associate SabNZB and Tautulli (and can see the programs data changing along with the status of plex / SAB however I am stuck at the Boolean section.

I created a a “toggle” in the helper section called test which allowed be to configure the blueprint however nothing seems to doing any triggering. When I run both a stream on plex and a SABnzb download nothing seems to happen.

Im confused if the Input Boolean has been done incorrectly, I followed the instructions as provided in the link but it doent seem to have any reference back to SAB (assuming this toggle can manually be turned on to manually override the automation) That’s my understanding anyway

The toggle is there to allow downloads to continue and to prevent the automation / Blueprint from stopping a download. It sounds like you’re looking for it to stop a download instead, which isn’t the case. I can see from the description I’ve written on the Blueprint itself that this isn’t clear but I did explain the funtionality in the body of the original post :slight_smile:

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.

Hi @ZuluWhiskey,

I’ve noticed the tautulli integration has a sensor for wan_bandwidth (disabled by default) rather than an attribute with the current release of Tautulli.

I commented out the “attribute” references in automation and changed description of tautulli intergration entity to “tautulli wan bandwidth entity” and it all works.

PS: This is a brilliant little blueprint. Thanks for creating!

I might add a Steam ‘playing games’ check into this blueprint to build on the great work you have done… I will post if I make it work!

Thanks so much for flagging this! I made the changes necessary on my local Blueprint when this happened back in 2022 but never actually updated this post to reflect those changes!

I’ve now edited the Blueprint which will now make this work again.

@leighton_morrell this will explain why you couldn’t get this working. If you try the new version it should work for you.