Monitoring Unraid in Home Assistant

Unraid is a popular Linux-based operating system optimized for media file storage with network access. Unraid can also natively run docker containers, without the need of a virtual machine, which makes it a popular operating system for home servers. Using Docker you can, of course, run Home Assistant Core. In fact, many in the community, including me, do exactly that.

Using Unraid you can build your own NAS using off-the-shelf computer hardware. It has some unique advantages over TrueNAS Core which make it more suited for home use, which is why I made the switch. You’ll find some Unraid guides on Home Assistant Guide’s sister website if you are further interested.

One thing I was missing was seeing my Unraid system information in the Home Assistant frontend. Luckily, I knew from a previous setup that Home Assistant integrates with Glances. Using the Glances integration you can monitor system information provided by the Glances API. So, all I had to do was get Glances installed on my Unraid system and configure the integration.

What is Glances?

Glances is a cross-platform system monitoring tool written in Python. Incidentally, that is the same programming language Home Assistant is written in. Using Glances you can keep an eye on vital information such as your system’s CPU and memory use, a whole host of sensors, and Docker containers.

SaleBestseller No. 1
Seagate IronWolf 4TB NAS Internal Hard Drive HDD – CMR 3.5 Inch SATA 6Gb/s 5900 RPM 64MB Cache for RAID Network...
  • IronWolf internal hard drives are the ideal solution for up to 8 bay, multi user NAS environments craving powerhouse performance
  • Store more and work faster with a NAS optimized hard drive providing 4TB and cache of up to 64MB
SaleBestseller No. 2
Western Digital 4TB WD Red NAS Internal Hard Drive - 5400 RPM Class, SATA 6 Gb/s, SMR, 256MB Cache, 3.5" - WD40EFAX
  • Available in capacities ranging from 2-6TB with support for up to 8 bays
  • 5400RPM performance class
SaleBestseller No. 3
Western Digital 10TB WD Red Plus NAS Internal Hard Drive - 5400 RPM Class, SATA 6 Gb/s, CMR, 256 MB Cache, 3.5" -...
  • Available in capacities ranging from 1-14TB with support for up to 8 bays
  • 5400RPM performance class

You can access Glances using either the system terminal or the built-in web dashboard. It is built to be cross-platform compatible, and you can run it on just about any platform including Linux, FreeBSD, macOS and Windows.

Installing Community Applications on Unraid

The easiest way of installing Glances on your Unraid system is by using the Community Applications plugin. There is a detailed installation guide on the Unraid forums on how to get the Community Applications working, so I won’t go through the setup process here. Simply follow the instructions on this page. Once completed you can get started with the installation of Glances.

The Unraid Community Applications
The Unraid Community Applications tab

Alternative (manual) installation

If you don’t fancy installing or using the Community Applications you can of course also manually set up a Glances docker container. For simplicity’s sake I won’t be going through that setup and I highly recommend you use the Community Applications. There is a perfectly set up template available which will spare you the whole process.

Installing Glances on Unraid

You should now have an extra menu item in your Unraid frontend titled Apps. Clicking on it will show you all the apps maintained by the Unraid community. These include Docker container templates and plugins. You even have the option of searching Docker Hug if there hasn’t been a template set up for your desired app. Luckily though, there is a template for Glances. All you have to do is search for and install the Glances app.

Glances in the Unraid Community Applications

Once installed you are already half-way there. Next you will want to click on the Docker tab in the Unraid menu. You should now see your Glances container. If it hasn’t been started yet, you can start it. I also recommend that you enable autostart.

The Glances docker container in Unraid

Setting up the Glances integration in Home Assistant

The Glances integration is set up using the Home Assistant web dashboard. There will be no editing of YAML needed for this integration. Add a new integration in the Home Assistant settings and search for Glances. If you haven’t made any changes to the Glances docker container all you have to do is enter your Unraid system’s IP address and click on submit.

Setting up the Glances integration in Home Assistant

Once the integration is set up, you should be able to monitor values such as disk space used, disk temperatures, and hardware resources. These values can be displayed in your Lovelace frontend and/or used for automations. In the example below I am using the popular Lovelace Mini Graph Card to display how full each hard drive is.

Unraid system information in the Home Assistant lovelace frontend

In terms of automation, you could use this integration to send you a notification when a hard drive or the cache reaches a certain limit or have it turn on a fan whenever the drives are getting too toasty.

About Liam Alexander Colman

Liam Alexander Colman has been using Home Assistant for various projects for quite some time. What started of with a Raspberry Pi quickly became three Raspberry Pis and eventually a full-blown server. I now use Unraid as my operating system and Home Assistant happily runs in a Docker container. My personal setup includes many Zigbee devices as well as integrations with existing products such as my Android TV box. Read on to find out more on how I got started with Home Assistant.

Leave a comment