DIY Garage Sensors with ESPHome and ESP32


Commercial smart home sensors are expensive, often cloud-dependent, and limited in what they can measure. With an ESP32 and ESPHome, you can build exactly the sensors you need for a few euros and integrate them directly into Home Assistant over WiFi.

What I Built

A single ESP32 board in the garage monitoring:

  • Temperature and humidity (BME280 – also provides pressure)
  • Temperature of a specific surface (DS18B20 waterproof probe)
  • Motion detection (PIR sensor)
  • Door/window state (reed switch)
  • Relay for controlling a device (garage light)

Total component cost: approximately €15–20.

Why ESPHome

ESPHome lets you define sensors in a YAML config file. You flash the device once via USB, and from then on updates happen over WiFi (OTA). The device integrates with Home Assistant automatically – all sensors appear as entities without any extra configuration.

esphome:
  name: garage-sensors

esp32:
  board: esp32dev

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

# BME280 – temperature, humidity, pressure
i2c:
  sda: GPIO21
  scl: GPIO22

sensor:
  - platform: bme280_i2c
    temperature:
      name: "Garage Temperature"
    humidity:
      name: "Garage Humidity"
    pressure:
      name: "Garage Pressure"
    update_interval: 30s

# PIR motion sensor
binary_sensor:
  - platform: gpio
    pin: GPIO12
    name: "Garage Motion"
    device_class: motion

# Reed switch – door state
  - platform: gpio
    pin:
      number: GPIO13
      mode: INPUT_PULLUP
    name: "Garage Door"
    device_class: door

First Flash vs OTA Updates

The first flash requires connecting the ESP32 to a computer via USB. After that, all updates go over WiFi. With ESPHome running in Docker on the same network (or accessible via VPN), you can update the device config from anywhere.

Integration with Home Assistant

Once the device is flashed and on the network, add it to Home Assistant via Settings → Devices & Services → ESPHome. Enter the device IP and all sensors appear immediately. From there you can build automations – for example, send a notification if the garage door is open for more than 10 minutes.

Power

The ESP32 runs off a USB power adapter. Power consumption is minimal – a standard phone charger supplies more than enough.

Conclusion

ESPHome with ESP32 is the most practical DIY sensor platform I have used. The integration with Home Assistant is seamless, OTA updates are reliable, and the sensor options are extensive. If you want custom sensors that do exactly what you need, this is the way to go.