TrueNAS integration

Monitor and control your TrueNAS CORE/SCALE device from Home Assistant.

  • Monitor System (Cpu, Load, Temperature, ARC/L2ARC, Uptime)
  • Monitor Disks
  • Monitor Pools (including boot-pool)
  • Monitor Datasets
  • Monitor Replication Tasks
  • Monitor Snapshot Tasks
  • Control and Monitor Services
  • Control and Monitor Virtual Machines
  • Control and Monitor Jails (TrueNAS CORE only)
  • Control and Monitor Cloudsync
  • Create a Dataset Snapshot

Integration available via HACS

My other work

Features

Pools

Monitor status for each TrueNAS pool.


Datasets

Monitor usage and attributes for each TrueNAS dataset.

Disks

Monitor temperature and attributes for each TrueNAS disk.

Virtual Machines

Control and monitor status and attributes for each TrueNAS Virtual Machines.
Virtual Machines control is available through services.

Jails

TrueNAS CORE only

Control and monitor status and attributes for each TrueNAS jail.
Jail control is available through services.

Cloudsync

Control and monitor status and attributes for each TrueNAS cloudsync task.
Jail control is available through services.

Replication Tasks

Monitor status and attributes for each TrueNAS replication task.

Snapshot Tasks

Monitor status and attributes for each TrueNAS snapshot task.

Dataset Snapshot

Create a Dataset Snapshot using Homeassistant service.
Snapshot name will be automatically generated using datetime iso format with microseconds and “custom” prefix.


Services

Control and monitor status and attributes for each TrueNAS service.
Service control is available through services.

Services

11 Likes

That’s great… ordered a bunch of hardware to buils a Truenas Scale to replace my very old Synology and old Qnap can’t wait…

1 Like

Does this integration offer any way to remotely shut down TrueNAS? If not, anyone know of a relatively easy way to do that from Home Assistant?

yes it can. see list of features on github or in HACS

Hi!
Yesterday I noticed that I wasn’t getting any info of any TrueNAS sensor. They where switching between the default value (ex: 0) and unavailable. It was the same today so I tried to remove the integration and reinstall it. It only did worst as only the TrueNAS system was found. No disk or dataset. I then looked at the log and found this:

Logger: custom_components.truenas.truenas_api
Source: custom_components/truenas/truenas_api.py:99
Integration: TrueNAS (documentation, issues)
First occurred: 19:26:39 (1 occurrences)
Last logged: 19:26:39
TrueNAS 192.168.1.5 unable to fetch data “update/check_available” (504)

Any clue on this behavior?

that means remote server did not respond. so you may have problem with internet access on you truenas.
any error reporting should be done on github tho, not here.

This is awesome, Thanks!
I did have an issue today - I was creating a new pool and pasting 3TB of data into the dataset.
My homeassistant.log was going mad and filling up at an alarming rate.
I disabled the truenas integration instantly , deleted the log file, restarted and monitored. Ok afterwards.
Log was so big I was unable to open it.
I added an exception to the recorder to exclude truenas*.

This worked after enabling it again.

So the recorder is the one creating the log.file also? I thought the recorder was for the database (in my case mariadb on a different disk).
Please correct me if I am misunderstanding.
Is there another setting I can add to prevent the log file from growing like that again?
Do I need to configure it using these suggestions?

Thanks

What were the messages in the logs? The logger integration creates the log file with data from the database. recorder is what writes to your db.

Your solution will work (and also keep your db from growing too large), but I’m curious what errors you were getting.

Couldn’t tell. Too large to open and had to delete it as a matter of urgency as proxmox was bottle necking on that container

There is no such thing as file being too large to open. You can read a file no matter what, except hardware failure.
Adding exception to recorder has no effect on HA log file.
Without knowing what was reported in HA log, we dont even know if its related to truenas integration. Chance it is related is very small actually.

(shutdown from up above comment) How do I do it though, I just tried it from the Developer tools and nothing happened. Tried calling TrueNAS shutdown with the TrueNAS System device selected, felt about right. I suspect this should have done something and just did not.

‘service: truenas.system_shutdown
data: {}
target:
device_id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx’

You have to use uptime sensor as target. See documentation on github.

Thanks Tomaae, Sorry I didn’t understand that line when I first read it. Get it now though…

1 Like

no problem. but its better to ask technical questions on github, you get faster answer.

2 Likes

Can you post what you did?

The documentation isn’t very clear on this and i’m struggling to implement shutdown in Truenas Scale.

Any help would be greatly appreciated.
Thanks

Not sure what is unclear about it, you just have to target uptime sensor:

2 Likes

Ah this helped.
Thank you!

i am running my ha on my True nas scale app works great
merged over with little difficutly
my true nas integration cannot find host is this because they are running on the same machine
true nas ip 192.168.4.200
ha 192.168.4.93

is set host to .200
any ideas

I seen somewhere that scale has a bug where internal bridge is not working. should be fixed in next scale release.

thanks for the update i will look out for that
otherwise all good so far