### Install Pre-commit Hooks Source: https://github.com/agittins/bermuda/blob/main/CONTRIBUTING.md Install the pre-commit hooks to automatically run code style and linting checks before each commit. ```bash $ pre-commit install ``` -------------------------------- ### Call bermuda.dump_devices Service Source: https://github.com/agittins/bermuda/blob/main/README.md Call the `bermuda.dump_devices` service to get a full dump of the internal data structures used by the Bermuda integration. This is useful for troubleshooting and understanding the integration's state. The `addresses` parameter can be used to filter the data by MAC address or iBeacon UUID. ```yaml service: bermuda.dump_devices ``` ```yaml service: bermuda.dump_devices data: addresses: "AA:BB:CC:DD:EE:FF,123e4567-e89b-12d3-a456-426614174000" ``` -------------------------------- ### Run Project Tests Source: https://github.com/agittins/bermuda/blob/main/CONTRIBUTING.md Execute the project's test suite from the root folder to verify the functionality of code modifications. ```bash ./scripts/test ``` -------------------------------- ### Run All Pre-commit Tests Source: https://github.com/agittins/bermuda/blob/main/CONTRIBUTING.md Execute all pre-commit checks on the entire repository to ensure code style and linting compliance. ```bash $ pre-commit run --all-files ``` -------------------------------- ### Configure ESP32 BLE Tracker Settings Source: https://github.com/agittins/bermuda/wiki/FAQ Use these settings in your ESPHome proxies to optimize Bluetooth advertisement listening and minimize missed packets. Adjust 'interval' and 'window' based on your beacon's transmission frequency and network requirements. ```yaml esp32_ble_tracker: interval: 320ms # default 320ms. Time spent per adv channel window: 290ms # default 30ms. Time spent listening during interval. ``` -------------------------------- ### ESP32 Framework Configuration Source: https://github.com/agittins/bermuda/wiki/ESPHome-Configurations Configure the ESP32 variant and framework type. Ensure you select the correct ESP32 variant for your hardware. The esp-idf framework is recommended for better memory efficiency and Bluetooth proxying performance. ```yaml esp32: variant: esp32 # Make sure you choose *your* esp type here (eg: esp32c3, esp32s3 etc) framework: type: esp-idf ``` -------------------------------- ### ESP32-C3 Module Configuration Source: https://github.com/agittins/bermuda/wiki/ESPHome-Configurations This configuration is recommended for ESP32-C3 devices to optimize Bluetooth and WiFi performance. It includes specific framework settings, SDK options for improved responsiveness, and API configurations for managing BLE tracking. ```yaml esp32: variant: esp32c3 framework: type: esp-idf # This is important: the "arduino" framework does not perform well. sdkconfig_options: # @grigi found in testing that these options resulted in better responsiveness. # BLE 4.2 is supported by ALL ESP32 boards that have bluetooth, the original and derivatives. CONFIG_BT_BLE_42_FEATURES_SUPPORTED: y # Also enable this on any derivative boards (S2, C3 etc) but not the original ESP32. CONFIG_BT_BLE_50_FEATURES_SUPPORTED: y # Extend the watchdog timeout, so the device reboots if the device appears locked up for over 10 seconds. CONFIG_ESP_TASK_WDT_TIMEOUT_S: "10" logger: baud_rate: 0 # 0 Enables logging, but disables serial-port logging to free CPU and memory ota: platform: esphome password: !secret ota_password api: # Only enable BLE tracking when wifi is up and api is connected # Gives single-core ESP32-C3 devices time to manage wifi and authenticate with api on_client_connected: - esp32_ble_tracker.start_scan: continuous: true # Disable BLE tracking when there are no api connections live on_client_disconnected: if: condition: not: api.connected: then: - esp32_ble_tracker.stop_scan: esp32_ble_tracker: scan_parameters: # Don't auto start BLE scanning, we control it in the `api` block's automation. continuous: False active: True # send scan-request packets to gather more info, like device name for some devices. interval: 320ms # default 320ms - how long to spend on each advert channel window: 300ms # default 30ms - how long to actually "listen" in each interval. Reduce this if device is unstable. # If the device cannot keep up or becomes unstable, reduce the "window" setting. This may be # required if your device is controlling other sensors or doing PWM for lights etc. bluetooth_proxy: active: true # allows outbound connections from HA to devices. sensor: - platform: uptime # The uptime sensor is extremely helpful to know if your device is rebooting # when it shouldn't be. This might indicate your interval-to-window timing is # too tight, and the window needs to be reduced. name: "Uptime Sensor" update_interval: 60s ``` -------------------------------- ### Configure BLE Tracker Scan Parameters Source: https://github.com/agittins/bermuda/wiki/ESPHome-Configurations Adjust `scan_parameters` for the `esp32_ble_tracker` to increase the frequency of listening for BLE advertisements. This is useful when you need to capture nearly all BLE adverts. ```yaml esp32_ble_tracker: scan_parameters: active: True # Whether to send scan-request packets to devices to gather more info (like devicename) interval: 320ms # default 320ms window: 300ms # default 30ms ``` -------------------------------- ### Purge and Repack Recorder History Source: https://github.com/agittins/bermuda/wiki/Logs,-Recorder-and-Database-size Use the `recorder.purge` service to remove historical data and reclaim disk space. Setting `repack: true` forces the database to rewrite its files, which is essential for freeing up space. This operation can be intensive. ```yaml service: recorder.purge data: keep_days: 10 repack: true apply_filter: true ``` -------------------------------- ### Configure ESPHome for Active Bluetooth Scanning Source: https://github.com/agittins/bermuda/wiki/Troubleshooting Add this configuration to your ESPHome YAML to enable active scanning for Bluetooth devices, which may help in retrieving their names. Ensure this is distinct from the `bluetooth_proxy` active setting. ```yaml esp32_ble_tracker: scan_parameters: active: True ``` -------------------------------- ### Specify ESP-IDF Version for ESPHome Source: https://github.com/agittins/bermuda/wiki/Troubleshooting Use this workaround to address issues with Bluetooth advertisements not being sent by ESPHome proxies, potentially caused by ESP-IDF v5.5.2. This configuration pins the framework version to 5.5.1. ```yaml esp32: framework: type: esp-idf version: 5.5.1 ``` -------------------------------- ### Exclude Bermuda Data from Recorder Source: https://github.com/agittins/bermuda/wiki/Logs,-Recorder-and-Database-size Add this configuration to `configuration.yaml` to exclude specific Bermuda sensors from being logged by the recorder. This helps reduce database size and disk usage. Restart Home Assistant after applying changes. ```yaml recorder: exclude: # to completely exclude all Bermuda data from logs, add this domain section. Not # recommended, but might be good if you like *big* hammers. # domains: # - bermuda entity_globs: # to filter specific sensors - sensor.*_distance_to_aska* - sensor.*_distance_to_back* # ...etc # or filter all the distance-to sensors - sensor.*_distance_to_* # The area sensors - sensor.*_area # The distance to closest area sensor - sensor.*_distance ``` -------------------------------- ### Disable Serial Logging Source: https://github.com/agittins/bermuda/wiki/ESPHome-Configurations Disable serial UART logging to potentially save memory and CPU time. Debug logging is still available via a wireless connection. Set baud_rate to 0 to disable. ```yaml logger: baud_rate: 0 # disable serial uart logging #level: VERBOSE ``` -------------------------------- ### Exclude Sensors from History Recording Source: https://github.com/agittins/bermuda/wiki/Settings Add this configuration to exclude specific sensors or patterns of sensors from being written to the history database. This helps manage database size while still receiving frequent updates. Ensure a similar configuration exists for long-term statistics if needed. ```yaml recorder: exclude: entity_globs: # to filter specific sensors - sensor.*_distance_to_aska* - sensor.*_distance_to_back* # ...etc # or filter all the distance-to sensors - sensor.*_distance_to_* ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.