In a digital world where multitasking has become second nature, we yearn for streamlined solutions to effortlessly monitor and manage our systems. With that in mind, we will delve into integrating TrueNAS CORE statistics and messages into Home Assistant, building upon the previous guide on enabling remote starting and shutting down of a TrueNAS CORE machine. Our tool of choice? The TrueNAS CORE API.

Migrating data from the TrueNAS CORE dashboard
While the TrueNAS CORE dashboard has blossomed into a valuable visual hub for critical data, the Home Assistant Dashboard typically takes centre stage on our desktops. So, why not import and display TrueNAS CORE data into the Home Assistant Dashboard for easy access? This guide will walk you through setting up a sensor that provides a report of essential information, which can then be used for notifications or push alerts to keep you informed of your system's health.
Setting the stage with RESTful sensors
In our pursuit of integrating TrueNAS CORE data into Home Assistant, we will utilize RESTful sensors—no RESTful commands needed, as we aren't executing any system commands. To enable specific variables in the RESTful integration, simply add or remove them under the json_attributes
in the configuration provided below.
- status: The current status of the volume
- vol_guid: The volume’s Globally Unique Identifier
- name: The volume’s name
- used_pct: The percentage of used storage
- used_si: The amount of storage currently used
- is_decrypted: Whether the volume is decrypted or not
- avail_si: Available storage
- total_si: The volume’s total storage
sensor:
- platform: rest
name: freenas_report_full
json_attributes:
- name
- status
- used_pct
- is_decrypted
resource: http://IP -OF-YOUR-FREENAS/api/v1.0/storage/volume/VOLUME-NAME/?format=json
value_template: '{{ value_json.status }}'
username: !secret freenas_user
password: !secret freenas_password
authentication: basic
headers:
Content-Type: application/json
Our trusty secrets.yaml file will once again be used to reference the username and password, as explained in our previous guide.
Opting for template sensors
The code provided creates a new entity with desired attributes. However, it falls short in terms of practicality, as it doesn't allow you to display individual information in your Home Assistant Dashboard or easily use the values in automations. To remedy this, create a template sensor for each individual value.

Percent used
---
sensor:
- platform: template
sensors:
freenas_percent_used:
entity_id: sensor.freenas_report_full
friendly_name: Percent used
value_template: {{ states.sensor.freenas_report_full.attributes["used_pct"].title() }}
Volume status
---
sensor:
- platform: template
sensors:
freenas_status:
entity_id: sensor.freenas_report_full
friendly_name: Status
value_template: {{ states.sensor.freenas_report_full.attributes["status"].title() }}
TrueNAS CORE version (full)
---
sensor:
- authentication: basic
headers:
Content-Type: application/json
json_attributes:
- fullversion
- name
- version
name: fn_version_full
password: !secret fn_password
platform: rest
resource: http://192.168.1.10/api/v1.0/system/version/?format=json
scan_interval: 3600
username: !secret fn_user
value_template: {{ value_json.fullversion }}
TrueNAS CORE version (just version number)
---
sensor:
- platform: template
sensors:
fn_version:
entity_id: sensor.fn_version_full
friendly_name: Version
value_template: {{ states.sensor.fn_version_full.state.split(" ")[0] }}
Unleashing the power of TrueNAS CORE and Home Assistant
With a few lines of code and some tinkering, you can now seamlessly integrate TrueNAS CORE statistics and system information into your Home Assistant setup. This fusion unlocks a world of possibilities for automations, scripts, and notifications. Effortlessly monitor your system's performance and address potential issues, leaving you with peace of mind to focus on life's more important matters.

Heads up, seems you have a typo in the volume status template. Missing the sensor in “states.sensor.freenas…..”. Great blog though, love it!
Thanks for that! Have updated the post. And also thanks for your praise!