Adjust SABnzbd Speed if watching Plex

This is my first automation so apologies if it isn’t ‘perfect’ but it does what it needs to do, I’ll add some additional options like a time condition etc. if people want.

To get this automation to work you will need to add the following

Plex Media Server Integration
sabNZBD Integration

Once you have both of these setup, run the blueprint and make sure to find the ‘Plex Media Server Sensor’ it’s not a media_player.

The automation will wait for 0 active Plex users before returning to 100% download speed. Happy to add some further inputs if you would like some more flexibility around this?

blueprint:
  name: Set sabNZBD Speed if users watching Plex
  description: >
    This automation blueprint will allow you to adjust the download speeds of your sabNZBD client based on your Plex server
  domain: automation
  input:
    plexserver:
      name: Plex Media Server
      description: The Media Server you want to trigger the automation
      selector:
          entity:
            domain: sensor

    speed:
       name: Throttle Speed
       description: Adjust the speed at which sabNZBD will download - eg 50% will be 50% of your total download speed.
       default: ""
       selector:
         number: 
           min: 0
           max: 100
           unit_of_measurement: "%"
           mode: slider

    no_of_users:
       name: No. Of Users
       description: Set the No of Users needed to trigger this automation.
       default: "1"
       selector:
          number:
            min: 1
            max: 100
            unit_of_measurement: "Users"
            mode: box

trigger:
  platform: state
  entity_id: !input plexserver
  from: "0"
  to: "!input no_of_users"

variables:
  plexserver: !input plexserver
  speed: !input speed

action:
  - service: sabnzbd.set_speed
    data:
      speed: "{{speed}}"
      
  - wait_for_trigger:
    - platform: state
      entity_id: !input plexserver
      to: "0"
       
  - service: sabnzbd.set_speed
    data:
      speed: 100
3 Likes

This is great! Works really well, you should right some more and test them on your friend! Keep up the good work.

1 Like

Thanks Scott! Got my head around this one, so keen to write some more.

Could this be adapted to if an entity is home, according to a wifi tracker? The issue I typically have is that when anyone is home and a download starts, the internet for the entire house slows down while the queue is processing making it nearly unusable. The download speed of the ISP does fluctuate so I can’t just set a max % and have that work consistently.

I would like to setup a way where if one a few MAC addresses are found on the Ubiquiti Wifi, then the download speed gets set to 50% or another value.

Would you be able to help write that automation?

To try and keep the blueprint somewhat “open” so it’s not as specific to your requirements, I could change it to include a toggle.

That would then require you to create an automation which would look for your MAC(s) and if any are “seen” the automation would turn the toggle on and if not seen then off etc. if this is acceptable I’ll have a look to re-write it this week.