In Part 9 of the Home Lab Series:
- The Goal: Installing the central brain of your smart home.
- The Stack: Deploying Home Assistant Container via Docker.
- The Bridge: Connecting HA to the MQTT Broker (from Part 8).
- Discovery: Auto-detecting your Zigbee devices.
- Logic: Creating a simple "If This, Then That" automation.
We have a server. We have a media library. We have a Zigbee radio listening to sensors. But right now, they are all separate islands. The motion sensor sees you move, but the lights don't know about it.
In Part 9, we install Home Assistant. It is the conductor of the orchestra. It listens to everything and tells your devices what to do.
Automate Your Life
Home Assistant users are some of the most creative people in tech. Are you looking for dashboard inspiration? Search for the "Home Assistant" or "YAML" interest tags on Great Meets to find local users showing off their setups.
Step 1: The Install
We are installing the "Container" version of Home Assistant. It is lightweight and runs perfectly alongside the other apps we have installed.
Open Portainer, create a stack called homeassistant, and paste this:
services:
homeassistant:
container_name: homeassistant
image: "ghcr.io/home-assistant/home-assistant:stable"
volumes:
- ./config:/config
- /etc/localtime:/etc/localtime:ro
restart: unless-stopped
network_mode: host
Important: Network Mode
Notice we used network_mode: host instead of mapping ports. This allows Home Assistant to scan your local network to find things like WLED controllers, Google Cast devices, and Sonos speakers automatically.
Deploy the stack. Give it a minute, then go to http://[YOUR-IP]:8123.
Step 2: Onboarding
Follow the wizard:
- Create your Owner account (Username/Password).
- Set your Home Location (This is used for "Sun" automations like turning lights on at sunset).
- It will scan your network and likely find "WLED" (from our very first article) and other devices. Click "Ignore" for now; we will add them later.
Step 3: Connecting MQTT (The Bridge)
Remember in Part 8 how we set up Mosquitto? Your Zigbee devices are talking to Mosquitto, but Home Assistant isn't listening yet.
- In Home Assistant, go to Settings -> Devices & Services.
- Click + Add Integration (bottom right).
- Search for MQTT.
- Broker: Enter your server's IP address (e.g.,
192.168.1.50).
- Port: 1883.
- Click Submit.
The Magic Moment:
As soon as you connect, Home Assistant will detect that Zigbee2MQTT is using that broker. Your Zigbee sensors (from Part 8) will suddenly appear in your Devices list automatically!
YAML Giving You Headaches?
Home Assistant has a steep learning curve. Don't pull your hair out debugging indentation errors. Search for a "Python" or "Automation" expert on Great Meets and message them for a code review.
Step 4: Creating an Automation
Let's make the house smart. We will turn on a light when the Zigbee motion sensor detects movement.
- Go to Settings -> Automations & Scenes -> Create Automation.
- Trigger (When):
- Select "State".
- Entity:
binary_sensor.motion_sensor_occupancy (Your Zigbee sensor).
- To: Detected / On.
- Action (Then):
- Select "Call Service".
- Service:
light.turn_on.
- Target: Choose a light entity (maybe your WLED strip!).
- Save it as "Motion Lights".
Wave your hand in front of the sensor. The light turns on. You have just built a localized, cloud-free automation.
Conclusion
You now have a fully functioning smart home system running entirely on your own hardware. No subscription fees, no cloud delays, and total privacy.
Coming Up in Part 10 (The Finale): We will wrap up the series by installing Uptime Kuma to monitor everything and Watchtower to keep it updated automatically.
Share Your Blueprints
The best part of Home Assistant is the community blueprints. Have you written a killer automation script? Join Great Meets to connect with other local users. Share your ideas, swap hardware, and build the ultimate smart home network together.