Skip to content

Basic Setup

The BTHome component supports the following configuration options:

bthome:
min_interval: 1s
max_interval: 1s
tx_power: 0
ble_stack: bluedroid # Optional, ESP32 only: bluedroid or nimble
trigger_based: false # Optional, for event-driven devices
encryption_key: "your_32_hex_char_key" # Optional
sensors:
# ... sensor configuration
binary_sensors:
# ... binary sensor configuration
OptionTypeDefaultDescription
min_intervalTime1sMinimum advertising interval (1s - 10240ms)
max_intervalTime1sMaximum advertising interval (1s - 10240ms)
tx_powerInteger0Transmit power in dBm
ble_stackStringbluedroidESP32 only: bluedroid or nimble (see BTHome Component)
trigger_basedBooleanfalseMark device as trigger-based (event-driven)
encryption_keyString-Optional 16-byte encryption key (32 hex chars)
sensorsList-List of sensor measurements to broadcast
binary_sensorsList-List of binary sensor measurements to broadcast

The advertising interval controls how often your device broadcasts sensor data:

bthome:
min_interval: 5s # Broadcast at least every 5 seconds
max_interval: 10s # But no more than every 10 seconds

Transmit power affects range and battery consumption:

dBmDescription
-12Minimum power, shortest range
-9Low power
-6Below default
-3Slightly below default
0Default
3Above default
6High power
9Maximum power, longest range
dBmDescription
-40Ultra low power
-20Very low power
-16, -12, -8, -4Low power options
0Default
2, 3, 4, 5, 6, 7, 8High power options

Example:

bthome:
tx_power: 4 # Increase range

Set trigger_based: true for devices that only send data on events rather than continuously. This tells Home Assistant not to expect regular updates from the device.

Use cases for trigger-based mode:

  • Push buttons - Only broadcast when pressed
  • Remote controls - Only broadcast on button press
  • Door bells - Only broadcast when activated
  • Event-driven sensors - Any sensor that reports discrete events rather than continuous measurements
bthome:
trigger_based: true
binary_sensors:
- type: generic_boolean
id: button_press
advertise_immediately: true

Each sensor measurement requires:

OptionRequiredDescription
typeYesBTHome sensor type (see Sensor Types)
idYesReference to an ESPHome sensor
advertise_immediatelyNoBroadcast immediately on value change (default: false)
bthome:
sensors:
- type: temperature
id: my_temp_sensor
advertise_immediately: false
- type: humidity
id: my_humidity_sensor
- type: battery
id: battery_percent

Each binary sensor measurement requires:

OptionRequiredDescription
typeYesBTHome binary sensor type (see Binary Sensor Types)
idYesReference to an ESPHome binary sensor
advertise_immediatelyNoBroadcast immediately on state change (default: false)
bthome:
binary_sensors:
- type: motion
id: pir_motion
advertise_immediately: true # Important for motion sensors!
- type: door
id: door_contact
advertise_immediately: true