Icon made by Freepik
A new UI and API for controlling multiple unraid instances and connecting them to the Home Assistant Fork of the original project which is abandoned ElectricBrainUK/UnraidAPI
The tags follow the unraid major releases and should work for minor also:
docker pull bokker/unraidapi-re:6.12
for unraid 6.12
- Install CA: Youtube guide installing CA on unraid & CA support unraid forums
- Go to the
apps
tab and search forunraid-api
and install it.
- Add the following custom repository: https://github.com/BoKKeR/unraidapi-re
- Build the Addon
- Fill in the config section
- Start
Name | Type | Default | Description |
---|---|---|---|
MQTTBroker | string | Required if enabled | Your broker ip-address or domain e.g. hassio |
MQTTPort | number | Required if enabled | 1883 (Plain) / 8883 (SSL on hassio) |
MQTTUser | string | none | MQTT username |
MQTTPass | string | none | MQTT password |
MQTTBaseTopic | string | homeassistant | The base topic for all MQTT publishes |
MQTTSecure | boolean | false | For MQTT Over SSL set to true |
MQTTSelfSigned | boolean | false | If you are using a self signed certificate set to true |
MQTTRefreshRate | number | 60 | Time in seconds to poll for updates |
MQTTCacheTime | number | 60 | Time in minutes after which all entities will be updated in MQTT |
LOG_LEVEL | string | info | info, debug, error, warn |
KeyStorage | string | config | Where to store the secure keys. If left blank the keys are kept in memory and will be destroyed each time the container is updated. Set to config to have the data persist |
WRITE_HTML_OUTPUT | boolean | false | Writes the html files it scrapes to config/html_output |
Docker host port | number | 3005 | Default web-UI port. Container 80:3005 host |
Check out the HA docs on how to set up discovery for MQTT here: https://www.home-assistant.io/docs/mqtt/discovery/
Use the env variable section to set up the MQTT client and connect to your MQTT broker. If auto discovery is enabled in home assistant the following will be created:
- An entity for each of your servers
- (sensor) Monitor server status
- (switch) On/Off switch allows you to start stop array
- An entity for each of your VMs
- (switch) On/Off toggle VM state
- (switch) A seperate entity with a switch to attach / detach any usbs to that vm
- (sensor) Whether or not a particular usb device is connected to the machine (can be used to automate hotplugging e.g. when connected toggle the usb switch off and on again)
- An entity for each of your dockers
- (switch) On/Off toggle Docker state
You will end up having entities like these:
- binary_sensor.unraid_server (Server info in attributes)
- binary_sensor.unraid_vm_VMNAME_usb_USBDEVICE
- sensor.unraid_vm_VMNAME_status (VM stats in attributes)
- switch.unraid_array
- switch.unraid_docker_DOCKERNAME (Docker info in attributes)
- switch.unraid_vm_VMNAME (VM info in attributes)
Manual Config Example: The server and VM names are as they are in MQTT (spaces are underscores and all lower case) The payload options are started, stopped, paused, restart, kill, hibernate
- platform: mqtt
command_topic: "homeassistant/servername/vmname/state"
payload_on: "started"
payload_off: "stopped"
When connecting the unraid api to an mqtt broker config details for all the various api functions are posted under the various homeassistant entity types. For example under homeassistant/switch/server/vm/config.