ESPHome YAML generator

Every ESPHome device starts as a YAML file, and the first one is the hardest — not because it is long, but because the security defaults matter. Name your device, pick its board, tick the parts you wired up, and this generator writes a clean starter configuration with API encryption on, OTA updates enabled, and Wi-Fi credentials kept in a separate secrets file where they belong. New to the platform? The getting-started guide explains what happens next.

Private by design. Everything on this page runs locally in your browser. Nothing you type — including anything you put in a name field — is uploaded or sent anywhere.

Build the config

Pins in the generated config are the common defaults for each board family — check them against your exact board and adjust before flashing. The Device Builder will ask you to confirm the board on first import.

Save it as bench-sensor.yaml in your ESPHome config folder, next to a secrets.yaml containing:

wifi_ssid: "YourNetworkName"
wifi_password: "YourNetworkPassword"
api_key: "the-base64-key-esphome-generates"
ota_password: "choose-a-password"

What the pieces do

The api: block is the device’s encrypted channel to Home Assistant — the native API on port 6053, Noise-encrypted with a per-device key. ota: lets every later firmware change travel over Wi-Fi instead of USB; in current ESPHome it reuses the API encryption. The fallback access point (ap: under wifi:) is the device’s own safety net: if it cannot join your network, it broadcasts its own so you can still reach it. The component blocks — dht, bme280_i2c, ld2410, the GPIO switch — each become Home Assistant entities automatically when the device is added; nothing needs configuring on the Home Assistant side per sensor. The deep references are the presence build (LD2410 wiring and gate tuning) and the air quality build (what to add after the BME280).

Frequently asked questions

Where does the real API encryption key come from?

ESPHome generates a fresh 32-byte base64 key when you create a device in the Device Builder, and Home Assistant asks for it (as the noise_psk) when you add the device. The generator writes a placeholder line with the secret reference — put the real key in secrets.yaml, never in the device file you might share.

Why are the Wi-Fi credentials not in the YAML?

Because device files get shared — in forum posts, in GitHub repos, in screenshots. ESPHome’s convention is a separate secrets.yaml referenced with !secret, so the shareable file never contains a password. Keep secrets.yaml out of any public repo.

Can I add more components later?

Yes — that is the normal workflow. Edit the YAML in the Device Builder, add the block for the new part, and push an OTA update. The generated file is a starting point with sound defaults, not a finished ceiling.

What if my board is not in the list?

Pick the closest family member, then correct the board line and pins against your board’s documentation before flashing — ESPHome supports hundreds of boards, and the component blocks this generator writes are board-independent.

Related guides & tools