Can't configure sabnzbd with home-assistant

This is what my configuration.yaml looks like

i go to the states page and confirm my api key, but it doesn’t take, keep getting error:
Connection to SABnzbd API failed

sabnzbd:
  api_key: c63df18be855cf45b8303dc4524f9c64
  ssl: false
  host: 192.168.1.X

Note: i am not using ssl/https on home assistant (yet, at least until Frank has the add-on available), nor am i using it in sabnzbd
any suggestions?

Edit: i changed the host to match the correct host, but now nothing shows up and no errors at all

Try it like this:

sabnzbd:
  api_key: !secret sabnzbd_api_key
  host: 192.168.0.34
  name: sabnzbd
  port: 8080
  sensors:
    - current_status
    - speed
    - queue_count
    - queue_size
    - queue_remaining
    - disk_size
    - disk_free
    - total_size

Sometimes you might get a persistant notification that sabnzb hasn’t been configured while discovery is disabled. Add the following to your configuration.yaml to stop seeing the message.

discovery:
  ignore:
    - sabnzbd

edit: changed the port number to the standard one used by sabnzbd

(edit: this might not work in your case, for some reason, when I do not ignore discovery than it will load up sabnzbd just as it should, but it still gives me the message. Sensors all work fine though, that is why I chose to ignore it in discovery so that I wouldn’t be bugged with a notification)

8080 is normally the port.
If it can’t configure sab with the api that’s why it asks in discovery… disabling that means it won’t work at all. If you do get prompted for the api-key it then works.

It’s only just started doing this and I did start a thread here about it and also raised an issue.

@jimz011 thank you! that seemed to work!!!

jimz suggestion worked and i am on .88 as well, fyi

I have that exact config as well. Sometimes it works, sometimes it doesn’t and gives an error in the log.

If you disable discovery, then if it isn’t detected via config and there is a config error then it won’t work at all. It might get rid of the annoying persistent notification but it won’t work either.

When mine started doing this a couple of days ago, it started prompting via the persistent notification for the API key. I entered it and it creates a sabnzbd.conf in the donfig directory… But then when I restarted again, it would also come up with the config error in the log again and prompt AGAIN for me to enter the API key even though the conf file exists.

If you look in th e.py file you will see that it only does that persistent notification prompt for the API key when config via the API in config yaml fails… so if that fails and you have disabled discovery then the sabnzbd sensor won’t work at all.

One change I did make yesterday was to specify the port: 8080 and ssl: false even those are the defaults and don’t need to be configured.

Anyway, you might think it’s fixed but it seems to be an intermittent problem. It only started from 0.88 with me and I did add the extra port and ssl but I think it’s luck that it has not failed again. Mind you there have been a few docker image updates for sabnzbd over the last few days so maybe they screwed/unscrewed the pooch. I think ignoring it in discovery will end up biting you and don’t think that ‘fixed’ anything other than the notification…

I actually had the same issue, after reading your post I checked my sabnzbd sensor (which I don’t use very often) but it seemed not to be loaded. I just updated my sabnzbd to the latest version and it seems to work now. But I don’t know if it is because of the update or because I have restarted HA a few times.

True that if you disable discovery that it won’t load at all when the setup fails. But I prefered it not working at all than keeping a persistant notification (that doesn’t work either :stuck_out_tongue:). In my case if it failed to load the first time it wouldn’t load at all anyways so the only option I had/have is restarting HA, not a big deal for me, but I can imagine a pain for people with raspberries.

Edit: This sabnzb problem I have has been this way since I started with HA back in june 2018, so it isn’t related to Home Assistant 0.88.

Only since 0.88 for me.

BTW if you enter your API key from the persistent notification, all the sensors will work and the persistent notification disappears.

YMMV but it definitely does work for me.

I think it’s just a timing issue made worse in 0,.88 perhaps.

I’m running the docker linuxserver/sabnzbd… it seems there have been a few image updates recently. Anyway, since last boot it’s working again anyway without a log error. It’s just weird. There’s a few of us having this issue.

I’m just unlucky with that persistant notification. (third HA install and all the same behaviour). Whenever I enter the API key at the persistant notification it just throws me an error that the API key isn’t correct. Never really looked into it again though as this “ugly” solution served my needs. But indeed it is very weird. Sometimes I get the component loaded and it will still throw me that notification. Sometimes it accepts the API key, it will then look like it has set up sensors etc. but after a second or so the notification just pops back up.

There are 2 API keys for Sabnzbd - it only seems to work for me with the full control one…

yep, thats the one i use as well

What do you mean by this? I don’t see any point in ssl for a device only accessible on my local network anyway…

@jimz011 adding the ignore discovery worked! thanks