ESPHome Device Builder update has broken my bluetooth keyboards

ESPHome Device Builder update has broken my bluetooth keyboards

I have had bluetooth wifi keyboards programmed to my esp32 devices and since the last update it has stopped all function of keypress on all the devices; it installs with no errors then just stops the ability to press buttons in home assistant

Even a fresh install of the bin file stops the ability to press buttons in home assistant they are seen but greyed out

Edit Update
it would seem that this latest update has broken the Bluetooth as the esp32 devices are no longer being seen by bluetooth

The below is the code for bluetooth and this has been the only way to get the esp32 device to even install the code after the change last year to espHome

esp32:
board: $board
framework:
type: arduino
sdkconfig_options:
CONFIG_BT_ENABLED: y
CONFIG_BT_CLASSIC_ENABLED: y
CONFIG_BT_SPP_ENABLED: y

It’s board config, you likely have much more code for bluetooth…
But first of all, always use code tags (</> button) to post code here.

I’m having the same issue, BLE keyboards been working for a long time, and after flashing to February release (2026.2.2) seems to cause issues. When I plug into USB directly to troubleshoot, I see there is a boot-loop occurring, and then goes to safe mode.

Here is my full config -

esphome:
  name: bluetooth-keyboard
  friendly_name: Bluetooth Keyboard

esp32:
  board: esp32dev
  framework:
    type: arduino
    sdkconfig_options:
      CONFIG_BT_ENABLED: y
      CONFIG_BT_CLASSIC_ENABLED: y
      CONFIG_BT_SPP_ENABLED: y

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxxxxxxxxxxxxxxxxxxxxx"

ota:
  - platform: esphome
    password: "xxxxxxxxxxxxxxxxxxxxxxxxxx"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Bluetooth-Keyboard"
    password: "xxxxxxxxxxxxxxxxxxxxxxxx"

captive_portal:

# Start BLE Keyboard Configuration Section
    
external_components:
  - source: github://dmamontov/esphome-blekeyboard

ble_keyboard:
  id: my_ble_keyboard
  name: "ESP32 Keyboard"
  reconnect: true
  buttons: false

sensor:
  
  - platform: wifi_signal
    name: "WiFi Signal"
    update_interval: 60s

button:

  - platform: template
    name: "ESC"
    id: key_esc
    icon: "mdi:keyboard-esc"
    on_press:
      then:
        - ble_keyboard.press:
            id: my_ble_keyboard
            code: 0xB1
        - ble_keyboard.release: my_ble_keyboard

  - platform: restart
    entity_category: "config"
    name: "Restart"

  - platform: template
    name: "Start Advertising"
    id: start_advertising
    icon: "mdi:play"
    on_press:
      then:
        - ble_keyboard.start: my_ble_keyboard

  - platform: template
    name: "Stop Advertising"
    id: stop_advertising
    icon: "mdi:stop"
    on_press:
      then:
        - ble_keyboard.stop: my_ble_keyboard

Here is a partial trace via USB when I connect to get logs -

[14:29:00][I][logger:118]: Log initialized
[14:29:00][C][safe_mode:123]: Unsuccessful boot attempts: 9
[14:29:00][D][esp32.preferences:153]: Writing 1 items: 0 cached, 1 written, 0 failed
[14:29:00]ESP_ERROR_CHECK failed: esp_err_t 0x103 (ESP_ERR_INVALID_STATE) at 0x400e99ea
[14:29:00]file: ".piolibdeps/bluetooth-keyboard/NimBLE-Arduino/src/NimBLEDevice.cpp" line 879
[14:29:00]func: static void NimBLEDevice::init(const std::string&)
[14:29:00]expression: esp_bt_controller_init(&bt_cfg)
[14:29:00]
[14:29:00]abort() was called at PC 0x4008e8e7 on core 1
[14:29:00]
[14:29:00]
[14:29:00]Backtrace: 0x4008e981:0x3ffb1f80 0x4008e949:0x3ffb1fa0 0x40092946:0x3ffb1fc0 0x4008e8e7:0x3ffb2030 0x400e99ea:0x3ffb2060 0x400f9246:0x3ffb20b0 0x400d633f:0x3ffb2100 0x400dee3a:0x3ffb2120 0x400dea0f:0x3ffb2140 0x400de253:0x3ffb2160 0x400e0e02:0x3ffb21a0 0x400d7103:0x3ffb2280
[14:29:00]
[14:29:00]
[14:29:00]
[14:29:00]
[14:29:00]ELF file SHA256: 5d1304d89
[14:29:00]
[14:29:00]Rebooting...
[14:29:00]ets Jul 29 2019 12:21:46
[14:29:00]
[14:29:00]rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[14:29:00]configsip: 0, SPIWP:0xee
[14:29:00]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[14:29:00]mode:DIO, clock div:2
[14:29:00]load:0x3fff0030,len:1184
[14:29:00]load:0x40078000,len:13132
[14:29:00]load:0x40080400,len:3036
[14:29:00]entry 0x400805e4
[14:29:01][I][logger:118]: Log initialized
[14:29:01][C][safe_mode:123]: Unsuccessful boot attempts: 10
[14:29:01][E][safe_mode:135]: Boot loop detected
[14:29:01][E][component:451]: safe_mode set Error flag: unspecified
[14:29:01][I][app:091]: Running through setup()
[14:29:01][C][wifi:610]: Starting
[14:29:01][D][wifi:1263]: Starting scan
[14:29:01][C][component:278]: Setup wifi took 126ms
[14:29:01][I][app:138]: setup() finished successfully!
[14:29:01][W][safe_mode:148]: SAFE MODE IS ACTIVE
[14:29:01][W][component:431]: wifi set Warning flag: scanning for networks
[14:29:01][I][app:215]: ESPHome version 2026.2.2 compiled on 2026-02-26 13:44:50 -0500
[14:29:01][I][app:222]: ESP32 Chip: ESP32 rev3.1, 2 core(s)
[14:29:01][W][app:231]: Set minimum_chip_revision: "3.1" to reduce binary size

From initial research seems related to this breaking change in esphome? [esp32] Reduce Arduino build size by 44% and build time by 36% by bdraco · Pull Request #13623 · esphome/esphome · GitHub

You need to add the following to the esphome section in your yaml file:

esphome:
  libraries:
    - BLE
    - Preferences
2 Likes

This worked for me! This config for my ESP32-C3 worked after adding the libraries:

esphome:
  name: ble-keyboard
  friendly_name: BLE Keyboard
  libraries:
    - BLE
    - Preferences

esp32:
  board: esp32-c3-devkitm-1
  variant: esp32c3
  framework:
    type: arduino
    sdkconfig_options:
      CONFIG_BT_ENABLED: "y"

Thank you, this worked for me as well!