LD2420 instalation issue

Hi to all! Need help here.

Problem: Cannot install ESPHome on AtomLite (ESP32) board with LD2420

Set-UP:
ESP-Home 2023.10.6
HA 2023.10.3
ESP32 = Atom Lite link
Sensor = LD2420 link

Description:
When installing this yaml file (code below), file preparation shows the error:

Question:
Am I using the wrong external component link?
What am I doing wrong?

INFO ESPHome 2023.10.6
INFO Reading configuration /config/esphome/presence01.yaml...
INFO Updating https://github.com/esphome/esphome.git@pull/4847/head
Failed config

ESPHome yaml file is:

external_components:
  - source: github://pr#4847
    components: [ ld2420 ]
    refresh: 0s

esphome:
  name: "mmwave01"
  friendly_name: "mmwave01"

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "cTy9RiVi61wyb1dnvAQqiPMNTyl5jviJO4lQ/aC7jXc="

ota:
  password: "20755a16743d40176874c4f8625013a0"

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

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

captive_portal:

esp32_ble_tracker:
    
uart:
  id: ld2420_uart
  tx_pin: 22
  rx_pin: 19
  baud_rate: 115200
  parity: NONE
  stop_bits: 1

ld2420:
  presence_time_window: 30s
  detection_gate_min: 1
  detection_gate_max: 12
  g0_move_threshold: 60000
  g0_still_threshold: 40000
  g1_move_threshold: 30000
  g1_still_threshold: 20000
  g2_move_threshold: 400
  g2_still_threshold: 200
  g3_move_threshold: 250
  g3_still_threshold: 200
  g4_move_threshold: 250
  g4_still_threshold: 200
  g5_move_threshold: 250
  g5_still_threshold: 200
  g6_move_threshold: 250
  g6_still_threshold: 200
  g7_move_threshold: 250
  g7_still_threshold: 150
  g8_move_threshold: 250
  g8_still_threshold: 150
  g9_move_threshold: 250
  g9_still_threshold: 100
  g10_move_threshold: 250
  g10_still_threshold: 100
  g11_move_threshold: 250
  g11_still_threshold: 100
  g12_move_threshold: 250
  g12_still_threshold: 100
  g13_move_threshold: 200
  g13_still_threshold: 100
  g14_move_threshold: 200
  g14_still_threshold: 100
  g15_move_threshold: 200
  g15_still_threshold: 100

sensor:
  - platform: ld2420
    moving_distance:
      name : Distancia do Movimento

binary_sensor:
  - platform: ld2420
    has_target:
      name: Presenca

  - platform: gpio
    pin:
      number: 26
      mode: INPUT_PULLUP
    name: "Interruptor mmwave"
    device_class: light
    #on_press:
    #  - homeassistant.service:
    #      service: light.turn_off
    #      data:
    #        entity_id: light.escritorio_mesa
    #on_release:
    #  - homeassistant.service:
    #      service: light.turn_on
    #      data:
    #        entity_id: light.escritorio_mesa
  - platform: gpio
    pin:
      number: 39
      inverted: false
    name: Botão
    on_press:
      then:
        - light.toggle: status_led
  
light:
  - platform: fastled_clockless
    chipset: WS2812B
    pin: 27
    num_leds: 1
    rgb_order: GRB
    id: status_led
    name: Luz
    effects:
      - random:
      - flicker:
      - addressable_rainbow:

switch:
  - platform: restart
    name: Restart

The entire log file reads:

INFO ESPHome 2023.10.6
INFO Reading configuration /config/esphome/presence01.yaml...
INFO Updating https://github.com/esphome/esphome.git@pull/4847/head
Failed config

