This custom integration allows you to monitor and control your Unraid server from Home Assistant. Unraid is a popular NAS (Network Attached Storage) operating system that provides flexible storage, virtualization, and application support.
Due to time constraints, I am no longer able to actively develop and support this integration.
I encourage users to check out chris-mc1's Unraid API integration, which is under active development and provides an alternative solution for integrating Unraid with Home Assistant.
- This repository will remain available for reference and forking
- No new features or bug fixes will be implemented
- Pull requests may not be reviewed or merged
- Issues will not be actively addressed
Thank you for your understanding and support. I hope the recommended alternative integration serves your needs well.
- Monitor CPU, RAM, Boot, Cache, Array Disks, and Array usage
- Monitor CPU and Motherboard temperature
- Monitor System Fans
- Monitor UPS Connected
- Control Docker containers
- Control VMs
- Execute shell commands
- Buttons for user scripts
- Manage user scripts
- Automatic repair flows for common issues
- Advanced config flow validation
- Comprehensive diagnostics
- Copy the
unraidfolder into yourcustom_componentsdirectory. - Restart Home Assistant.
- Go to Configuration > Integrations.
- Click the "+ ADD INTEGRATION" button.
- Search for "Unraid" and select it.
- Follow the configuration steps.
IMPORTANT: SSH is disabled by default. SSH needs to be enabled on Unraid --> Settings --> Management Access
During the setup, you'll need to provide:
- Host: The IP address or hostname of your Unraid server
- Username: Your Unraid username (usually 'root')
- Password: Your Unraid password
- Port: SSH port (usually 22)
- General Update Interval (Minutes): How often to update non-disk sensors (1-60 minutes). Default is 5 minutes.
- Disk Update Interval (Hours): How often to update disk information (1-24 hours). Default is 1 hour
Note: Setting lower intervals will provide more up-to-date information but may increase system load.
- CPU Usage: Shows the current CPU utilization percentage.
- RAM Usage: Displays the current RAM usage percentage.
- CPU and Motherboard Temps: Shows CPU and Motherboard temperatures
- System Fans : Shows System Fans and RPM
- Array Usage: Shows the overall array usage percentage.
- Individual Array Disks: Displays usage information for each disk in the array.
- Uptime: Shows how long the Unraid server has been running.
- UPS Power: Displays information about the UPS power consumption
- UPS Status: Displays information about the connected UPS (if available).
- Disk Health: Displays disk health information
- VM and Docker Service: Displays information about docker and vm services
- SSH Connectivity: Display information about integration connected to Unraid via SSH
- Parity Check: Displays information if parity check is enabled.
The integration includes automatic repair flows for common issues:
- Connection Issues: Helps you fix connection problems to your Unraid server
- Authentication Problems: Guides you through fixing authentication issues
- Disk Health Issues: Alerts you about potential disk failures and provides guidance
- Array Problems: Notifies you about array issues and suggests solutions
- Parity Check Failures: Alerts you about parity check failures
The integration includes advanced validation during setup:
- Hostname/IP Validation: Ensures the hostname or IP address is in a valid format
- Port Validation: Verifies the SSH port is within a valid range (1-65535)
- Credential Validation: Ensures username and password are not empty
- Connection Testing: Tests the connection before completing setup
- Docker Containers: Turn on/off Docker containers
- VMs: Turn on/off Virtual Machines
unraid.execute_command: Execute a shell command on the Unraid serverunraid.execute_in_container: Execute a command in a Docker containerunraid.execute_user_script: Execute a user scriptunraid.stop_user_script: Stop a running user scriptunraid.system_reboot: Reboot Unraidunraid.system_shutdown: Shutdown Unraid
unraid.docker_pause: Pause a running Docker containerunraid.docker_resume: Resume a paused Docker containerunraid.docker_restart: Restart a Docker container
unraid.vm_pause: Pause a running virtual machineunraid.vm_resume: Resume a paused virtual machineunraid.vm_restart: Restart a running virtual machineunraid.vm_hibernate: Hibernate a running virtual machine (suspend to disk)unraid.vm_force_stop: Force stop a virtual machine (equivalent to pulling the power plug)
- Buttons to control user scripts (Disabled by default)
- Buttons to control system reboot and shutdown (Disabled by default)
- Ensure SSH is enabled on your Unraid server (Settings > Management Access)
- Verify the hostname/IP address is correct
- Check that the SSH port is correct (usually 22)
- Ensure your username and password are correct
- Check your network connectivity
- Increase the update intervals if the integration is causing high CPU usage
- Disable sensors you don't need
- Ensure your Unraid server has adequate resources
Comprehensive documentation is available on our Documentation Site:
- Installation Guide
- Features Overview
- Examples and Use Cases
- Troubleshooting Guide
- Docker Management
- VM Control
- User Scripts
- Contributing Guide
This project provides a complete development environment using Visual Studio Code Dev Containers, making it easy for contributors to get started with a fully configured Home Assistant development setup.
Before setting up the development environment, ensure you have the following installed:
- Docker: Required for running the development container
- Install Docker Desktop (Windows/Mac)
- Install Docker Engine (Linux)
- Visual Studio Code: The primary development environment
- Dev Containers Extension: Enables devcontainer support in VS Code
The project includes a pre-configured development container that provides:
- Python 3.13 environment
- Home Assistant with debugging capabilities
- Pre-installed development dependencies (ruff, colorlog, asyncssh)
- VS Code extensions for Python development, linting, and GitHub integration
- Automatic port forwarding for Home Assistant (port 8123)
-
Clone the repository:
git clone https://github.com/domalab/ha-unraid.git cd ha-unraid -
Open in VS Code:
code . -
Open in Dev Container:
- When VS Code opens, you should see a notification to "Reopen in Container"
- Alternatively, press
Ctrl+Shift+P(orCmd+Shift+Pon Mac) and select "Dev Containers: Reopen in Container" - Or click the green button in the bottom-left corner and select "Reopen in Container"
-
Wait for container setup:
- The container will build and install dependencies automatically
- The
scripts/setupcommand runs automatically to install Python requirements
The development environment includes a dedicated script to run Home Assistant with the integration loaded:
scripts/developThis command:
- Creates a
configdirectory if it doesn't exist - Initializes Home Assistant configuration
- Sets up the Python path to include the custom components
- Starts Home Assistant in debug mode with the integration loaded
- Makes Home Assistant available at
http://localhost:8123
The project uses Ruff for code formatting and linting:
scripts/lintThis command:
- Formats code according to project standards
- Fixes linting issues automatically where possible
- Should be run before committing changes
-
Start the development environment:
scripts/develop
-
Access Home Assistant:
- Open your browser to
http://localhost:8123 - Complete the initial Home Assistant setup if prompted
- Open your browser to
-
Add the Unraid integration:
- Go to Settings → Devices & Services
- Click "Add Integration"
- Search for "Unraid" and configure with your Unraid server details
-
Debug and develop:
- The integration runs with debug logging enabled
- Check the Home Assistant logs for detailed information
- Make changes to the code and restart Home Assistant to test
.devcontainer.json: Defines the development container configurationconfig/configuration.yaml: Home Assistant configuration for developmentscripts/setup: Installs Python dependenciesscripts/develop: Starts Home Assistant in development modescripts/lint: Formats and lints the coderequirements.txt: Python dependencies for development
The development Home Assistant instance is configured with:
- Debug mode enabled
- Debug logging for the Unraid integration
- Default Home Assistant integrations loaded
- Custom components path set to include this project
- Setup environment:
scripts/setup - Start development server:
scripts/develop - Format and lint code:
scripts/lint
- Hot reload: Restart Home Assistant to see code changes
- Debugging: Use VS Code's integrated debugger with the Python extension
- Logging: Check Home Assistant logs for integration-specific debug information
- Testing: Test with a real Unraid server or mock the SSH connections for unit testing
The devcontainer automatically installs these helpful extensions:
- Ruff: Python linting and formatting
- Python & Pylance: Python language support and IntelliSense
- GitHub Pull Requests: GitHub integration for pull requests
- Coverage Gutters: Code coverage visualization
The development container automatically forwards:
- Port 8123: Home Assistant web interface
Contributions to this integration are welcome. Please fork the repository and submit a pull request with your changes. Make sure to follow the contribution guidelines and use the development environment described above. See our Contributing Guide for more details.
- Set up the development environment using the instructions above
- Create a new branch for your feature or bug fix
- Make your changes and test them using
scripts/develop - Run
scripts/lintto ensure code quality - Test your changes thoroughly with a real Unraid server
- Submit a pull request with a clear description of your changes
This integration is released under the Apache License.
This integration is not officially associated with or endorsed by UNRAID. UNRAID trademarks belong to UNRAID, and this integration is independently developed.