Skip to content

Instantly share code, notes, and snippets.

@williamfligor
Last active May 14, 2026 19:55
Show Gist options
  • Select an option

  • Save williamfligor/28eb01269c708f96377779e15afa96cd to your computer and use it in GitHub Desktop.

Select an option

Save williamfligor/28eb01269c708f96377779e15afa96cd to your computer and use it in GitHub Desktop.
ESPHome Bluetooth Proxy for Meshtastic Node w/Pin
esphome:
name: bluetooth-proxy
friendly_name: Bluetooth Proxy
esp32:
board: esp32dev
framework:
type: esp-idf
esp32_ble:
io_capability: keyboard_only
logger:
# Enable Home Assistant API
api:
encryption:
key: "<...>"
ota:
- platform: esphome
password: "<...>"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Bluetooth-Proxy Fallback Hotspot"
password: "<...>"
ble_client:
- mac_address: <MAC ADDRESS>
id: ble_itag
# Let Home Assistant initiate the connection
auto_connect: false
# When connected force the BLE connection to be encrypted
on_connect:
then:
- logger.log:
format: "Connected to radio"
level: INFO
- lambda: |-
esphome::ble_client::BLEClient* client = id(ble_itag);
esp_ble_set_encryption(client->get_remote_bda(), ESP_BLE_SEC_ENCRYPT_MITM);
# After encryption is set, the device will ask for the pin
on_passkey_request:
then:
- logger.log:
format: "Authenticating with passkey"
level: INFO
- ble_client.passkey_reply:
id: ble_itag
passkey: <PASSKEY>
esp32_ble_tracker:
scan_parameters:
interval: 2000ms
window: 1000ms
bluetooth_proxy:
active: true
connection_slots: 3
captive_portal:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment