[ESP Home] Problème de flash ld2410c

Bonjour,

Je tente de suivre le tuto de smarthomescene (DIY Presence Sensor with HLK-LD2410 and ESPHome - SmartHomeScene) pour tester le ld2410

Je suis bloqué à l’étape de flasher l’esp32 avec la config du ld2410 : DIY Presence Sensor with HLK-LD2410 and ESPHome - SmartHomeScene

Voici les logs :

INFO Reading configuration /config/esphome/esphome-web-d04e44.yaml...
Failed config

number.ld2410: [source /config/esphome/esphome-web-d04e44.yaml:45]
  
  Platform not found: 'number.ld2410'.
  platform: ld2410
  timeout: 
    name: Radar Timeout
  max_move_distance_gate: 
    name: Radar Max Move Distance
  max_still_distance_gate: 
    name: Radar Max Still Distance
  g0: 
    move_threshold: 
      name: g0 move threshold
    still_threshold: 
      name: g0 still threshold
  g1: 
    move_threshold: 
      name: g1 move threshold
    still_threshold: 
      name: g1 still threshold
  g2: 
    move_threshold: 
      name: g2 move threshold
    still_threshold: 
      name: g2 still threshold
  g3: 
    move_threshold: 
      name: g3 move threshold
    still_threshold: 
      name: g3 still threshold
  g4: 
    move_threshold: 
      name: g4 move threshold
    still_threshold: 
      name: g4 still threshold
  g5: 
    move_threshold: 
      name: g5 move threshold
    still_threshold: 
      name: g5 still threshold
  g6: 
    move_threshold: 
      name: g6 move threshold
    still_threshold: 
      name: g6 still threshold
  g7: 
    move_threshold: 
      name: g7 move threshold
    still_threshold: 
      name: g7 still threshold
  g8: 
    move_threshold: 
      name: g8 move threshold
    still_threshold: 
      name: g8 still threshold
sensor.ld2410: [source /config/esphome/esphome-web-d04e44.yaml:110]
  platform: ld2410
  moving_distance: 
    name: Radar Moving Distance
    id: moving_distance
  still_distance: 
    name: Radar Still Distance
    id: still_distance
  moving_energy: 
    name: Radar Move Energy
  still_energy: 
    name: Radar Still Energy
  detection_distance: 
    name: Radar Detection Distance
    id: radar_detection_distance
  
  [g0] is an invalid option for [sensor.ld2410]. Please check the indentation.
  g0: 
    move_energy: 
      name: g0 move energy
    still_energy: 
      name: g0 still energy
  
  [g1] is an invalid option for [sensor.ld2410]. Please check the indentation.
  g1: 
    move_energy: 
      name: g1 move energy
    still_energy: 
      name: g1 still energy
  
  [g2] is an invalid option for [sensor.ld2410]. Please check the indentation.
  g2: 
    move_energy: 
      name: g2 move energy
    still_energy: 
      name: g2 still energy
  
  [g3] is an invalid option for [sensor.ld2410]. Please check the indentation.
  g3: 
    move_energy: 
      name: g3 move energy
    still_energy: 
      name: g3 still energy
  
  [g4] is an invalid option for [sensor.ld2410]. Please check the indentation.
  g4: 
    move_energy: 
      name: g4 move energy
    still_energy: 
      name: g4 still energy
  
  [g5] is an invalid option for [sensor.ld2410]. Please check the indentation.
  g5: 
    move_energy: 
      name: g5 move energy
    still_energy: 
      name: g5 still energy
  
  [g6] is an invalid option for [sensor.ld2410]. Please check the indentation.
  g6: 
    move_energy: 
      name: g6 move energy
    still_energy: 
      name: g6 still energy
  
  [g7] is an invalid option for [sensor.ld2410]. Please check the indentation.
  g7: 
    move_energy: 
      name: g7 move energy
    still_energy: 
      name: g7 still energy
  
  [g8] is an invalid option for [sensor.ld2410]. Please check the indentation.
  g8: 
    move_energy: 
      name: g8 move energy
    still_energy:

J’ai recherché l’erreur mais rien trouvé de très probant…

