ESP32 sensor: from prototype to stable operation

guide · smart home ~45 min
SUMMARY From breadboard to a sensor that runs for months untouched: ESPHome firmware, MQTT discovery into Home Assistant, deep sleep + OTA.
PREREQUISITES
  • ESP32 devkit + sensor (BME280)
  • a running Home Assistant with an MQTT broker
01

Firmware — the ESPHome config

The base is YAML with BME280 over I2C, a deep sleep interval and MQTT discovery. The first flash goes over USB, every later one over OTA.

COMMAND
esphome run senzor.yaml
02

Integrating into Home Assistant

The device shows up through MQTT discovery — check the entities and assign an area.

03

OTA and long-term operation

Deep sleep, watchdog and OTA updates — what actually keeps the sensor alive for months.

WARNING Deep sleep under 5 minutes shortens battery life sharply — waking costs more energy than the measurement itself.

← back to explore