Unraid API - Connect and control Unraid servers through Home Assistant via MQTT

@ElectricBrain Thanks for creating the API, I look forward to updates soon so I can add more functionality to my view.

Finally fixed my attributes problem.
I would still love to see a possibility to:

  • see if there are updates for dockers/plugins/unraid OS
  • able to shut down the server
  • correct info disk usage
  • parity check
  • reboot server

But an unraid api addon in HA would be even better :stuck_out_tongue:
@ElectricBrainUK
any update for this?

hi,

I found this message in my supervisor logs, but I don’t have any addon for Unraid API (just a container in unraid server that is off right now). Can some one please give me a hint?

21-04-05 13:03:57 WARNING (MainThread) [supervisor.addons.validate] Add-on config ‘startup’ with ‘before’ is deprecated. Please report this to the maintainer of Unraid API

Thank you

Hi, that is unusual, have you ever had the add-on installed? It shouldn’t matter anyway it’s just something I need to change when I look at getting the add-on working again

Yes I tried once. Maybe some parts are still in my config somewhere? At the moment I don’t have the addon installed wo that’s a weird message. I raised this question because if you look at my username I already wrote you on Unraid Forum asking your support because the container is no longer usable in 6.9.1 cause when it’s running CPU are all 100% all the time. So I was wondering if this warning can be somehow related. I guess no based on your answer. Looking forward to use this tool again!

Perhaps, very odd! I appreciate you letting me know though thanks!

I have pushed a partial fix for 6.9.1 but as we discussed on the unraid forum it doesn’t seem to have fully remedied the situation, but rest assured I haven’t forgotten and am working with some other members of the community to release a completely revamped tool with all the same functionality but better performance and UI - give it another week or two though as I can only work on it in my spare time

3 Likes

Hey, I don’t suppose your issue could be related to this? https://github.com/ElectricBrainUK/UnraidAPI/issues/33

Hi, I might be missing something silly but I’ve got everything set up but I’d like to pull the disk space used into my config but I cant see it as a sensor? Do I need to add it in the sensor yaml?

Hey, yeah so it should show up under server details right? You have to manually configure a sensor if you want to use that data in automations (in your sensors.yaml like you said)

There are set details here: Home Assistant Integration ¡ ElectricBrainUK/UnraidAPI Wiki ¡ GitHub

And more specifically here: MQTT Sensor - Home Assistant

Try it yourself and let me know how you get on, happy to help if you get stuck

Thanks, I’ve got it although the sensor data seems to swap between the disk space used and this?
Content-Type" content="text/html; charset=utf-8">

That is interesting, let me check that

This is my sensor.yaml if that helps…

  sensors: 
    server_diskspace:
      value_template: "{{state_attr('binary_sensor.unraidserv_server', 'diskSpace') }}"
      friendly_name: 'Unraid Disk Space'

Mother of god this solved my issue!

1 Like

I’ve installed the Unraid-API container on my unraid server, but it doesn’t seem to pull any info whatsoever, apart from the IP address and name of the server after I log into the application using my unraid credentials.

This is what is shown after I login with the credentials (it does show “connected”):

Anyone had a similar issue?
Any tips or anything I may have missed?

Thanks!

Hey, it looks like your IP is correct and it can find the server but is failing for some reason to authenticate with it. It could be:

  • because your server can only be accessed over Https and you didn’t tick the Https box
  • you entered the wrong password
  • your unraid API can’t access unraid due to network config (docker bridge or DNS settings on unraid and the docker)
    It could also be something else but those are my initial thoughts, check the unraid server logs and the logs of the unraid API for more details

Thanks for creating the integration. Things started working when I added my (custom) port to the IP address field: 192.168.###.###:####
I had moved unraid to different port.

1 Like

Hi @ElectricBrain
I’m getting errors in my log like this:

  • emplate variable warning: ‘dict object’ has no attribute ‘parityCheckRunning’ when rendering ‘{{ value_json.parityCheckRunning }}’
  • Template variable warning: ‘dict object’ has no attribute ‘moverRunning’ when rendering ‘{{ value_json.moverRunning }}’
  • Template variable warning: ‘dict object’ has no attribute ‘arrayStatus’ when rendering ‘{{ value_json.arrayStatus }}’

Any idea?
I dont see any json config

Hey @skank the json it is referring to is the one sent in the MQTT payload, is this in the logs on the home assistant side?

hi @ElectricBrain
Yes this is in the home assistant logs

How did you configure glance, i install on unraid glance with docker container and then on home assistant through integration but i do not get any sensor, i know that are communicating because when i stop the container is reflecting on home assistant