Si vous avez une idée de ce qui coince…Merci ! :slight_smile:

Bonjour,
montre ton yaml au complet stp ?

Hello, voici la conf :

esphome:
  name: ld2410
  friendly_name: LD2410

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "BLA"

ota:
  password: "BLA"

captive_portal:

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

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

  power_save_mode: none

ld2410:
  id: ld2410_radar
  
uart:
  tx_pin: GPIO16
  rx_pin: GPIO17
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

number:
  - platform: ld2410
    timeout:
      name: Radar Timeout
    max_move_distance_gate:
      name: Radar Max Move Distance
    max_still_distance_gate:
      name: Radar Max Still Distance
    g0:
      move_threshold:
        name: g0 move threshold
      still_threshold:
        name: g0 still threshold
    g1:
      move_threshold:
        name: g1 move threshold
      still_threshold:
        name: g1 still threshold
    g2:
      move_threshold:
        name: g2 move threshold
      still_threshold:
        name: g2 still threshold
    g3:
      move_threshold:
        name: g3 move threshold
      still_threshold:
        name: g3 still threshold
    g4:
      move_threshold:
        name: g4 move threshold
      still_threshold:
        name: g4 still threshold
    g5:
      move_threshold:
        name: g5 move threshold
      still_threshold:
        name: g5 still threshold
    g6:
      move_threshold:
        name: g6 move threshold
      still_threshold:
        name: g6 still threshold
    g7:
      move_threshold:
        name: g7 move threshold
      still_threshold:
        name: g7 still threshold
    g8:
      move_threshold:
        name: g8 move threshold
      still_threshold:
        name: g8 still threshold

binary_sensor:
  - platform: ld2410
    has_target:
      name: Radar Target
      id: radar_has_target
    has_moving_target:
      name: Radar Moving Target
    has_still_target:
      name: Radar Still Target


sensor:
  - platform: ld2410
    moving_distance:
      name: Radar Moving Distance
      id: moving_distance
    still_distance:
      name: Radar Still Distance
      id: still_distance
    moving_energy:
      name: Radar Move Energy
    still_energy:
      name: Radar Still Energy
    detection_distance:
      name: Radar Detection Distance
      id: radar_detection_distance
    g0:
      move_energy:
        name: g0 move energy
      still_energy:
        name: g0 still energy
    g1:
      move_energy:
        name: g1 move energy
      still_energy:
        name: g1 still energy
    g2:
      move_energy:
        name: g2 move energy
      still_energy:
        name: g2 still energy
    g3:
      move_energy:
        name: g3 move energy
      still_energy:
        name: g3 still energy
    g4:
      move_energy:
        name: g4 move energy
      still_energy:
        name: g4 still energy
    g5:
      move_energy:
        name: g5 move energy
      still_energy:
        name: g5 still energy
    g6:
      move_energy:
        name: g6 move energy
      still_energy:
        name: g6 still energy
    g7:
      move_energy:
        name: g7 move energy
      still_energy:
        name: g7 still energy
    g8:
      move_energy:
        name: g8 move energy
      still_energy:
        name: g8 still energy

cache ta clé api et mot de passe :wink:

Je vois pas ce qui cloche a la ligne 45 et 100 :thinking:

J’utilise pas les gates, mais voici ma config ( les pins sont différent pour moi, j’utilise un esp32-s3 T-Display ):

uart:
  tx_pin: 17
  rx_pin: 18
  baud_rate: 256000
  id: uart_1
  parity: NONE
  stop_bits: 1

ld2410:
  - uart_id: uart_1

sensor:
  - platform: ld2410
    light: #intensité lumineuse
      name: light
    moving_distance: #distance cible en mouvement
      name : Moving Distance
    still_distance: #distance cible immobile
      name: Still Distance
    moving_energy: #quantité de mouvement
      name: Move Energy
    still_energy: #quantité d'immobilité ??
      name: Still Energy
    detection_distance: #distance de détection
      name: Detection Distance

binary_sensor:
  - platform: ld2410
    has_target: #Présence
      name: Presence
    has_moving_target: #Cible mobile
      name: Moving Target
    has_still_target: #Cible immobile
      name: Still Target

