Updates broken on Bluetooth Proxy service with 2024.6.6 update. Not same issue as 2024.6

The latest update has caused updates to not work on a device of mine using the bluetooth proxy service.

To be clear, this is not the same issue as the introduced with 2024.6 which is remedied by adding a password key in the ota section. I previously added this key when updates broke on 2024.6.

My current yaml:

packages:
 esphome.bluetooth-proxy: github://esphome/firmware/bluetooth-proxy/esp32-generic.yaml@main

esphome:
 name: esp-02
 name_add_mac_suffix: false
 friendly_name: ESP-02

esp32:
 board: nodemcu-32s
 framework:
   type: arduino


output:
 - platform: ledc
   pin: GPIO33
   id: gpio_33

light:
 - platform: monochromatic
   output: gpio_33
   name: "Window Light"

i2c:
 sda: 21
 scl: 22
 scan: true
 id: bus_a

sensor:
 - platform: htu21d
   temperature:
     name: "Living Room Temperature"
   humidity:
     name: "Living Room Humidity"
   update_interval: 60s

# Enable logging
logger:

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

ota:
 platform: esphome
 password: "###################"

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

 # Enable fallback hotspot (captive portal) in case wifi connection fails
 ap:
   ssid: "Esp-02 Fallback Hotspot"
   password: "#############"

captive_portal:
   
esp32_ble_tracker:
 scan_parameters:
   #interval: 1100ms
   #window: 1100ms
   active: true

bluetooth_proxy:
 active: true

Attempting to update returns the error:

Failed config

update.http_request: [source /data/packages/c46f54c1/bluetooth-proxy/esp32-generic.yaml:33]
  
  Component update.http_request requires 'platform: http_request' in component 'ota'.
  platform: http_request
  id: update_http_request
  name: Firmware
  source: https://firmware.esphome.io/bluetooth-proxy/esp32-generic/manifest.json

Adding ‘platform: http_request’ to ota section produces the error:

Duplicate key "platform"
  in "/config/esphome/esp-02.yaml", line 50, column 3
NOTE: Previous declaration here:
  in "/config/esphome/esp-02.yaml", line 48, column 3

Assuming that updates using ‘platform: esphome’ are no longer supported I removed that line along with it’s associated password key which produces the error:

Failed config

http_request: [source /data/packages/c46f54c1/bluetooth-proxy/esp32-generic.yaml:38]
  
  ESPHome supports certificate verification only via ESP-IDF. Set 'verify_ssl: false' to skip certificate validation and allow less secure HTTPS connections.
  {}

Changing my yaml to add this line, my yaml now looks like this:

ota:
  platform: http_request
  verify_ssl: False

Which produces the error:

Failed config

ota.http_request: [source /config/esphome/esp-02.yaml:48]
  platform: http_request
  
  [verify_ssl] is an invalid option for [ota.http_request]. Please check the indentation.
  verify_ssl: False

At this point I’m starting to lose the will to live. Where does the ‘verify_ssl: False’ setting live? I’ve seen other yaml examples where there is a ‘platform:’ master node but as you can see in my original yaml this does no exist in mine.

Oh and all of my other devices happily update after adding the password field after the last update. This is only effecting the one which using the bluetooth proxy service. Was there a change within the file ‘/data/packages/c46f54c1/bluetooth-proxy/esp32-generic.yaml’ or ‘https://firmware.esphome.io/bluetooth-proxy/esp32-generic/manifest.json’ which is causing these issues.

Thanks

Upon looking into it a bit more it seems to be related to the issue posted here: https://github.com/esphome/issues/issues/6018

That relates to the voice assistant component but I believe the cause is the same.

The suggested fix:

ota:
- platform: http_request
  id: ota_http_request

results in a failed build:

Failed config

http_request: [source /data/packages/c46f54c1/bluetooth-proxy/esp32-generic.yaml:38]
  
  ESPHome supports certificate verification only via ESP-IDF. Set 'verify_ssl: false' to skip certificate validation and allow less secure HTTPS connections.
  {}

Are there any devs about? Should I post to above issue tracker?

The offending code seems to be in this section:

sensor:
  - platform: htu21d
    temperature:
      name: "Living Room Temperature"
    humidity:
      name: "Living Room Humidity"
    update_interval: 60s
 <-squiggle here
# Enable logging
logger:

In the editor it’s showing a red underline squiggle where shown above.

Moving ‘update_interval’ to line up with the above line still show red squiggle and fails with the same ‘verify_ssl’ error.
Indenting it results in the error:

INFO ESPHome 2024.6.6
INFO Reading configuration /config/esphome/esp-02.yaml...
ERROR Error while reading config: Invalid YAML syntax:

while parsing a block mapping
  in "/config/esphome/esp-02.yaml", line 36, column 7
expected <block end>, but found '<block mapping start>'
  in "/config/esphome/esp-02.yaml", line 37, column 9

I hate yaml.

So adding the ‘-’ to the ota section causes the build to fail on the update_interval line or the one immediately below it.
I’m so confused!!!

I am no expert on these matters, but I did read bluetooth proxies work best with the esp-idf framework. I switched a while back, and had less problems since.

Your config specifies arduino, and you also included the standard bluetooth proxy config. It could both explain duplicate platform warmings, and the fact that settings are used that only work with esp-idf and not with arduino.

If there’s nothing in your own sensors requires arduino, I’d try to switch to esp-idf, clean the build and then rebuild. I seem to remember switching from platform works best if you flash over usb for the switch, because esp-idf uses different partitioning by default. After that you can do ota again, and probably have a more stable proxy.

Hallelujah! I could kiss you!!!

I thought arduino was okay as the docs state that esp-idf is only needed for esp32 variants. The docs even use nodemcu32s as an example with arduino framework.

Anyways, I guess this has changed.

Again, many thanks!!!