Complete Home Assistant custom integration for monitoring and controlling Unraid servers via the Unraid Management Agent.
- System Metrics: CPU usage, RAM usage, CPU temperature, uptime
- Array Status: Array state, disk usage, parity check progress
- ZFS Storage: Pool capacity, health, fragmentation, ARC cache statistics
- GPU Metrics: GPU utilization, temperature, power consumption (Intel/NVIDIA/AMD)
- Network: Interface status, bandwidth monitoring (RX/TX)
- UPS: Battery level, load, runtime estimation
- Containers: Docker container status and metrics
- Virtual Machines: VM status and resource allocation
- Docker Containers: Start, stop, restart containers via switches
- Virtual Machines: Start, stop, restart VMs via switches
- Array Management: Start/stop array with buttons
- Parity Checks: Start/stop parity checks with buttons
- WebSocket Support: Instant state updates (<1s latency)
- Automatic Fallback: Falls back to REST API polling if WebSocket fails
- Exponential Backoff: Smart reconnection strategy
- No Data Loss: Seamless transition between WebSocket and polling
- Collector-Based Filtering: Only creates entities for enabled collectors on your Unraid server
- Physical Disk Detection: Automatically filters out virtual disks (docker_vdisk, log) and empty disk slots
- Dynamic Discovery: Automatically discovers containers, VMs, disks, network interfaces, and more
- Minimal Clutter: Disabled collectors result in no orphan entities
- UI Configuration: No YAML required for setup
- Device Grouping: All entities grouped under single device
- Proper Device Classes: Temperature, power, battery, duration, etc.
- State Classes: Support for statistics and long-term data
- MDI Icons: Beautiful Material Design Icons for all entities
- Extra Attributes: Contextual information for each entity
Before installing this Home Assistant integration, you must have the Unraid Management Agent plugin installed and running on your Unraid server.
The Unraid Management Agent is a plugin that runs on your Unraid server and provides the API that this Home Assistant integration connects to.
- Open your Unraid web interface
- Go to Apps tab
- Search for "Unraid Management Agent"
- Click Install
- Configure the plugin settings (default port: 8043)
- Start the plugin
- Open your Unraid web interface
- Go to Plugins tab
- Click Install Plugin
- Paste this URL:
https://raw.githubusercontent.com/ruaan-deysel/unraid-management-agent/main/unraid-management-agent.plg - Click Install
- Configure the plugin settings (default port: 8043)
- Start the plugin
After installation, verify the plugin is running by accessing:
http://<your-unraid-ip>:8043/api/v1/health
You should see a JSON response indicating the service is healthy.
- Unraid Server: Unraid 6.9.0 or newer
- Home Assistant: 2025.1 or newer
- Network: Home Assistant must be able to reach your Unraid server on port 8043 (or your configured port)
Ensure your firewall allows:
- Port 8043 (or your configured port) for REST API communication
- WebSocket connections on the same port for real-time updates
Manual HACS Installation:
- Open HACS in Home Assistant
- Go to Integrations
- Click the โฎ menu โ Custom repositories
- Add this repository:
https://github.com/ruaan-deysel/ha-unraid-management-agent - Category: Integration
- Click Add
- Search for Unraid Management Agent
- Click Download
- Restart Home Assistant
- Download the latest release from the Releases page
- Extract the
unraid_management_agentfolder to your Home Assistantconfig/custom_components/directory - Restart Home Assistant
- Go to Settings โ Devices & Services
- Click + Add Integration
- Search for "Unraid Management Agent"
- Enter your Unraid server details:
- Host:
192.168.1.100(your Unraid IP) - Port:
8043(default) - Update Interval:
30seconds - Enable WebSocket:
true(recommended)
- Host:
System Sensors (6+ entities)
- CPU Usage (%)
- RAM Usage (%)
- CPU Temperature (ยฐC)
- Motherboard Temperature (ยฐC) - conditional, only if available
- Fan {name} (RPM) - dynamic, one per detected fan
- Uptime (human-readable format)
Array Sensors (2 entities)
- Array Usage (%)
- Parity Check Progress (%)
Disk Sensors (dynamic)
- Disk {name} Usage (%) - dynamic, one per disk (excludes parity disks)
- Disk {name} Health - dynamic, one per physical disk with SMART data
- Docker vDisk Usage (%) - conditional, only if Docker vDisk exists
- Log Filesystem Usage (%) - conditional, only if log filesystem exists
GPU Sensors (3 entities, conditional)
- GPU Utilization (%)
- GPU CPU Temperature (ยฐC)
- GPU Power (W)
UPS Sensors (4 entities, conditional)
- UPS Battery (%)
- UPS Load (%)
- UPS Runtime (seconds)
- UPS Power (W) - compatible with Home Assistant Energy Dashboard
Network Sensors (dynamic)
- Network {interface} Inbound (bits/s) - one per physical interface
- Network {interface} Outbound (bits/s) - one per physical interface
Array Binary Sensors (3)
- Array Started (on/off)
- Parity Check Running (on/off)
- Parity Valid (problem indicator)
UPS Binary Sensor (1, conditional)
- UPS Connected (on/off)
Container Binary Sensors (dynamic)
- Container {name} (running/stopped)
VM Binary Sensors (dynamic)
- VM {name} (running/stopped)
Network Binary Sensors (dynamic)
- Network {interface} (up/down)
- Container {name} - Start/stop Docker containers
- VM {name} - Start/stop virtual machines
- Start Array
- Stop Array
- Start Parity Check
- Stop Parity Check
The integration provides 18 services for advanced automation and control beyond what switches and buttons offer.
unraid_management_agent.container_start- Start a Docker containerunraid_management_agent.container_stop- Stop a Docker containerunraid_management_agent.container_restart- Restart a Docker containerunraid_management_agent.container_pause- Pause a running Docker containerunraid_management_agent.container_resume- Resume a paused Docker container (unpause)
Example:
service: unraid_management_agent.container_start
data:
container_id: "plex"unraid_management_agent.vm_start- Start a virtual machineunraid_management_agent.vm_stop- Stop a virtual machine (graceful shutdown)unraid_management_agent.vm_restart- Restart a virtual machineunraid_management_agent.vm_pause- Pause a running virtual machine (suspend to RAM)unraid_management_agent.vm_resume- Resume a paused virtual machineunraid_management_agent.vm_hibernate- Hibernate a virtual machine (suspend to disk)unraid_management_agent.vm_force_stop- Force stop a virtual machine (equivalent to power off)
Example:
service: unraid_management_agent.vm_hibernate
data:
vm_id: "Windows 10"unraid_management_agent.array_start- Start the Unraid arrayunraid_management_agent.array_stop- Stop the Unraid array
Example:
service: unraid_management_agent.array_startunraid_management_agent.parity_check_start- Start a parity checkunraid_management_agent.parity_check_stop- Stop the running parity checkunraid_management_agent.parity_check_pause- Pause the running parity checkunraid_management_agent.parity_check_resume- Resume a paused parity check
Example:
service: unraid_management_agent.parity_check_pauseNote: Replace
towerin the entity IDs below with your actual Unraid server hostname (e.g., if your Unraid server is named "nas", usesensor.unraid_nas_cpu_usage).
automation:
- alias: "Unraid High CPU Alert"
trigger:
- platform: numeric_state
entity_id: sensor.unraid_tower_cpu_usage
above: 80
for:
minutes: 5
action:
- service: notify.mobile_app
data:
title: "โ ๏ธ Unraid Alert"
message: "CPU usage is {{ states('sensor.unraid_tower_cpu_usage') }}%"automation:
- alias: "Unraid UPS Critical Shutdown"
trigger:
- platform: numeric_state
entity_id: sensor.unraid_tower_ups_battery
below: 10
action:
- service: switch.turn_off
target:
entity_id: all
data:
domain: switch
- delay:
seconds: 30
- service: button.press
target:
entity_id: button.unraid_tower_stop_arrayautomation:
- alias: "Unraid Disk Health Alert"
trigger:
- platform: state
entity_id: sensor.unraid_tower_disk_disk1_health
to: "Failed"
action:
- service: notify.mobile_app
data:
title: "๐จ Unraid Disk Alert"
message: "Disk 1 health status is {{ states('sensor.unraid_tower_disk_disk1_health') }}"automation:
- alias: "Restart Plex on Stop"
trigger:
- platform: state
entity_id: switch.unraid_tower_container_plex
to: "off"
for:
minutes: 1
action:
- service: unraid_management_agent.container_start
data:
container_id: "plex"- API Client (
api_client.py) - REST API communication with aiohttp - WebSocket Client (
websocket_client.py) - Real-time event streaming - Data Coordinator (
__init__.py) - Data management and updates - Config Flow (
config_flow.py) - UI-based configuration - Platforms:
sensor.py- System, array, GPU, UPS, network sensorsbinary_sensor.py- Status indicatorsswitch.py- Container and VM controlbutton.py- Array and parity check control
Unraid Server (REST API + WebSocket)
โ
API Client / WebSocket Client
โ
Data Update Coordinator
โ
Entity Platforms (Sensor, Binary Sensor, Switch, Button)
โ
Home Assistant UI- Initial Load: REST API fetches all data on startup
- Real-Time Updates: WebSocket receives events and updates coordinator
- Fallback Polling: REST API polls at configured interval if WebSocket fails
- Control Actions: REST API sends commands, coordinator refreshes immediately
Cannot Connect
- Verify Unraid Management Agent is running:
curl http://<ip>:8043/api/v1/health - Check firewall rules allow port 8043
- Ensure Home Assistant can reach Unraid server
WebSocket Not Working
- Check logs for WebSocket errors
- Verify no proxy blocking WebSocket
- Integration will fall back to REST polling automatically
Entities Not Updating
- Check update interval in options
- Verify WebSocket connection in logs
- Test REST API manually
Missing Entities
- Verify resources exist on Unraid (containers, VMs, GPU, UPS)
- Reload integration
- Check logs for entity creation errors
ha-unraid-management-agent/
โโโ custom_components/
โ โโโ unraid_management_agent/
โ โโโ __init__.py # Integration setup
โ โโโ api_client.py # REST API client
โ โโโ binary_sensor.py # Binary sensor platform
โ โโโ button.py # Button platform
โ โโโ config_flow.py # Configuration flow
โ โโโ const.py # Constants
โ โโโ manifest.json # Integration metadata
โ โโโ sensor.py # Sensor platform
โ โโโ strings.json # Translations
โ โโโ switch.py # Switch platform
โ โโโ websocket_client.py # WebSocket client
โโโ README.md # This fileRun the test suite:
# Run all tests
pytest
# Run tests with coverage report
pytest --cov --cov-report=term-missing --cov-report=html
# Run specific test file
pytest tests/test_coordinator.py -v
# Run tests in parallel
pytest -n autoCI/CD Pipeline:
- Automated tests run on every push and pull request
- Tests run on Python 3.12 and 3.13
- Coverage reports automatically uploaded to Codecov
- Test results tracked in GitHub Actions
Coverage Requirements:
- Minimum coverage: 60%
- Coverage reports available at Codecov
-
Install in development mode
-
Enable debug logging:
logger: default: info logs: custom_components.unraid_management_agent: debug
-
Check logs for errors
-
Test all entity types
-
Test control operations
-
Test WebSocket reconnection
This integration follows semantic versioning with the format vYYYY.MM.x (e.g., v2025.11.1).
Check the Releases page for the latest version and changelog.
Releases are automated via GitHub Actions:
- Update
manifest.jsonversion - Update
CHANGELOG.mdwith release notes - Create and push a version tag (e.g.,
v2025.11.1) - GitHub Actions automatically builds and publishes the release
For detailed release process documentation, see docs/RELEASE_PROCESS.md.
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run linting and tests:
scripts/lint pytest
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development Guidelines:
- Follow Home Assistant core integration best practices
- Maintain 60%+ code coverage
- Use type hints throughout
- Add tests for new features
- Update documentation as needed
CI Checks: All pull requests must pass:
- โ Ruff linting (format and check)
- โ Pytest test suite (Python 3.12 & 3.13)
- โ Coverage threshold (60% minimum)
- โ Manifest and configuration validation
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Unraidยฎ is a registered trademark of Lime Technology, Inc. This application is not affiliated with, endorsed, or sponsored by Lime Technology, Inc.