Electronics for Building Things · Lesson 22 · Connectivity
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.
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).
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.
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.
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.
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:
SENSE → DECIDE → ACT → REPORT
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.
See also: Glossary · Connectivity cheat-sheet · Rules of thumb