ld2420: [source /config/esphome/presence01.yaml:45]
  - 
    [presence_time_window] is an invalid option for [0]. Please check the indentation.
    presence_time_window: 30s
    
    [detection_gate_min] is an invalid option for [0]. Please check the indentation.
    detection_gate_min: 1
    
    [detection_gate_max] is an invalid option for [0]. Please check the indentation.
    detection_gate_max: 12
    
    [g0_move_threshold] is an invalid option for [0]. Please check the indentation.
    g0_move_threshold: 60000
    
    [g0_still_threshold] is an invalid option for [0]. Please check the indentation.
    g0_still_threshold: 40000
    
    [g1_move_threshold] is an invalid option for [0]. Please check the indentation.
    g1_move_threshold: 30000
    
    [g1_still_threshold] is an invalid option for [0]. Please check the indentation.
    g1_still_threshold: 20000
    
    [g2_move_threshold] is an invalid option for [0]. Please check the indentation.
    g2_move_threshold: 400
    
    [g2_still_threshold] is an invalid option for [0]. Please check the indentation.
    g2_still_threshold: 200
    
    [g3_move_threshold] is an invalid option for [0]. Please check the indentation.
    g3_move_threshold: 250
    
    [g3_still_threshold] is an invalid option for [0]. Please check the indentation.
    g3_still_threshold: 200
    
    [g4_move_threshold] is an invalid option for [0]. Please check the indentation.
    g4_move_threshold: 250
    
    [g4_still_threshold] is an invalid option for [0]. Please check the indentation.
    g4_still_threshold: 200
    
    [g5_move_threshold] is an invalid option for [0]. Please check the indentation.
    g5_move_threshold: 250
    
    [g5_still_threshold] is an invalid option for [0]. Please check the indentation.
    g5_still_threshold: 200
    
    [g6_move_threshold] is an invalid option for [0]. Please check the indentation.
    g6_move_threshold: 250
    
    [g6_still_threshold] is an invalid option for [0]. Please check the indentation.
    g6_still_threshold: 200
    
    [g7_move_threshold] is an invalid option for [0]. Please check the indentation.
    g7_move_threshold: 250
    
    [g7_still_threshold] is an invalid option for [0]. Please check the indentation.
    g7_still_threshold: 150
    
    [g8_move_threshold] is an invalid option for [0]. Please check the indentation.
    g8_move_threshold: 250
    
    [g8_still_threshold] is an invalid option for [0]. Please check the indentation.
    g8_still_threshold: 150
    
    [g9_move_threshold] is an invalid option for [0]. Please check the indentation.
    g9_move_threshold: 250
    
    [g9_still_threshold] is an invalid option for [0]. Please check the indentation.
    g9_still_threshold: 100
    
    [g10_move_threshold] is an invalid option for [0]. Please check the indentation.
    g10_move_threshold: 250
    
    [g10_still_threshold] is an invalid option for [0]. Please check the indentation.
    g10_still_threshold: 100
    
    [g11_move_threshold] is an invalid option for [0]. Please check the indentation.
    g11_move_threshold: 250
    
    [g11_still_threshold] is an invalid option for [0]. Please check the indentation.
    g11_still_threshold: 100
    
    [g12_move_threshold] is an invalid option for [0]. Please check the indentation.
    g12_move_threshold: 250
    
    [g12_still_threshold] is an invalid option for [0]. Please check the indentation.
    g12_still_threshold: 100
    
    [g13_move_threshold] is an invalid option for [0]. Please check the indentation.
    g13_move_threshold: 200
    
    [g13_still_threshold] is an invalid option for [0]. Please check the indentation.
    g13_still_threshold: 100
    
    [g14_move_threshold] is an invalid option for [0]. Please check the indentation.
    g14_move_threshold: 200
    
    [g14_still_threshold] is an invalid option for [0]. Please check the indentation.
    g14_still_threshold: 100
    
    [g15_move_threshold] is an invalid option for [0]. Please check the indentation.
    g15_move_threshold: 200
    
    [g15_still_threshold] is an invalid option for [0]. Please check the indentation.
    g15_still_threshold: 100

Same problem here!!

:frowning_face:

Why are you defining the values for the gates within the yaml? Especially when the values you are defining are the default for the sensor… Below is what is working for me. I am able to modify the thresholds via the HA UI.

uart:
  id: ld2420_uart
  tx_pin: GPIO17 
  rx_pin: GPIO16
  baud_rate: 115200
  parity: NONE
  stop_bits: 1

ld2420: 

text_sensor:
  - platform: ld2420
    fw_version:
      name: LD2420 Firmware

sensor:
  - platform: ld2420
    moving_distance:
      name : Moving Distance

binary_sensor:
  - platform: ld2420
    has_target:
      name: Presence

switch:
  - platform: restart
    name: Restart ESPHome Node

select:
  - platform: ld2420
    operating_mode:
      name: Operating Mode

number:
  - platform: ld2420
    presence_timeout:
      name: Detection Presence Timeout
    min_gate_distance:
      name: Detection Gate Minimum
    max_gate_distance:
      name: Detection Gate Maximum
    gate_select:
      name: Select Gate to Set
    still_threshold:
      name: Set Still Threshold Value
    move_threshold:
      name: Set Move Threshold Value
button:
  - platform: ld2420
    apply_config:
      name: Apply Config
    factory_reset:
      name: Factory Reset
    restart_module:
      name: Restart Module
    revert_config:
      name: Undo Edits
1 Like

@robcov you are right!
my problem is a lot of tries…
I am using esp8266 and LD2420…
All configuration tried give me some error!
In especial one of this is identical of this post, then I am trying some solution!
I thing there is some incompatibility with 8266…

My partial success is when I put the code until:

 text_sensor:
   - platform: ld2420
     fw_version:
       name: LD2420 Firmware
 
 sensor:
   - platform: ld2420
     moving_distance:
       name : Moving Distance
 
 binary_sensor:
   - platform: ld2420
     has_target:
       name: Presence

but have a fail at end of compiling.
If I trie something complete like your code the fail appear in beginning.