ESPHome OTA configuration

Good morning everyone. After the recent esphome updates, I was asked to update the various esp modules that I have in my system but the update gives me the following error:

INFO ESPHome 2024.6.0-dev
INFO Reading configuration /config/esphome/garage.yaml...
INFO Detected timezone 'Europe/Rome'
Failed config

ota.unknown: [source /config/esphome/garage.yaml:23]
  
  'ota' requires a 'platform' key but it was not specified.
  safe_mode: True
  password: !secret ap_password

I didn’t find anything that told me about new OTA platforms, can anyone give me a tip??

Thanks
Costa

3 Likes

Breaking change coming

If you search for ota on the ESPHome discord, there’s a discussion about it

3 Likes

While using 2024.6.0-development versions - IMHO need to study not only oficial release, but also all implemented PR in dev branch. And You will have allk answers about changes in progress.

Thank you both, I was looking but in the wrong place!

Thank you
Costa

Oh well. that aged like milk, since the 2024.6.0 was now rolled out - and somehow I missed this as well in the change notes, before updating my HA instance:

And actually it is a breaking change, because without a manual adaption of the configuration updates of ESPHome devices using OTA isn’t possible anymore.

Here’s the relevant summary, so other folks who stumble over that issue don’t have to stupidly dig into github pull-requests or discord chat protocols:

[…] if your original configuration looked like this:

ota:
 password: "xxxxxxxxxxxxxxxx"
 num_attempts: 3
 safe_mode: no

…you now need to arrange it like this:

ota:
 - platform: esphome
   password: "xxxxxxxxxxxxxxxx"
   num_attempts: 3
   safe_mode: no

No other changes are required to continue using OTA and you will be able to update your devices in the same manner as before.

Although I don’t know if the documentation in the pull-request is outdated, because I updated my sensor config to, which works:

ota:
  platform: esphome
  password: ...

(for the untrained eye: it is not a list in my config, as mentioned in the pr-doc, see the missing “-” in front of the “platform” attribute, and I haven’t tried it as a list since I missed that myself when changing the configuration → but hey, it works on my HA instance)

Edit/Add: I am warming up this thread, because it was the only google search result when searching for the given error message “ota requires a platform key but it was not specified”, and I guess others will stumble over this as well.

122 Likes

Thank you, this was very helpful.

not sure what they did here but its a right oll mess right now. I added

ota:
platform: esphome
password: …

they i got:
The “dallas” component has been replaced by the “one_wire” component.
1-Wire Bus — ESPHome.

Changed that to on_wire

then I got: mapping values are not allowed here
in “/config/esphome/bedroom-temperature.yaml”, line 79, column 22

and now its fubarred nothing i do fixes it…

the moment I add

ota:
Platform: esphome etc

something messes up at the start

Your YAML is malformed.
This should look like:

ota:
  - platform: esphome
    #safe_mode: true
    password: "xxxxxxxxxxxxxxxxxxxxxx"

EDIT: Seems “safe_mode” must be put into a new section:

7 Likes

Also, one-wire needs to be setup as;

one_wire:
  - platform: gpio
    pin: ${temp_pin}

sensor:
  - platform: dallas_temp
    address: 0x4000080104f4eb10
    name: "Outside Temperature"
10 Likes

Thanks for this. The Dallas docs are gone from esphome.io and I couldn’t figure out the new setup. I also had to move “update_interval:” to each sensor.

thanks let me try that, im just frustrated, its late (im in NZ) and a simple update broke some stuff,

EDIT: Thanks all that got it!

1 Like

If you just edit in ESPHome, the red line under the Dallas errors indicate exactly what the problem is.

Just hover over it with you mouse.

The change is no big deal if you ask me.

1 Like

of course its not a big deal, but the error is generic and with a changed syntax and no new documentation I will get uppity :rofl:

dallas to dallas_temp a lil heads up would be nice

3 Likes

Thanks dude, you’re this morning’s time saver. :slight_smile: Exactly what I was looking for. And you’re right, I copied and pasted the error into Google, took me straight here, ideal.

Funnily enough when I migrated from Tasmota I thought life would be easier… :slight_smile:

Not so easy when you’re away from home using mobile.

You don’t have to update instantly…

The devices will keep running…

of course, until another change that breaks something else. Problem is that many people have them embedded in random places… I was happy not having to go to my roof and disconnect everything just to be able to plug the device to a usb…
seems to be that it’s going to be easier to get a laptop and flash all endpoints manually than to rip my installation off the ceiling… :frowning:

Thank you, I apply all updates within a day or two, but only got the error now. Also missed the Breaking Change warning somehow.

1 Like

This thread was really helpful, in addition to the ota thing my dallas sensor was affected. Running once again. I probably should let the updates age a day before applying so people have time to post so I can search for solutions.

thanks for your post…saved me doing too much digging and this very very quick fix solved it all straight away