Very confused as to why this isn't working

I’m using an ESP32-C3 mini and I cannot get ESPHOME to upload the yaml…

It keeps telling me-

Configuration does not match the platform of the connected device. Expected an ESP32 device.

I’ve taken the info directly off of the ESPHome site…

Here is the yaml… what am I missing??
Thank you in Advance!!

esphome:
  name: bathroom-presence
  friendly_name: Bathroom Presence

esp32:
  board: ...
  framework:
    type: arduino

# Enable logging
logger:

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

ota:
  - platform: esphome
    password: " 83cdf001a93c1c934"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Bathroom-Presence"
    password: "htS5IvB6gjAN"

captive_portal:
    
uart:
  id: uart_ld2450
  tx_pin: GPIO21   # example - update to your wiring
  rx_pin: GPIO20   # example - update to your wiring
  baud_rate: 256000

ld2450:
  uart_id: uart_ld2450
  id: bath_room_ld2450

binary_sensor:
  - platform: ld2450
    ld2450_id: living_room_ld2450
    presence:
      name: "Bath Room Presence"

sensor:
  - platform: ld2450
    ld2450_id: living_room_ld2450
    moving_target_count:
      name: "Bath Room Moving Targets"
    still_target_count:
      name: "Bath Room Still Targets"
    total_target_count:
      name: "Bath Room Total Targets" 

You have to tell it specifically which board.

See:

I see that and have done it but still getting the same error…

esp32:
variant: esp32s3

Configuration does not match the platform of the connected device. Expected an ESP32 device.

s3 or c3?
Did you check the spacing? yaml can be very picky.
Have you tried esp-idf instead of arduino for your framework type?

Use the preformatted text button </> not the quotes button when pasting config.

1 Like

I ran it all through a YAML ‘checker’ and it was all valid and I have no errors in the file itself… But yes great suggestion!!!

I used ALL the examples from the ESPHome page… including that one.
They are the C3 and according to ESPHome page you should use the arduino
The esp-idf is for ESP32-C2, ESP32-C5, ESP32-C6, ESP32-C61, ESP32-H2, and ESP32-P4 variants… I’m running the C3

Post your compile log in full [correctly formatted please]

I’m not getting a compile log… I try to ‘install’ it via ESPHome in HA and get that error immediately… it doesn’t go past that or show that it even tries to install

Configuration does not match the platform of the connected device. Expected an ESP32 device.

Ok. Post the full yaml code as it stands now [formatted </> of course]

esphome:
  name: bathroom-presence
  friendly_name: Bathroom Presence

esp32:
  variant: esp32s3

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "V+fUZKF7f4Z4LaPhZoWhZPl9O5Mm2bQGfg9vOUQGEoU="

ota:
  - platform: esphome
    password: "b7a75b89acbd37b83cdf001a93c1c934"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Bathroom-Presence"
    password: "htS5IvB6gjAN"

captive_portal:
    
uart:
  id: uart_ld2450
  tx_pin: GPIO21   # example - update to your wiring
  rx_pin: GPIO20   # example - update to your wiring
  baud_rate: 256000

ld2450:
  uart_id: uart_ld2450
  id: bath_room_ld2450

binary_sensor:
  - platform: ld2450
    ld2450_id: living_room_ld2450
    presence:
      name: "Bath Room Presence"

Is it this board?

Ok so I’ve gotten this far… I installed a VERY basic install and it went in…
So then I added the sensors and that’s where my issues are now…

INFO ESPHome 2025.12.5
INFO Reading configuration /config/esphome/seed.yaml...
WARNING 'bathroom_presence': Using the '_' (underscore) character in the hostname is discouraged as it can cause problems with some DHCP and local name services. For more information, see https://esphome.io/guides/faq/#why-shouldnt-i-use-underscores-in-my-device-name
Failed config

binary_sensor.ld2450: [source /config/esphome/seed.yaml:43]
  platform: ld2450
  ld2450_id: living_room_ld2450
  
  [presence] is an invalid option for [binary_sensor.ld2450]. Please check the indentation.
  presence: 
    name: Bath Room Presence

This the mostly working version now:

esphome:
  name: bathroom_presence
  friendly_name: Bathroom Presence

esp32:
  board: esp32-c3-devkitm-1
  framework:
    type: esp-idf

# Enable logging
logger:

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

ota:
  - platform: esphome
    password: "58fefe151295d120f5573cae40fb6132"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Bathroom fallback Hotspot"
    password: "JUpMdnuNhj9n"

captive_portal:
uart:
  id: uart_ld2450
  tx_pin: GPIO21   # example - update to your wiring
  rx_pin: GPIO20   # example - update to your wiring
  baud_rate: 256000

ld2450:
  uart_id: uart_ld2450
  id: bath_room_ld2450

binary_sensor:
  - platform: ld2450
    ld2450_id: living_room_ld2450
    presence:
      name: "Bath Room Presence"

The stuff int he active portal is the issue as the errors above show… still not understanding why

Try fixing the warning. Use ‘bathroom-presence’

1 Like

Is this the example you are closely following?

Are the obligatory parity and stop_bits for the UART set to talk to the LD2450?

Like your error says, presence is not valid parameter. Use instead:

has_target:
      name: Presence

UART component has default parity None and stop_bits 1

I know you already figured out your board type, but for next time, this site might come it handy:
https://thelastoutpostworkshop.github.io/ESPConnect/

See LD2450 Sensor - ESPHome - Smart Home Made Simple and I quote:
The UART is required to be set up in your configuration for this sensor to work, parity and stop_bits must be respectively NONE and 1. Use of hardware a UART is highly recommended in order to properly support the default 256000 baud rate of the LD2450 module.

Just following the official documentation…

That’s correct.
And OP has them correct as well since he didn’t change the defaults.

True, then why is it spelt out specifically? Is the documentation wrong and inconsistent? Assuming will not close any doubts, and it is only two more lines.