├── packages ├── bermuda-proxy-c3.yaml ├── bermuda-proxy-esp32-orig-minimal.yaml ├── bermuda-proxy-esp32-orig-full.yaml ├── bermuda-proxy-esp32-c3-full.yaml ├── bermuda-proxy-esp32-s3-minimal.yaml ├── bermuda-proxy-esp32-c3-minimal.yaml ├── bermuda-proxy-esp32-s3-full.yaml └── bermuda-proxy-include-common.yaml ├── LICENSE └── README.md /packages/bermuda-proxy-c3.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | Bermuda.moved: github://agittins/bermuda-proxies/packages/bermuda-proxy-esp32-c3-minimal.yaml@main 3 | -------------------------------------------------------------------------------- /packages/bermuda-proxy-esp32-orig-minimal.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # bermuda-proxy-esp32-orig-minimal.yaml 3 | # 4 | # This is for ESP32 original variants, like the ESP32-WROOM, ESP32-ROVER etc. 5 | # 6 | # See other configs for devices like the C3 or S3 etc. 7 | # 8 | # This package is for adding to an existing ESPHome config file, where you 9 | # have a device already configured and you just want to add bluetooth proxy 10 | # features and tuning for the best Bermuda performance. 11 | # 12 | 13 | substitutions: 14 | baud_rate: "0" # If you need serial debugging, override this to 115200 or similar. 15 | ble_interval: 320ms 16 | ble_window: 300ms 17 | proxy_active_scan: "true" # Set to false to avoid requesting scan info for device names etc 18 | proxy_enable_outbound: "True" 19 | 20 | packages: 21 | Bermuda.esp32_common: github://agittins/bermuda-proxies/packages/bermuda-proxy-include-common.yaml 22 | 23 | -------------------------------------------------------------------------------- /packages/bermuda-proxy-esp32-orig-full.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | wifi_ssid: !secret wifi_ssid 3 | wifi_password: !secret wifi_password 4 | name: proxy 5 | friendly_name: Proxy 6 | comment: ESPHome proxy tuned for Bermuda 7 | name_add_mac_suffix: "True" # Adds the last 4 characters of the MAC address to the name. 8 | baud_rate: "0" # If you need serial debugging, override this to 115200 or similar. 9 | ble_interval: 320ms 10 | ble_window: 300ms 11 | proxy_active_scan: "True" # Set to false to avoid requesting scan info for device names etc 12 | 13 | packages: 14 | Bermuda.include_common: github://agittins/bermuda-proxies/packages/bermuda-proxy-include-common.yaml 15 | 16 | esphome: 17 | name: ${name} 18 | friendly_name: ${friendly_name} 19 | comment: ${comment} 20 | name_add_mac_suffix: ${name_add_mac_suffix} 21 | 22 | esp32: 23 | board: wemos_d1_mini32 24 | 25 | ota: 26 | platform: esphome 27 | 28 | 29 | wifi: 30 | 31 | -------------------------------------------------------------------------------- /packages/bermuda-proxy-esp32-c3-full.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | wifi_ssid: !secret wifi_ssid 3 | wifi_password: !secret wifi_password 4 | name: proxy 5 | friendly_name: Proxy 6 | comment: ESPHome proxy tuned for Bermuda 7 | name_add_mac_suffix: "True" # Adds the last 4 characters of the MAC address to the name. 8 | baud_rate: "0" # If you need serial debugging, override this to 115200 or similar. 9 | ble_interval: 320ms 10 | ble_window: 300ms 11 | proxy_active_scan: "True" # Set to false to avoid requesting scan info for device names etc 12 | 13 | packages: 14 | Bermuda.include_minimal: github://agittins/bermuda-proxies/packages/bermuda-proxy-esp32-c3-minimal.yaml 15 | 16 | esphome: 17 | name: ${name} 18 | friendly_name: ${friendly_name} 19 | comment: ${comment} 20 | name_add_mac_suffix: ${name_add_mac_suffix} 21 | 22 | esp32: 23 | board: esp32-c3-devkitm-1 24 | 25 | ota: 26 | platform: esphome 27 | 28 | wifi: 29 | ssid: ${wifi_ssid} 30 | password: ${wifi_password} 31 | 32 | -------------------------------------------------------------------------------- /packages/bermuda-proxy-esp32-s3-minimal.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # bermuda-proxy-esp32-s3-minimal.yaml 3 | # 4 | # This is for ESP32 S3 variants. 5 | # 6 | # See other configs for devices like the C3 or original esp32 etc. 7 | # 8 | # This package is for adding to an existing ESPHome config file, where you 9 | # have a device already configured and you just want to add bluetooth proxy 10 | # features and tuning for the best Bermuda performance. 11 | # 12 | 13 | substitutions: 14 | baud_rate: "0" # If you need serial debugging, override this to 115200 or similar. 15 | ble_interval: 320ms 16 | ble_window: 300ms 17 | proxy_active_scan: "true" # Set to false to avoid requesting scan info for device names etc 18 | proxy_enable_outbound: "True" 19 | 20 | packages: 21 | Bermuda.include_common: github://agittins/bermuda-proxies/packages/bermuda-proxy-include-common.yaml 22 | 23 | esp32: 24 | framework: 25 | sdkconfig_options: 26 | # Also enable this on any derivative boards (S3, C3 etc) but not the original ESP32. 27 | CONFIG_BT_BLE_50_FEATURES_SUPPORTED: y 28 | 29 | -------------------------------------------------------------------------------- /packages/bermuda-proxy-esp32-c3-minimal.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # bermuda-proxy-esp32-c3-minimal.yaml 3 | # 4 | # This is for ESP32 C3 variants, like the XIAO ESP32-C3 etc. 5 | # 6 | # See other configs for devices like the S3 or original esp32 etc. 7 | # 8 | # This package is for adding to an existing ESPHome config file, where you 9 | # have a device already configured and you just want to add bluetooth proxy 10 | # features and tuning for the best Bermuda performance. 11 | # 12 | 13 | substitutions: 14 | baud_rate: "0" # If you need serial debugging, override this to 115200 or similar. 15 | ble_interval: 320ms 16 | ble_window: 300ms 17 | proxy_active_scan: "true" # Set to false to avoid requesting scan info for device names etc 18 | proxy_enable_outbound: "True" 19 | 20 | packages: 21 | Bermuda.include_common: github://agittins/bermuda-proxies/packages/bermuda-proxy-include-common.yaml 22 | 23 | esp32: 24 | framework: 25 | sdkconfig_options: 26 | # Also enable this on any derivative boards (S3, C3 etc) but not the original ESP32. 27 | CONFIG_BT_BLE_50_FEATURES_SUPPORTED: y 28 | 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Ashley Gittins 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /packages/bermuda-proxy-esp32-s3-full.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | wifi_ssid: !secret wifi_ssid 3 | wifi_password: !secret wifi_password 4 | name: proxy 5 | friendly_name: Proxy 6 | comment: ESPHome proxy tuned for Bermuda 7 | name_add_mac_suffix: "True" # Adds the last 4 characters of the MAC address to the name. 8 | baud_rate: "0" # If you need serial debugging, override this to 115200 or similar. 9 | ble_interval: 320ms 10 | ble_window: 300ms 11 | proxy_active_scan: "True" # Set to false to avoid requesting scan info for device names etc 12 | 13 | packages: 14 | Bermuda.include_minimal: github://agittins/bermuda-proxies/packages/bermuda-proxy-esp32-s3-minimal.yaml 15 | 16 | esphome: 17 | name: ${name} 18 | friendly_name: ${friendly_name} 19 | comment: ${comment} 20 | name_add_mac_suffix: ${name_add_mac_suffix} 21 | # dio required on some (all?) boards otherwise after a serial 22 | # flash the board will boot-loop. 23 | platformio_options: 24 | board_build.flash_mode: dio 25 | 26 | esp32: 27 | board: esp32-s3-devkitc-1 28 | 29 | ota: 30 | platform: esphome 31 | 32 | wifi: 33 | ssid: ${wifi_ssid} 34 | password: ${wifi_password} 35 | 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bermuda-Proxies 2 | ESPHome packages for creating BLE Proxies that work well with Bermuda. 3 | 4 | These package files are designed to: 5 | - Make creating a proxy easy 6 | - Ensure you get the best performance from the device 7 | - Provide fast and frequent updates to Home Assistant (and therefore to 8 | Bermuda). 9 | 10 | # How to use 11 | 12 | For each MCU type, there is a "full" package and a "minimal" package. 13 | The "full" package includes everything you need to flash a bare board 14 | and get up and running with a proxy tuned for Bermuda. 15 | 16 | The "minimal" package is ideal if you want to add bluetooth proxy to an 17 | esphome device you have already flashed. You can just add this to your 18 | existing config and it won't stomp all over it :-) 19 | 20 | You can view the actual settings used in the [packages](/packages/) 21 | folder, and explanations of the various settings on the [Bermuda 22 | Wiki](https://github.com/agittins/bermuda/wiki/ESPHome-Configurations) 23 | 24 | ### Classic ESP32 devices (ESP32-ROVER, ESP32-WROOM, Atom Lite ESP32 etc) 25 | 26 | To add Bermuda-friendly bluetooth proxy to an existing esphome yaml, add 27 | this section to the yaml and install it: 28 | 29 | ```yaml 30 | packages: 31 | Bermuda.esp32: github://agittins/bermuda-proxies/packages/bermuda-proxy-esp32-orig-minimal.yaml 32 | 33 | ``` 34 | 35 | ### ESP32-S3 (M5Stack CoreS3, AtomS3 Lite etc) 36 | 37 | To add Bermuda-friendly bluetooth proxy to an existing esphome yaml, add 38 | this section to the yaml and install it: 39 | 40 | ```yaml 41 | packages: 42 | Bermuda.esp32: github://agittins/bermuda-proxies/packages/bermuda-proxy-esp32-s3-minimal.yaml 43 | 44 | ``` 45 | 46 | ### ESP32-C3 (M5Stack STAMP-C3 etc) 47 | 48 | To add Bermuda-friendly bluetooth proxy to an existing esphome yaml, add 49 | this section to the yaml and install it: 50 | 51 | ```yaml 52 | packages: 53 | Bermuda.esp32: github://agittins/bermuda-proxies/packages/bermuda-proxy-esp32-c3-minimal.yaml 54 | 55 | ``` 56 | -------------------------------------------------------------------------------- /packages/bermuda-proxy-include-common.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | baud_rate: "0" # If you need serial debugging, override this to 115200 or similar. 3 | ble_interval: 320ms 4 | ble_window: 300ms 5 | proxy_active_scan: "True" # Allow device to request scan info for device names etc 6 | proxy_enable_outbound: "True" # Allow HA to make outbound connections via this device 7 | 8 | esp32: 9 | framework: 10 | type: esp-idf # This is important: the default "arduino" framework does not perform well. 11 | sdkconfig_options: 12 | # @grigi found in testing that these options resulted in better responsiveness. 13 | # BLE 4.2 is supported by ALL ESP32 boards that have bluetooth, the original and derivatives. 14 | CONFIG_BT_BLE_42_FEATURES_SUPPORTED: y 15 | # Extend the watchdog timeout, so the device reboots if the device appears locked up for over 10 seconds. 16 | CONFIG_ESP_TASK_WDT_TIMEOUT_S: "10" 17 | 18 | logger: 19 | baud_rate: ${baud_rate} # 0 Enables logging, but disables serial-port logging to free CPU and memory 20 | 21 | api: 22 | # This ensures BLE scanning only happens after the wifi is up and 23 | # the device is connected to HomeAssistant. This is particularly 24 | # important for ESP32-C3 devices, but is good for all. 25 | on_client_connected: 26 | - esp32_ble_tracker.start_scan: 27 | continuous: true 28 | # Disable BLE tracking when there are no active api connections 29 | on_client_disconnected: 30 | if: 31 | condition: 32 | not: 33 | api.connected: 34 | then: 35 | - esp32_ble_tracker.stop_scan: 36 | 37 | esp32_ble_tracker: 38 | scan_parameters: 39 | # Don't auto start BLE scanning, we control it in the `api` section above. 40 | continuous: False 41 | 42 | active: ${proxy_active_scan} # send scan-request packets to gather more info, like device name for some devices. 43 | 44 | interval: ${ble_interval} # default 320ms - how long to spend on each advert channel 45 | window: ${ble_window} # default 30ms - how long to actually "listen" in each interval. Reduce this if device is unstable. 46 | # If the device cannot keep up or becomes unstable, reduce the "window" setting. This may be 47 | # required if your device is controlling other sensors or doing PWM for lights etc. 48 | 49 | bluetooth_proxy: 50 | active: ${proxy_enable_outbound} # allows outbound connections from HA to devices. 51 | 52 | safe_mode: 53 | 54 | button: 55 | - platform: restart 56 | name: "Restart" 57 | entity_category: config 58 | 59 | - platform: factory_reset 60 | name: "Factory Reset" 61 | id: Reset 62 | entity_category: config 63 | 64 | - platform: safe_mode 65 | name: "Safe Mode" 66 | internal: false 67 | entity_category: config 68 | 69 | sensor: 70 | - platform: uptime 71 | name: "Uptime" 72 | id: uptime_sensor 73 | entity_category: diagnostic 74 | internal: true 75 | 76 | - platform: wifi_signal 77 | name: "WiFi Signal dB" 78 | id: wifi_signal_db 79 | update_interval: 60s 80 | entity_category: "diagnostic" 81 | 82 | --------------------------------------------------------------------------------