Running Home Assistant in Your Home Lab
Home Assistant is the gravitational center of most smart home setups, and for good reason. It's open source, runs locally, supports over 2,000 integrations, and gives you control over your devices without relying on cloud services that could shut down or change their terms tomorrow. If you already have a homelab, you have most of what you need to run it.
This guide covers how to install Home Assistant in a homelab context, how to set up the wireless protocols your devices actually use, how to build automations that are genuinely useful, and where Home Assistant shines compared to alternatives like OpenHAB.
Choosing an Installation Method
Home Assistant comes in several flavors, and picking the right one matters more than you'd think. The experience varies significantly depending on which route you go.
Home Assistant Operating System (HAOS)
This is the full-fat, officially recommended option. HAOS is a minimal Linux distribution that runs Home Assistant and its Supervisor, which manages add-ons, backups, and updates through the UI.
Best for: Dedicated hardware (NUC, Raspberry Pi, or a VM on Proxmox/ESXi).
Pros: Full add-on store, one-click updates, automatic backups, easiest to manage. Cons: Takes over the entire machine (or VM). You can't easily run other things alongside it.
For a Proxmox VM, which is the most common homelab setup:
# Download the HAOS qcow2 image
wget https://github.com/home-assistant/operating-system/releases/download/14.2/haos_ova-14.2.qcow2.xz
unxz haos_ova-14.2.qcow2.xz
# Create a VM in Proxmox (adjust VM ID as needed)
qm create 100 --name homeassistant --memory 4096 --cores 2 --net0 virtio,bridge=vmbr0
qm importdisk 100 haos_ova-14.2.qcow2 local-lvm
qm set 100 --scsihw virtio-scsi-pci --scsi0 local-lvm:vm-100-disk-0
qm set 100 --boot order=scsi0
qm set 100 --serial0 socket --vga serial0
qm set 100 --machine q35
qm start 100
Give the VM at least 2 cores, 4 GB RAM, and 32 GB of disk. After booting, Home Assistant will be available at http://<vm-ip>:8123 within a few minutes.
Home Assistant Container (Docker)
Runs as a Docker container. You get the core Home Assistant experience but without the Supervisor, which means no add-on store and no built-in backup management.
Best for: Docker-centric homelabs where you already manage everything via Docker Compose.
Pros: Runs alongside your other containers, lightweight, easy to integrate with existing Docker workflows. Cons: No add-on store (you install Mosquitto, Node-RED, etc. as separate containers). No built-in backup UI.
# docker-compose.yml
services:
homeassistant:
image: ghcr.io/home-assistant/home-assistant:stable
container_name: homeassistant
restart: unless-stopped
network_mode: host
privileged: true
volumes:
- ./config:/config
- /run/dbus:/run/dbus:ro
environment:
TZ: "America/New_York"
The network_mode: host and privileged: true flags are important. Home Assistant needs host networking for mDNS/SSDP discovery (how it finds devices on your network), and privileged mode for USB device access (Zigbee/Z-Wave dongles).
docker compose up -d
Home Assistant Core (Python venv)
A bare Python installation. You install it in a virtual environment and manage everything yourself.
Best for: Advanced users who want complete control and are comfortable managing Python dependencies.
sudo apt install python3 python3-dev python3-venv python3-pip \
bluez libffi-dev libssl-dev libjpeg-dev zlib1g-dev \
autoconf build-essential libopenjp2-7 libtiff6
python3 -m venv /srv/homeassistant
source /srv/homeassistant/bin/activate
pip install homeassistant
hass
Unless you have a specific reason to go this route, use HAOS or Docker instead. Core installations require manual dependency management that gets tedious.
Which Should You Pick?
If you're running Proxmox and can spare a VM, go with HAOS. The add-on store and integrated backup system save enough time to justify a dedicated VM. If your homelab is purely Docker-based with no hypervisor, the Container install works well but requires more manual work for ancillary services. Core is for edge cases.
Setting Up Zigbee and Z-Wave
Most smart home devices use either Zigbee or Z-Wave, not Wi-Fi. These mesh protocols are more reliable, use less power, and don't clog your Wi-Fi network. You need a USB coordinator to talk to them.
Zigbee
The recommended coordinator is the SONOFF Zigbee 3.0 USB Dongle Plus (the one with the "E" suffix, based on the EFR32MG21 chip). It's about $30 and works with the most popular Zigbee integrations.
For the integration layer, you have two choices:
Zigbee2MQTT (recommended): Runs as a separate service, bridges Zigbee devices to MQTT, and gives you a standalone web UI for device management.
ZHA (Zigbee Home Automation): Built into Home Assistant. Simpler setup but fewer configuration options.
To use Zigbee2MQTT with Docker:
# Add to your docker-compose.yml
services:
zigbee2mqtt:
image: koenkk/zigbee2mqtt:latest
container_name: zigbee2mqtt
restart: unless-stopped
ports:
- "8080:8080"
volumes:
- ./zigbee2mqtt-data:/app/data
- /run/udev:/run/udev:ro
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
environment:
TZ: "America/New_York"
Configure /zigbee2mqtt-data/configuration.yaml:
homeassistant: true
permit_join: false
mqtt:
base_topic: zigbee2mqtt
server: mqtt://mosquitto:1883
serial:
port: /dev/ttyUSB0
frontend:
port: 8080
advanced:
network_key: GENERATE
channel: 20
A note on channel selection: Zigbee and Wi-Fi share the 2.4 GHz band. Zigbee channel 20 or 25 avoids overlap with the most common Wi-Fi channels (1, 6, 11). Check your Wi-Fi channel and pick a Zigbee channel that doesn't collide.
If you're running HAOS, install the Zigbee2MQTT add-on from the add-on store instead. It handles all of this for you.
Z-Wave
Z-Wave operates on the 800-900 MHz band, so there's no Wi-Fi interference. The Zooz ZST39 LR stick is a solid choice and supports Z-Wave Long Range.
In HAOS, use the Z-Wave JS add-on. For Docker:
zwave-js-ui:
image: zwavejs/zwave-js-ui:latest
container_name: zwave-js-ui
restart: unless-stopped
ports:
- "8091:8091"
- "3000:3000"
volumes:
- ./zwave-data:/usr/src/app/store
devices:
- /dev/ttyUSB1:/dev/zwave
environment:
TZ: "America/New_York"
USB Passthrough in Proxmox
If Home Assistant runs in a VM, you need to pass the USB coordinator through to the VM. In the Proxmox UI:
- Go to VM > Hardware > Add > USB Device
- Select "Use USB Vendor/Device ID"
- Pick your Zigbee or Z-Wave stick from the list
Alternatively, via CLI:
# Find the device
lsusb
# Example output: Bus 001 Device 003: ID 1a86:55d4 QinHeng Electronics SONOFF Zigbee 3.0 USB Dongle Plus V2
# Add to VM config
qm set 100 -usb0 host=1a86:55d4
Restart the VM after adding the passthrough.
MQTT: The Smart Home Message Bus
MQTT is the messaging protocol that ties everything together. Zigbee2MQTT publishes device states to MQTT topics. Home Assistant subscribes to those topics. Other services (Node-RED, custom scripts) can tap into the same stream.
Run an MQTT broker (Mosquitto):
mosquitto:
image: eclipse-mosquitto:2
container_name: mosquitto
restart: unless-stopped
ports:
- "1883:1883"
volumes:
- ./mosquitto/config:/mosquitto/config
- ./mosquitto/data:/mosquitto/data
- ./mosquitto/log:/mosquitto/log
Create mosquitto/config/mosquitto.conf:
persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log
listener 1883
allow_anonymous false
password_file /mosquitto/config/passwordfile
Set up a user:
docker exec -it mosquitto mosquitto_passwd -c /mosquitto/config/passwordfile homeassistant
Then add the MQTT integration in Home Assistant: Settings > Devices & Services > Add Integration > MQTT. Point it to your broker's IP on port 1883 with the credentials you created.
ESPHome: Custom Sensors on the Cheap
ESPHome lets you flash ESP32/ESP8266 microcontrollers with custom firmware, turning $5 boards into sensors and controllers that integrate directly with Home Assistant.
A simple temperature and humidity sensor:
# esphome/office-climate.yaml
esphome:
name: office-climate
esp32:
board: esp32dev
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
api:
encryption:
key: !secret esphome_api_key
sensor:
- platform: dht
pin: GPIO4
temperature:
name: "Office Temperature"
humidity:
name: "Office Humidity"
update_interval: 60s
- platform: adc
pin: GPIO34
name: "Office Light Level"
update_interval: 30s
ESPHome compiles the YAML into firmware and flashes it over USB (first time) or OTA (subsequent updates). The devices connect to Home Assistant automatically via its native API — no MQTT needed, though MQTT is an option too.
Common ESPHome projects for homelabs:
- Server room temp/humidity sensors ($8: ESP32 + DHT22)
- Rack door open/close sensor ($6: ESP32 + reed switch)
- Power monitoring ($15: ESP32 + CT clamp)
- Presence detection ($5: ESP32 with Bluetooth proxy for room-level tracking)
Building Useful Automations
The automation engine is where Home Assistant earns its name. Automations are defined as triggers, conditions, and actions.
YAML vs UI
You can create automations through the UI (Settings > Automations) or in YAML (automations.yaml). The UI is fine for simple automations. For anything complex, YAML is more readable and version-controllable.
Example: Turn Off Lights When Nobody's Home
automation:
- alias: "Lights off when away"
trigger:
- platform: state
entity_id: group.family
to: "not_home"
for: "00:10:00"
action:
- service: light.turn_off
target:
entity_id: all
Example: Morning Routine
- alias: "Morning routine"
trigger:
- platform: time
at: "06:30:00"
condition:
- condition: state
entity_id: binary_sensor.workday_sensor
state: "on"
action:
- service: light.turn_on
target:
entity_id: light.bedroom
data:
brightness_pct: 30
color_temp_kelvin: 3000
- delay: "00:15:00"
- service: light.turn_on
target:
entity_id: light.bedroom
data:
brightness_pct: 80
color_temp_kelvin: 4500
Example: Server Room Temperature Alert
- alias: "Server room too hot"
trigger:
- platform: numeric_state
entity_id: sensor.server_room_temperature
above: 35
for: "00:05:00"
action:
- service: notify.mobile_app_phone
data:
title: "Server Room Alert"
message: "Temperature is {{ states('sensor.server_room_temperature') }}C"
- service: fan.turn_on
target:
entity_id: fan.server_room_exhaust
This is where ESPHome sensors in your server rack pay off. A $8 temperature sensor that triggers a notification before your hardware cooks itself is cheap insurance.
Energy Monitoring
Home Assistant's energy dashboard tracks power consumption across your home and, importantly for homelabbers, your lab equipment.
Whole-Home Monitoring
A Shelly EM clipped to your electrical panel gives whole-home consumption data. It integrates natively with Home Assistant over Wi-Fi.
Per-Device Monitoring
Smart plugs with energy monitoring (like the Shelly Plug S or Zigbee smart plugs with metering) track individual devices. Put one on your server rack's power strip to see exactly what your homelab costs to run.
# Energy dashboard configuration
# Settings > Dashboards > Energy
# Add your energy-monitoring entities as consumption sources
Over time, the energy dashboard shows you trends, costs, and helps you identify power-hungry equipment. Many homelabbers are surprised to learn their NAS draws more power than their hypervisor.
Dashboards
The default Lovelace dashboard is functional but generic. Custom dashboards make Home Assistant genuinely useful at a glance.
Card Types That Matter
- Glance card: Quick status overview of multiple entities
- Thermostat card: Full climate control
- Gauge card: Visual representation of single values (temperature, humidity, power)
- Conditional card: Shows/hides based on state (only show the garage door card when it's open)
- Mushroom cards (HACS): A popular community card set with a clean, modern look
A Homelab Monitoring Dashboard
views:
- title: Homelab
cards:
- type: entities
title: Server Status
entities:
- entity: binary_sensor.proxmox_running
name: Proxmox
- entity: binary_sensor.nas_running
name: NAS
- entity: sensor.server_room_temperature
name: Rack Temperature
- entity: sensor.rack_power
name: Rack Power Draw
- type: gauge
entity: sensor.server_room_temperature
name: Server Room
min: 15
max: 45
severity:
green: 15
yellow: 30
red: 35
- type: history-graph
title: Power Consumption (24h)
hours_to_show: 24
entities:
- entity: sensor.rack_power
Home Assistant vs OpenHAB
OpenHAB is the other major open-source home automation platform. Both are mature, both run locally, and both have large communities. Here's how they compare honestly:
Home Assistant wins on:
- Ease of setup: HAOS and the add-on store make the initial experience much smoother.
- Integration count: Over 2,000 integrations, most maintained by an active community. OpenHAB has fewer, though the important ones are covered.
- UI/UX: Lovelace dashboards and the mobile app are polished. OpenHAB's UI has improved but still feels more utilitarian.
- Community momentum: Larger community, faster development cycle, more third-party resources.
OpenHAB wins on:
- Rule engine flexibility: OpenHAB's rule system is more powerful for complex logic. It supports multiple scripting languages (JavaScript, Groovy, Jython) natively.
- Stability: OpenHAB releases less frequently with longer support cycles. Home Assistant's aggressive monthly releases occasionally break things.
- Java ecosystem: If you're already a Java/JVM person, OpenHAB feels natural.
For most homelabbers, Home Assistant is the better choice. The integration ecosystem and community support are hard to beat. But if you need complex rule logic and value stability over features, OpenHAB is worth evaluating.
Practical Tips
Use a static IP or DHCP reservation for your Home Assistant instance. If its IP changes, every integration that uses IP-based discovery will break.
Back up regularly. HAOS has built-in backups. For Docker, back up the /config directory. Include your Zigbee2MQTT data directory too — re-pairing dozens of Zigbee devices is miserable.
Use the companion app. The Home Assistant mobile app (iOS and Android) provides location tracking for presence detection, push notifications for alerts, and quick access to controls. It's one of the better-designed self-hosted mobile apps out there.
Start simple. Don't automate everything on day one. Live with your sensors and devices for a week. Notice your patterns. Then automate the things you actually do repeatedly. The best automations are the ones you forget exist because they just work.
Version control your config. Home Assistant's YAML configuration is perfect for Git. Track changes, roll back mistakes, and document why you configured things a certain way.
cd /path/to/homeassistant/config
git init
echo "*.db" >> .gitignore
echo "*.log" >> .gitignore
echo "tts/" >> .gitignore
echo ".storage/" >> .gitignore
git add -A && git commit -m "Initial HA config"
Home Assistant turns your homelab from a collection of servers into an integrated system. Your rack temperature sensor triggers a fan. Your energy monitor shows you what it all costs. Your presence detection turns off lights when you leave the house. It's the layer that connects the digital infrastructure to the physical space — and in a homelab, that's where things get genuinely fun.