Skip to content

ESP32

The BTHome component fully supports ESP32 boards using the ESP-IDF framework.

Any ESP32 board with Bluetooth LE support:

  • ESP32 (original)
  • ESP32-C3
  • ESP32-S3
  • ESP32-C6
esphome:
name: bthome-esp32
friendly_name: BTHome ESP32
esp32:
board: esp32dev
framework:
type: esp-idf
logger:
wifi:
ap:
ssid: "BTHome-ESP32"
captive_portal:
external_components:
- source:
type: git
url: https://github.com/dz0ny/esphome-bthome
ref: main
components: [bthome]

BTHome requires the ESP-IDF framework (not Arduino):

esp32:
board: esp32dev
framework:
type: esp-idf # Required!

ESP32 supports two BLE stacks:

  • Bluedroid (default) - Full-featured BLE stack, compatible with other ESPHome BLE components
  • NimBLE - Lightweight alternative that saves ~170KB flash and ~100KB RAM

For broadcast-only sensors, NimBLE offers significant memory savings. See the BTHome Component documentation for detailed comparison and configuration.

bthome:
ble_stack: nimble # Optional: use lightweight NimBLE stack

ESP32 supports these transmit power levels:

SettingPowerDescription
-12-12 dBmMinimum, ~1m range
-9-9 dBmVery low
-6-6 dBmLow
-3-3 dBmBelow default
00 dBmDefault
3+3 dBmAbove default
6+6 dBmHigh
9+9 dBmMaximum, ~30m+ range
bthome:
tx_power: 6 # High power for longer range

Temperature, humidity, and motion sensor:

esphome:
name: bthome-esp32
friendly_name: BTHome ESP32 Sensor
esp32:
board: esp32dev
framework:
type: esp-idf
logger:
wifi:
ap:
ssid: "BTHome-ESP32"
captive_portal:
external_components:
- source:
type: git
url: https://github.com/dz0ny/esphome-bthome
ref: main
components: [bthome]
# I2C bus
i2c:
sda: GPIO21
scl: GPIO22
# Sensors
sensor:
- platform: bme280_i2c
address: 0x76
temperature:
id: temperature
name: "Temperature"
humidity:
id: humidity
name: "Humidity"
pressure:
id: pressure
name: "Pressure"
update_interval: 30s
binary_sensor:
- platform: gpio
pin:
number: GPIO4
mode: INPUT_PULLDOWN
id: motion
name: "Motion"
device_class: motion
filters:
- delayed_off: 30s
# BTHome configuration
bthome:
min_interval: 10s
max_interval: 30s
tx_power: 3
sensors:
- type: temperature
id: temperature
- type: humidity
id: humidity
- type: pressure
id: pressure
binary_sensors:
- type: motion
id: motion
advertise_immediately: true

For battery-powered ESP32 devices:

deep_sleep:
run_duration: 10s
sleep_duration: 5min
bthome:
tx_power: -6 # Lower power saves battery
bthome:
min_interval: 30s
max_interval: 60s

Ensure you’re using ESP-IDF framework:

esp32:
framework:
type: esp-idf

Increase TX power:

bthome:
tx_power: 9 # Maximum

Reduce advertising frequency and TX power:

bthome:
min_interval: 30s
max_interval: 60s
tx_power: -3