Skip to content

Commit

Permalink
Use the BLE scanner to identify the MAC address of your device (#616) (
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi authored Oct 22, 2024
1 parent c2f12a8 commit c7db688
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions esp32-ble-scanner.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
substitutions:
name: ble-scanner
project_version: 2.1.0
device_description: "Search for BLE devices"

esphome:
name: ${name}
comment: ${device_description}
min_version: 2024.6.0
project:
name: "syssi.esphome-atorch-dl24"
version: ${project_version}

esp32:
board: wemos_d1_mini32
framework:
type: esp-idf

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

ota:
platform: esphome

logger:
level: DEBUG
logs:
wifi: WARN

api:
reboot_timeout: 0s

esp32_ble_tracker:
scan_parameters:
active: true
on_ble_advertise:
then:
- lambda: |-
if (x.get_name().rfind("-BLE", 0) == 0) {
ESP_LOGI("ble_adv", "New Atorch device found");
ESP_LOGI("ble_adv", " Name: %s", x.get_name().c_str());
ESP_LOGI("ble_adv", " MAC address: %s", x.address_str().c_str());
ESP_LOGD("ble_adv", " Advertised service UUIDs:");
for (auto uuid : x.get_service_uuids()) {
ESP_LOGD("ble_adv", " - %s", uuid.to_string().c_str());
}
}
text_sensor:
- platform: ble_scanner
name: "BLE Devices Scanner"

0 comments on commit c7db688

Please sign in to comment.