How to easily integrate TrueNAS CORE/SCALE with Home Assistant
Disclosure: This post contains affiliate links. If you click through and make a purchase, I will earn a commission, at no additional cost to you. Read my full disclosure here.
Due to its open nature and accessible API, integrating TrueNAS CORE/SCALE with Home Assistant has always been possible, though it did require some labour. Thanks to developer Tomaae on GitHub, who is known for their MikroTik and OpenMediaVault integrations, this is no longer the case. Their custom component lets you monitor and control your TrueNAS CORE/SCALE storage server with just a few clicks.
For those out of the loop on recent developments, TrueNAS SCALE, similar to TrueNAS CORE, is built on Debian-Linux instead of FreeBSD. It offers Hyper-Converged Infrastructure (HCI) capabilities, enabling the easy creation of virtual machines and Linux containers, including support for Docker. Additionally, it provides a wide range of scalability options not available in TrueNAS CORE and being Linux-based, it supports a wider range of hardware.
What you can do with the TrueNAS CORE/SCALE integration with Home Assistant
As the TrueNAS CORE/SCALE API allows for a lot of insight and control, the custom integration with Home Assistant allows you to control and monitor just about anything. Not only can system resources be monitored, but also tasks, services, pools, and jails. Furthermore, using Home Assistant, you can also control the same jails, virtual machines, services, snapshots, and more.
Monitor
System (CPU, load, memory, temperature, network, ARC/L2ARC, and uptime)
Disks
Pools (including boot-pool)
Datasets
Replication tasks
Snapshot tasks
Services
Virtual machines
Jails (TrueNAS CORE only)
Cloudsync
Control
Services
Virtual machines
Jails (TrueNAS CORE only)
Cloudsync
Create a dataset snapshot
Update sensors
Reboot and shutdown TrueNAS CORE/SCALE system
How to install the TrueNAS integration component in Home Assistant
As with most, if not all, custom components featured on this site, there is only one recommended way of installing Home Assistant's custom component for TrueNAS: the Home Assistant Community Store (HACS). If you haven't done so yet, install it before proceeding. HACS will automatically search for updates and allow you to install them with the click of a button. It will also make sure all files are in the right place and make any necessary adjustments.
With HACS ready to go, you can enter it and search for TrueNAS. There should be no need to add a custom repository, as it is available in the HACS listing. Install the component and restart Home Assistant when instructed to.
Preparing TrueNAS to be integrated with Home Assistant
While Home Assistant is restarting, move on to the TrueNAS CORE/SCALE web interface to set up an API key. To do so, click on the settings icon and select 'API Keys'. From there, click on the button labelled 'add' and give your key a name you will recognize later (for example, homeassistant).
Once the API key is created, you will be prompted to copy it to your clipboard. Do that, and return to the Home Assistant Dashboard.
Integrating TrueNAS CORE/SCALE with Home Assistant
With Home Assistant restarted, navigate to the settings and look for your integrations. Click on the large button to add a new integration, to make things easier, you can use the search field to filter for 'TrueNAS'. Once selected, you will be prompted to enter a name for the integration, the IP of your TrueNAS CORE/SCALE system, and the API key previously created and copied.
About Liam Alexander Colman
Liam Alexander Colmanis an experienced Home Assistant user who has been utilizing the platform for a variety of projects over an extended period. His journey began with a Raspberry Pi, which quickly grew to three Raspberry Pis and eventually a full-fledged server. Liam's current operating system of choice is Unraid, with Home Assistant comfortably running in a Docker container. With a deep understanding of the intricacies of Home Assistant, Liam has an impressive setup, consisting of various Zigbee devices, and seamless integrations with existing products such as his Android TV box. For those interested in learning more about Liam's experience with Home Assistant, he shares his insights on how he first started using the platform and his subsequent journey.