switch:
  - platform: ld2410
    engineering_mode:
      name: "engineering mode"

button:
  - platform: ld2410
    restart:
      name: "ld2410 restart"

text_sensor:
  - platform: ld2410
    version:
      name: "ld2410 firmware version"

number:
  - platform: ld2410
    timeout: #Temps pour passer le binary sensor Présence à faux
      name: timeout
    light_threshold: #Seuil de lumière
      name: light threshold
    max_move_distance_gate: #Distance de détection du mouvemenet 2-8
      name: max move distance gate
    max_still_distance_gate: #Distance de détection d'immobilité 2-8
      name: max still distance gate

Ta ce tutoriel , bien expliquer en détaille Tuto LD2410 - Détecteur de présence avec ESPHome

J’ai commandé mon matériel et je n’ai pas encore fabriqué et compilé ce capteur mais j’ai regardé des configs.
Le type number ne paraît jamais utilisé, plutôt sensor.
Regarde cette config ici ca pourrait t’aider

Edit: le lien que j’ai fournit ne semble pas/plus être adapté à Esphome, il vaut encore mieux prendre la doc officielle

Bonjour,
le number est utiliser pour une entité avec nombre qui donnera une entité avec un slider sous HA.
ça permet de modifier la valeur.

et le sensor c’est pour l’état.

2 « J'aime »

Salut,
C’est assez étonnant la config semble OK : en tous cas ça compile chez moi…
Sur quelle version ESP HOME es tu ?

2 « J'aime »

Hello,

Merci pour toutes ces réponses :pray:

Effectivement je ne suis pas sur les dernières versions :

  • Home Assistant 2022.4.7 (est-ce que le slider dont parle @WarC0zes existe sur cette version ?)
  • ESP Home 2023.4.4

Cela pourrait peut-être expliquer pourquoi ca compile pas ?

Salut,

ESPHome 2023.8.0 - 16th August 2023

LD2410

The LD2410 component has had a massive upgrade thanks to @regevbr! It now supports settings most if not all configuration parameters via switches / numbers and selects and exposes more data via various sensors. This includes breaking changes that mean the existing gate configuration options have been moved to the number platform.

  • Add configuration flow abilites to the ld2410 component esphome#4434 by @regevbr (new-integration) (notable-change) (breaking-change)

Te faut ESPhome 2023.8.0 au minimun.

2 « J'aime »

Je viens de compiler sur un wemos S2 mini seul , j’attends le capteur ld2410c, un peu galère pour uploader le factory bin, l’interface web ne me reconnaissait pas l’ESP, je suis passé par flash download tools + zadig pour les drivers, mais j’y suis arrivé.
Pas d’erreur avec le programme @WarC0zes , merci en plus des explications, ca me parait un peu plus clair maintenant.
Le case est imprimé en 3D, à voir l’efficacité dabsnmes WC par rapport au SNZB06-P qui ne me donne pas satisfaction

Bonjour,
Pour être plus tranquille avec le flashage des esp dans l’environnement home assistant, je vous conseille de flasher votre esp à vide sans montage dans un premier temps. Du coup, lors de son utilisation, tout se passe en wifi (OTA). En suite, si vous avez un problème de flashage, cela ne peut provenir que de votre ajout de programme ou de votre montage.
Cordialement

Bien vu @WarC0zes merci ! :slight_smile: je vais tester ça

@Jeffodilo : tu entends quoi par " à vide sans montage" ? Moi je passe par Web - ESPHome pour initialiser l’esp et après il remonte dans HA

Salut,
pour l’adopter dans le dashboard ESPHome sous HA, il faudras le reflasher pour appliquer une clé pour l’api.
Ce qui te dit, c’est en premier l’adopter sur ESPHome de HA , le flasher avec la config minimun et la clé.
Quand il est adopter et flasher, la tu applique ton code au yaml et reflash en OTA.

Si tu fais comme ca, effectivement il remonte sur HA, mais tu ne pourra pas éditer ton code, le flasher de HA.

Dans tout les cas, faudras le flasher deux fois :rofl:

1 « J'aime »