LD2410 esphome tips

I think this is MQTT, I removed my MQTT login details and it stopped the boot loop

1 Like

When changing the thresholds, where do the values go in the yaml? This gives an error:

    g0:
      move_threshold: 50
        name: kitchen radar g0 move threshold
      still_threshold: 50
        name: kitchen radar g0 still threshold

I built the custom card. When I turn engineering mode on with the switch, it turns off again in a few seconds. Is this normal?
Thanks

1 Like

Yeah it really does not explain the new config well at all :frowning:

Ok, I got it.

Here is the config, it actually allows you to adjust the gates from within HA now, which is cool.

I also added the diagnostic sensors for the gates, but they don’t seem to work? Anyone else having that?

ld2410:

number:
  - platform: ld2410
    timeout:
      name: timeout
    light_threshold:
      name: light threshold
    max_move_distance_gate:
      name: max move distance gate
    max_still_distance_gate:
      name: max still distance gate
    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:
  - platform: ld2410
    moving_distance:
      name : Moving Distance
    still_distance:
      name: Still Distance
    moving_energy:
      name: Move Energy
    still_energy:
      name: Still Energy
    detection_distance:
      name: 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      

binary_sensor:
  - platform: ld2410
    has_target:
      name: "Occupancy"
    has_moving_target:
      name: "Movement"
    has_still_target:
      name: "Still"

would pay to go back and review THIS PAGE as the sensor config has changed a lot if ya werent you beta version … also has a very handy card layout for testing & config

I think all that’s changed, you don’t need the card, you can do it all from the device page?

So you can configure the gate thresholds

And I’m assuming it will give you the actual energy output of the gates so you can dial it in. But as you can see, mine picks up nothing. Wanted to see if this was working for others and just a me thing or not.

Enable engineering mode

Wow, this solve my problem. I think that example code should be included in the ESPHome documentation.
Question: What is the “Light Function” and how can it be used?
What is “out pin” and how to use it?

I had same issue. I resolved by enable engineering mode directly on ld2410 by Bluetooth

As per doc :

light (Optional, int): When in engineering mode, indicates the light sensitivity, otherwise unknown. Value between 0 and 255 inclusive. Though it seems that the value 85 is the lowest value at complete darkness. All options from Sensor.

I assume the config of the component is not quite easy and a lot items to handle and new version comes with breaking change, but everything is written in doc.

Without any offense, but from what I can read in this thread, many questions could be avoided with a carefull reading of the doc. And not only copying the parameters from other with others needs and requirements.

I think that I figure it out. The LD2410 has a LDR (Light Dependant Resistor). The “Light Function” is use with the “Light Threshold” to control the activation of the LD241 ON/OFF based on Above/Below Threshold.

1 Like

I don’t disagree, but for those of us still getting into this. We don’t really know what we are looking at or what is pertinent half the time. So while you are right, it really helps us newbies when we get whole configs to give context.

As an example, I still dont know what that light thing is for and I did read that part of the doc.

Is it saying there is a lux sensor? Ive never seen that mentioned.

light (Optional, int): When in engineering mode, indicates the light sensitivity, otherwise unknown. Value between 0 and 255 inclusive. Though it seems that the value 85 is the lowest value at complete darkness. All options from Sensor.

Yes, there is a lux sensor on the LD2410. I don’t believe it is very sensitive but there is one and it currently only works if you have Engineering mode enabled.

Well why don’t you add it then. That is how the docs get improved.

I can’t get the ld2410_id to change entity names.

Cool thanks for that. I guess that’s why it wasn’t advertised as a feature.

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

Added these and got the diagnostics working.

But I dont really understand how to dial it in. Anything more then 2m does not show up even after changing the detection distance to 7 (is that meters?)

image

Do I up that value on the gates, does that increase the radar’s power?

The higher the value for the gates, the more movement is required to trigger detection.
So as a start, reduce them to something low like 10 and have engineering mode turned on and watch the move and still energy values for each gate when there is no one present in the room and adjust the gate threshold to above those values to stop false detections.

1 Like

Thank you!

Thats awesome, I assumed it went the other way.

Ill start testing it :slight_smile:

EDIT

I also found this, can someone confirm these are the distances for the gates? Ignore the power values, I’m just talking about the gate and corresponding distance values.

  g0_move_threshold: 40  # 0m / 0
  g0_still_threshold: 10 # 0m / 0
  g1_move_threshold: 40  # 0 - 0.75m 
  g1_still_threshold: 10 # 0 - 0.75m 
  g2_move_threshold: 40  # 0.75 - 1.5m 
  g2_still_threshold: 10 # 0.75 - 1.5m 
  g3_move_threshold: 40  # 1.5 - 2.25m 
  g3_still_threshold: 10 # 1.5 - 2.25m 
  g4_move_threshold: 40  # 2.25 - 3m
  g4_still_threshold: 40 # 2.25 - 3m
  g5_move_threshold: 40  # 3 - 3.75 
  g5_still_threshold: 40 # 3 - 3.75 
  g6_move_threshold: 30  # 3.75 - 4.5m
  g6_still_threshold: 15 # 3.75 - 4.5m
  g7_move_threshold: 30  # 4.5 - 5.25m
  g7_still_threshold: 15 # 4.5 - 5.25m
  g8_move_threshold: 30  # 5.25 - 6m
  g8_still_threshold: 15 # 5.25 - 6m

The Gate distances are based on the value you select for ‘distance resolution’. You can select either 0.2m or 0.75m. If 0.75m is selected, then each gate has a range of 0.75m with Gate 0 being at the sensor so is 0. Gate 1 will be 0 to 0.75m and Gate 2 will be 0.75 to 1.5m and so on with the max distance at Gate 8 being 6m.