Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

ESPHome Bluetooth Classic Presence

External ESPHome component for ESP32 boards with Bluetooth Classic support. It periodically runs a Classic Bluetooth GAP inquiry, logs discovered devices when discovery mode is enabled, and publishes binary sensors for configured Bluetooth addresses.

This is for Bluetooth Classic, not BLE. It is useful for devices that do not advertise over BLE but can be found by Classic inquiry.

Example

external_components:
  - source:
      type: local
      path: ./components

logger:
  level: DEBUG

classic_bluetooth_presence:
  enabled: true
  discovery: true
  update_interval: 30s
  startup_delay: 30s
  scan_duration: 10s
  presence_timeout: 90s
  devices:
    - name: "Bluetooth speaker present"
      bt_addr: "AA:BB:CC:DD:EE:FF"

With discovery: true, watch the ESPHome logs. Each scan prints lines like:

[I][classic_bluetooth_presence:xxx]: Discovered BT Classic device: AA:BB:CC:DD:EE:FF RSSI=-63 name="Speaker"

Copy the address into bt_addr, then set discovery: false once you no longer need the device list.

Options

  • discovery: log all discovered Bluetooth Classic devices. Defaults to false.
  • enabled: actually initialize and run Bluetooth Classic. Defaults to false so adding the component cannot break boot by itself.
  • update_interval: how often a scan is started. Defaults to 30s.
  • scan_duration: inquiry duration. Defaults to 10s.
  • presence_timeout: how long a device remains present after the last successful sighting. Defaults to 90s.
  • startup_delay: wait this long after boot before initializing Bluetooth Classic. Defaults to 30s.
  • release_ble: release BLE memory before enabling Classic Bluetooth. Defaults to false.
  • devices: list of binary sensors, each with name and bt_addr.

Notes

Do not use this together with ESPHome BLE tracking unless you have explicitly tested coexistence. Bluetooth Classic scanning uses the ESP-IDF GAP APIs and requires an ESP32 variant with Classic Bluetooth support; ESP32-C3, ESP32-C6, and ESP32-S3 do not support Bluetooth Classic.

The component calls ESPHome's include_builtin_idf_component("bt") when available, which is needed by newer ESPHome versions that exclude unused ESP-IDF components from builds by default.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages