Skip to content

Commit

Permalink
Use the BLE scanner to identify the MAC address of your BMS (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi authored Oct 22, 2024
1 parent 585be3b commit 209725e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 24 deletions.
12 changes: 0 additions & 12 deletions esp32-ble-example-multiple-devices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,6 @@ mqtt:
esp32_ble_tracker:
scan_parameters:
active: false
on_ble_advertise:
then:
- lambda: |-
if (x.get_name().rfind("xiaoxiang", 0) == 0) {
ESP_LOGI("ble_adv", "New JBD-BMS 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());
}
}

ble_client:
- mac_address: ${bms0_mac_address}
Expand Down
12 changes: 0 additions & 12 deletions esp32-ble-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,6 @@ mqtt:
esp32_ble_tracker:
scan_parameters:
active: false
on_ble_advertise:
then:
- lambda: |-
if (x.get_name().rfind("xiaoxiang", 0) == 0) {
ESP_LOGI("ble_adv", "New JBD-BMS 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());
}
}

ble_client:
- id: client0
Expand Down
2 changes: 2 additions & 0 deletions esp32-ble-scanner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ api:
reboot_timeout: 0s

esp32_ble_tracker:
scan_parameters:
active: true
on_ble_advertise:
then:
- lambda: |-
Expand Down

0 comments on commit 209725e

Please sign in to comment.