[solved] Errors when removing/adding 'platform'

I’m trying to update devices from v2024.4.2
This is the current config:

esphome:
  name: ${device_name}
  comment: "${device_description}"
  platform: ESP8266
  esp8266_restore_from_flash: true
  board: d1_mini
  name_add_mac_suffix: false
  on_boot:

and

ota:
  password: <redacted>

If I add platform to the ota section I get an error for the one under esphome and if I remove that one, I also get an error… :thinking:

So I have no clue how to continue… :blush:
TIA

Nobody else has a clue either unless you say that the errors are.

The platform: key under ota: is a requirement now. If you omit that the build will stop at that point, masking the other unspecified error.

INFO ESPHome 2025.12.1
INFO Reading configuration /config/esphome/p1.yaml...

Failed config

esphome: [source /config/esphome/p1.yaml:7]
  
  Platform missing. You must include one of the available platform keys: esp32, bk72xx, libretiny, ln882x, rp2040, nrf52, host, rtl87xx, esp8266.
  name: p1-meter
  comment: P1 module
  esp8266_restore_from_flash: True
  board: d1_mini
  name_add_mac_suffix: False
  on_boot: 
    then: 
      - if: 
          condition: 
            lambda: return id(has_key);
          then: 
            - lambda: |-

So read the docs and do what the message said.

esp8266 is a top level key, it doesn’t go under esphome:. The format you were using was deprecated over three years ago and removed completely nearly a year ago.

Hi, thanks for pointing that out but I get 1 error after the other when I try to correct this and TBH I’m not that good in this.

The original configuration came with that setup and just now I thought of updating it.

esphome:
  name: p1-meter
  comment: P1 module
  name_add_mac_suffix: False
  on_boot: 
    then: 
      - etc...

esp8266:
  board: d1_mini
  restore_from_flash: true
1 Like

Thanks Tom, this worked! :+1:

I didn’t know where to put what under those top levels. :bowing_man: