Electronics for Building Things · Lesson 22 · Connectivity

Home Assistant — Bringing It Home

Turn your gadget into a real smart-home device you can see, control, and automate.

This is the finish line of your mission. Your gadget can sense, decide, act, and now talk over the network. Home Assistant is the hub that ties it all together — a dashboard and automation engine where your DIY gadget sits alongside any other smart device.

The one win You understand the two ways to connect an ESP32 to Home Assistant, and what it gives you: your gadget as an entity you can control and automate.

What Home Assistant is

Home Assistant (HA) is free, open-source software you run on a small computer at home (a Raspberry Pi, a mini-PC). It discovers your devices, shows them on dashboards, and runs automations — "if the garage door opens after sunset, turn on the light." A device that HA knows about appears as an entity (a switch, a sensor, a light).

Why makers love it It runs locally — your home's data stays in your home, no cloud required. And it speaks the open protocols you just learned, so your hand-built ESP32 gadget is a first-class citizen next to commercial gear.

Two ways to connect your ESP32

Path A — ESPHome (the easy on-ramp)

ESPHome lets you describe your gadget in a short YAML config file — "GPIO 26 is a relay called Desk Lamp" — and it generates and uploads the firmware for you. It integrates with Home Assistant natively: the device shows up automatically, with over-the-air updates built in (ESPHome docs).

For most home-automation gadgets, this is the recommended starting point — little to no hand-written networking code.

Path B — MQTT (universal and portable)

Run an MQTT broker (the Mosquitto add-on installs right inside HA), have your ESP32 publish/subscribe as in Lesson 21, and enable HA's MQTT integration. With MQTT Discovery, your device can announce itself and HA creates the entities automatically (Home Assistant MQTT docs).

Choose this when you want full control of the firmware, or to reuse your gadget with non-HA systems.

Rule of thumb Start with ESPHome to get a win fast. Reach for raw MQTT when you need custom behavior or portability. Both end the same way: your gadget as an entity in Home Assistant.

Then: automations

Once your gadget is an entity, HA's real power opens up. Combine it with anything: "When the bedroom temperature (your sensor) rises above 24°C, switch on the fan (your relay)." That sentence is your whole course in one line — SENSE, DECIDE, ACT, REPORT — running your home.

🎉 You've completed the course

From "why does an LED need a resistor?" to a Wi-Fi gadget reporting into a smart-home hub, you can now reason about every layer:

SENSEDECIDEACTREPORT

The best next step isn't another lesson — it's a build. Pick one small real gadget (a temperature reporter, a relay you control from your phone, a door sensor) and make it. Bring me the plan and we'll design it together, end to end.

Check yourself

Read this next (primary source) ESPHome (start here) and the Home Assistant MQTT integration docs.
I'm your teacher — ask me anything. Ready to build your first real gadget? Tell me what you want it to do and I'll help you choose the parts, wire it, and connect it to Home Assistant.

See also: Glossary · Connectivity cheat-sheet · Rules of thumb