home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.11k stars 29.79k forks source link

ESPHome 2024.7.3 broke ld2410 sensor integration #123732

Open ncosta24 opened 1 month ago

ncosta24 commented 1 month ago

The problem

Since last esphome update my 8 LD2410 Sensor became with unknown state on all sensor LD2410 Sensor. I was able to get 3 working, by upload several times de yaml code, but the others still no working: image image

I try to update teh coide by wireless, by plug in, change th TC and RX pins, etc with no luck

What version of Home Assistant Core has the issue?

core-2024.8.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

esphome

Link to integration documentation on our website

No response

Diagnostics information

logs_esp32-bluetooth-proxy-3a4c5c_logs.txt

Example YAML snippet

substitutions:
  name: esp32-bluetooth-proxy-3a4c5c
  friendly_name: Bluetooth Cozinha (3a4c5c)
packages:
  esphome.bluetooth-proxy: github://esphome/bluetooth-proxies/esp32-generic/esp32-generic.yaml@main
esphome:
  name: ${name}
  name_add_mac_suffix: false
  friendly_name: ${friendly_name}
api:
  encryption:
    key: yi49PumHgo5Dg3E7Ps8SOyNmIvb1DQ8YKmQs4eghuRQ=
ota:
  - platform: esphome
    password: !secret ota_password
wifi:
  networks:
  - ssid: !secret wifi_ssid
    password: !secret wifi_password
  # Optional manual IP
  manual_ip:
    static_ip: 192.168.1.45
    gateway: 192.168.1.1
    subnet: 255.255.255.0
    dns1: 192.168.1.2
  reboot_timeout: !secret reboot_timeout
  output_power: !secret output_power

uart:
  id: ld2410_uart
  tx_pin: 17
  rx_pin: 16
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

ld2410:
  id: my_ld2410
  uart_id: ld2410_uart
  # Gates:
  # ld2410 sensors group distances into up to 9 "gates" that are 0.75 meters deep.
  # For example, gate 0 is 0 to 0.75 meters away from the sensor, gate 1 is 0.75 to
  # 1.5 meters, etc. up to gate 8 at 6 to 6.75 meters. If there is motion from a
  # person between 0.75 and 1.5 meters, it will be measured against the gate 1
  # energy level thresholds.

  # Energy Levels
  # Each gate has a measured "energy level" for moving and still objects that
  # essentially measures how fast a person is moving or how much activity is in
  # that gate. Energy levels are on a scale from 0-100, measured at each distance
  # gate simultaneously.

  # Move and Still Thresholds
  # The sensor must first detect a moving object before the Still Threshold comes
  # into play. Once the Move Threshold for a gate is met, the sensor will continue to
  # detect presence until the "energy level" drops below both the Move and Still
  # Thresholds for all gates, up to the configured max distance.

  # Tuning
  # The bluetooth ld2410 sensors are very helpful for tuning because you can adjust
  # thresholds and read the Move and Still energy levels at all gates, compared to
  # the configured threshold. The android app can be found here:
  # https://community.home-assistant.io/t/ld2410-esphome-tips/477058/27
  # 
  # First enable engineering mode, which shows energy level updates in the app more
  # quickly. Then begin tuning the Move thresholds for each of the distances that
  # you want to detect until you're detected at a movement speed you're happy with.
  # Once that's done configure the Still thresholds of each gate to make sure you're
  # reliably detected.

  # Timeout
  # The timeout is fairly self-explanatory. When the ld2410 stops detecting presence
  # it waits the duration of the timeout before it signals no presence detected.
  # A longer timeout makes the sensor more stable, but also slower to stop detecting.

  # More info:
  # https://esphome.io/components/sensor/ld2410.html
  # https://community.home-assistant.io/t/ld2410-esphome-tips/477058
  # https://peyanski.com/detect-human-presence-with-ld2410b-and-home-assistant/
  # https://community.home-assistant.io/t/mmwave-wars-one-sensor-module-to-rule-them-all/453260

  #https://github.com/dentra/esphome-components/tree/master/components/miot_ylyk01yl
  #https://esphome.io/components/api.html#homeassistant-service-action
  #https://esphome.io/components/esp32_ble_tracker.html
  #https://esphome.io/projects/?type=bluetooth
  #https://github.com/esphome/firmware/blob/main/bluetooth-proxy/esp32-generic.yaml
  #######  Acertar as gates ###############
  #https://community.home-assistant.io/t/ld2410-esphome-tips/477058/319?page=16

