Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/esphome/esphome.io/llms.txt

Use this file to discover all available pages before exploring further.

The ESPHome Cookbook is a collection of complete, tested YAML configurations for real devices and real-world scenarios. Unlike reference documentation, each recipe walks you through an end-to-end project — hardware wiring, component choices, and the full ESPHome config file you can adapt and flash today. Whether you are building your first smart-home gadget or looking for a proven pattern to extend, the cookbook gives you a working starting point rather than a blank page. Every recipe is self-contained: it lists the hardware you need, explains every section of the YAML, and highlights the gotchas worth knowing before you solder anything. Copy a recipe, change the GPIO pins and sensor IDs to match your board, and you are ready to go.

Available recipes

OLED Display — Time & Temperature

Drive a 128×64 SSD1306 OLED over I²C to show live time (from SNTP or Home Assistant) and one or more temperature readings — all in under 50 lines of YAML.

Garage Door Controller

Wire a relay module and a magnetic reed switch to an ESP board and expose a fully functional Cover entity to Home Assistant with open, close, and stop actions.

Whole-Home Power Meter

Clip a photoresistor onto your meter’s pulse LED (or wire to an S0 port) and track real-time watts plus cumulative kWh — no electrician required.

BME280 Environment Sensor

Add altitude, absolute humidity, dew point, and equivalent sea-level pressure calculations on top of a standard BME280 temperature/pressure/humidity sensor.

How to use a recipe

1

Read the hardware section first

Each recipe lists the exact components and wiring before the YAML. Confirm you have everything on hand and that your GPIO pins are free before you start editing.
2

Copy the full YAML block

Every recipe contains a complete, compilable configuration. Copy it into a new file in your /config/esphome/ directory (e.g. my-display.yaml).
3

Substitute your board and pin values

Replace every GPIOXX placeholder with the real pin numbers for your board. Update Wi-Fi credentials, entity IDs, sensor addresses, and any other environment-specific values.
4

Validate and flash

Run Validate in the ESPHome dashboard (or esphome config my-display.yaml on the CLI) to catch typos, then flash over USB or OTA.
5

Iterate

Recipes are starting points, not final answers. Swap a DHT22 for a BME280, add a second display page, or hook an automation into a Home Assistant blueprint — the YAML is yours to extend.
Store your font files and any other assets in the same /config/esphome/ directory as your YAML. ESPHome resolves relative file paths from there during compilation.

Build docs developers (and LLMs) love