Difficulty extending (!extend) the new ota configuration changes in 2024.6 to add an OTA password

I cannot get the syntax correct for using !extend for the ota component in a remote yaml package. For instance, the M5-stack echo yaml config I use for a voice assistant is located here: firmware/voice-assistant/m5stack-atom-echo.yaml at 00e4f8229afd6d4deb1cca7a6e80975d9adc9ed3 · esphome/firmware · GitHub

In that config this exists
ota:

  • platform: esphome
    id: ota_esphome

I assume the id is there so that a local yaml config can extend it with an ota password.

From the ESPHome docs it appears the following should work in my local yaml that includes the package above to add an ota password:

ota:

  • id: !extend ota_esphome
    password: !secret ota_password

No matter the syntax I use for the id in the !extend command, the id is not found.

This occurs with the S3 Box, M5 Stack, Muse Luxe, etc…I assume the id “ota_esphome” was placed in the package configs so that they could be extended, but just having difficulty getting it to work.

Any assistance is appreciated.

Thanks!

It looks like this was broken in ESPHome 2024.6.3, but now works in version 2024.6.4.

The correct syntax in your local YAML file is:

ota:
  - platform: esphome
    id: !extend ota_esphome
    password: !secret ota_password

You missed the platform part.

Not sure. As described in docs - platform not included in example:

sensor:
  - id: !extend uptime_sensor
    update_interval: 10s

IMHO it must work the same as for sensor, as for ota components.

Thank you for looking at this issue.

I do realize that the platform option is required with 2024.6 and in my specific issue the remote package for the M5 echo stack already had specified the option “- platform: esphome”. With version 2024.6.4, the !extend option works with or without “- platform: esphome” in my local yaml file. What you suggested may have solved my issue in 2024.6.3, but I did not downgrade to verify.