sensor:
  - platform: esp32_hall
    name: ${friendly_name} Sensor
    update_interval: 60s
#https://esphome.io/components/sensor/wifi_signal.html
  - platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
    name: "${friendly_name} WiFi Signal dB"
    id: wifi_signal_db
    update_interval: 60s
    entity_category: "diagnostic"
  - platform: copy # Reports the WiFi signal strength in %
    source_id: wifi_signal_db
    name: "${friendly_name} WiFi Signal Percent"
    filters:
      - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
    unit_of_measurement: "Signal %"
    entity_category: "diagnostic"
    device_class: ""
#############
  - platform: ld2410
    light:
      name: light
    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

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

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

button:
  - platform: ld2410
    factory_reset:
      name: "factory reset"
    restart:
      name: "restart"
    query_params:
      name: query params
  - platform: safe_mode
    name: Safe Mode Boot
    entity_category: diagnostic

text_sensor:
  - platform: ld2410
    version:
      name: "firmware version"
    mac_address:
      name: "mac address"

select:
  - platform: ld2410
    distance_resolution:
      name: "distance resolution"
    baud_rate:
      name: "baud rate"
    light_function:
      name: light function
    out_pin_level:
      name: out pin level

binary_sensor:
  - platform: ld2410
    has_target:
      name: Presence
    has_moving_target:
      name: Moving Target
    has_still_target:
      name: Still Target
    out_pin_presence_status:
      name: out pin presence status

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 month ago

