UNAS Pro integration - monitoring and fan control

Since there is still no official support for the UniFi UNAS Pro via the UniFi Network integration, I’ve built a custom integration for it to have monitoring and fan control in Home Assistant.

Available data includes drive temperatures, SMART data, CPU temps, memory usage, storage pool metrics, and fan speeds. All sensors appear as proper HA entities with automatic MQTT discovery.

The fan control system has three modes: let the UNAS manage fans natively (whichever mode is selected in the Drive UI), use a custom linear temperature curve with configurable parameters, or lock to a fixed speed.

Setup is straightforward: the integration automatically deploys monitoring and fan control scripts to your UNAS via SSH, configures systemd services, and handles MQTT auto-discovery. The scripts are designed to survive firmware updates and auto-recover if needed. Everything that was installed by the integration onto the UNAS will also be removed from it when uninstalling the integration.

Key features

  • One-click deployment of monitoring and fan control scripts
  • Complete drive metrics: temperatures, SMART health, power-on hours, bad sectors
  • System monitoring: CPU, memory, storage pools, uptime
  • Three fan control modes with configurable temperature curves
  • Automatic recovery after firmware updates
  • Native HA devices and entities

Requirements

  • MQTT broker (Mosquitto add-on recommended)
  • MQTT integration installed
  • SSH access to UNAS Pro

Currently a known issue to watch out for is that storage pools can be named incorrectly as there’s no real way to pull the storage pool name via SSH. All storage pools are enumerated and then sorted by the storage pool’s UUID where Storage Pool 1 will be the older UUID, etc. This should work in most cases, but can introduce edge cases. The simple fix for this is to just rename the entities to what they should be if they’re set up wrong on initialization.

The integration is available via HACS as a custom repository or manual installation. Full documentation and setup instructions are in the GitHub repository.

GitHub: GitHub - cardouken/homeassistant-unas-pro: Monitoring and fan control for UniFi UNAS Pro with native Home Assistant integration

This has only been developed for and tested on the original UNAS Pro with 7 bays, I’m not sure if it will work on the UNAS Pro 4/8 or the UNAS 2/4. I suspect it might actually work for the UNAS Pro 4 and 8 out of the box as the firmware should be pretty similar between all of them, but it might require some extra configuration on my end to get drive mappings correct if they’re different. It will definitely miss at least 1 drive out of 8 for the Pro 8 since it’s currently only set up to map 7 drives.

It’s very much a beta implementation for now but seems to work overall for myself and the few users who’ve tried it, so I’d be happy to get feedback on things that could be improved or need fixing.

1 Like

It would be amazing if you managed to implent the ssh shutdown function to connect with a USP / NUT server. Maybe an option to select a entity for a smart switch to turn it on after graceful shutdown

I actually have an automation for this myself where my NUT integration connected to the UPS will trigger an SSH command to gracefully shut the UNAS down.

I’m not sure how much of this should be on the UNAS integration side vs just providing an option to shut it down in general. Right now I didn’t implement a reboot/shutdown option just out of abundance of caution, but it would be trivial to just add a button that could then be used with automations/NUT integrations.

Or were you thinking of something else and I’m not following?

This is exactly my desired usecase. I have next to no ssh/linux experience, so a work out of the box solition would help alot. But I’d also take your homemade solution as standalone (or the guide you followed^^ )

Well my automation would require you to add your HA instance’s SSH key to the UNAS, so if you said you have next to no SSH/Linux experience then that might not be the best approach. I also didn’t really have a guide I followed, it’s just UPS → NUT integration → automation → triggers some shell commands in configuration.yaml → shuts down the UNAS via SSH.

But sure, I can add a shutdown and reboot button to the integration in the next release, not a problem. You’ll just need to use it with some sort of automation and/or NUT integration to make it work however you want.

As for turning it on afterwards using a smart plug, I think that would also fall under the category of things to use an automation for.

That would be amazing. I’m currently stuck ond the shell commands, automations are easy and NUT is up and running to shutdown other appliances.
For the Smart plug I had the Bambulab Card in my mind, but thats just a card config - does not fit into an integration.
I’ll run it over a Tretakt or Inspelning. Thanks!

Just added both shutdown and reboot buttons in the latest v0.5.2 release.

Both do it gracefully, i.e. terminate all processes, etc. the same way as shutting down or rebooting via the UNAS would.

1 Like