Hey there @ottowinter, @jesserockz, @kbx81, @bdraco, mind taking a look at this issue as it has been labeled with an integration (esphome) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `esphome` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign esphome` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


esphome documentation esphome source (message by IssueLinks)

Misterwinefine commented 1 week ago

I am having the exact same issue I have two of the 2410c and b s on esp home running all the latest esphome Current version: 2024.8.1. and all the latest HA software updates as well.

sangellga commented 4 days ago

The problem

Since last esphome update my 8 LD2410 Sensor became with unknown state on all sensor LD2410 Sensor. I was able to get 3 working, by upload several times de yaml code, but the others still no working: image image

I try to update teh coide by wireless, by plug in, change th TC and RX pins, etc with no luck

What version of Home Assistant Core has the issue?

core-2024.8.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

esphome

Link to integration documentation on our website

No response

Diagnostics information

logs_esp32-bluetooth-proxy-3a4c5c_logs.txt

Example YAML snippet

substitutions:
  name: esp32-bluetooth-proxy-3a4c5c
  friendly_name: Bluetooth Cozinha (3a4c5c)
packages:
  esphome.bluetooth-proxy: github://esphome/bluetooth-proxies/esp32-generic/esp32-generic.yaml@main
esphome:
  name: ${name}
  name_add_mac_suffix: false
  friendly_name: ${friendly_name}
api:
  encryption:
    key: yi49PumHgo5Dg3E7Ps8SOyNmIvb1DQ8YKmQs4eghuRQ=
ota:
  - platform: esphome
    password: !secret ota_password
wifi:
  networks:
  - ssid: !secret wifi_ssid
    password: !secret wifi_password
  # Optional manual IP
  manual_ip:
    static_ip: 192.168.1.45
    gateway: 192.168.1.1
    subnet: 255.255.255.0
    dns1: 192.168.1.2
  reboot_timeout: !secret reboot_timeout
  output_power: !secret output_power

uart:
  id: ld2410_uart
  tx_pin: 17
  rx_pin: 16
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

ld2410:
  id: my_ld2410
  uart_id: ld2410_uart
  # Gates:
  # ld2410 sensors group distances into up to 9 "gates" that are 0.75 meters deep.
  # For example, gate 0 is 0 to 0.75 meters away from the sensor, gate 1 is 0.75 to
  # 1.5 meters, etc. up to gate 8 at 6 to 6.75 meters. If there is motion from a
  # person between 0.75 and 1.5 meters, it will be measured against the gate 1
  # energy level thresholds.

  # Energy Levels
  # Each gate has a measured "energy level" for moving and still objects that
  # essentially measures how fast a person is moving or how much activity is in
  # that gate. Energy levels are on a scale from 0-100, measured at each distance
  # gate simultaneously.

  # Move and Still Thresholds
  # The sensor must first detect a moving object before the Still Threshold comes
  # into play. Once the Move Threshold for a gate is met, the sensor will continue to
  # detect presence until the "energy level" drops below both the Move and Still
  # Thresholds for all gates, up to the configured max distance.

  # Tuning
  # The bluetooth ld2410 sensors are very helpful for tuning because you can adjust
  # thresholds and read the Move and Still energy levels at all gates, compared to
  # the configured threshold. The android app can be found here:
  # https://community.home-assistant.io/t/ld2410-esphome-tips/477058/27
  # 
  # First enable engineering mode, which shows energy level updates in the app more
  # quickly. Then begin tuning the Move thresholds for each of the distances that
  # you want to detect until you're detected at a movement speed you're happy with.
  # Once that's done configure the Still thresholds of each gate to make sure you're
  # reliably detected.

  # Timeout
  # The timeout is fairly self-explanatory. When the ld2410 stops detecting presence
  # it waits the duration of the timeout before it signals no presence detected.
  # A longer timeout makes the sensor more stable, but also slower to stop detecting.

  # More info:
  # https://esphome.io/components/sensor/ld2410.html
  # https://community.home-assistant.io/t/ld2410-esphome-tips/477058
  # https://peyanski.com/detect-human-presence-with-ld2410b-and-home-assistant/
  # https://community.home-assistant.io/t/mmwave-wars-one-sensor-module-to-rule-them-all/453260

  #https://github.com/dentra/esphome-components/tree/master/components/miot_ylyk01yl
  #https://esphome.io/components/api.html#homeassistant-service-action
  #https://esphome.io/components/esp32_ble_tracker.html
  #https://esphome.io/projects/?type=bluetooth
  #https://github.com/esphome/firmware/blob/main/bluetooth-proxy/esp32-generic.yaml
  #######  Acertar as gates ###############
  #https://community.home-assistant.io/t/ld2410-esphome-tips/477058/319?page=16

sensor:
  - platform: esp32_hall
    name: ${friendly_name} Sensor
    update_interval: 60s
#https://esphome.io/components/sensor/wifi_signal.html
  - platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
    name: "${friendly_name} WiFi Signal dB"
    id: wifi_signal_db
    update_interval: 60s
    entity_category: "diagnostic"
  - platform: copy # Reports the WiFi signal strength in %
    source_id: wifi_signal_db
    name: "${friendly_name} WiFi Signal Percent"
    filters:
      - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
    unit_of_measurement: "Signal %"
    entity_category: "diagnostic"
    device_class: ""
#############
  - platform: ld2410
    light:
      name: light
    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

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

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

button:
  - platform: ld2410
    factory_reset:
      name: "factory reset"
    restart:
      name: "restart"
    query_params:
      name: query params
  - platform: safe_mode
    name: Safe Mode Boot
    entity_category: diagnostic

text_sensor:
  - platform: ld2410
    version:
      name: "firmware version"
    mac_address:
      name: "mac address"

select:
  - platform: ld2410
    distance_resolution:
      name: "distance resolution"
    baud_rate:
      name: "baud rate"
    light_function:
      name: light function
    out_pin_level:
      name: out pin level

binary_sensor:
  - platform: ld2410
    has_target:
      name: Presence
    has_moving_target:
      name: Moving Target
    has_still_target:
      name: Still Target
    out_pin_presence_status:
      name: out pin presence status

Anything in the logs that might be useful for us?

No response

Additional information

No response

Check that your devices were not assigned a new IP. I have never had this happen but with the last update 4 of my devices were assigned new IPs. I had the same issues as you and while trying to troubleshoot I found that when I selected the device in Integrations under ESPHome, I hovered over the "Visit" link and saw that the IP was different that what I saw in the logs for the device, sure enough all 4 had new IPs. So I just clicked the "Add device" button in the ESPHome integration and entered the new IP for each of the 4. Each time it said the device was already added but it updated the IP and now all 4 are back to working normally.