@soubhik - I believe you may be able to reset the module by powering it on/off 5 times in 2-3 seconds. Worth a try… I just wish they made it a bit longer as doing so in 2 seconds (they say 2-3s ???) can be hard to do reliably.
I was looking at the dev github commit. Its not yet merged in the dev version yet. So I guess first we need to locally merge it in the dev version and then use the config yaml from the pull req.
Do you have any idea how to merge it first in the HASS local dev instance?
Has anyone tried to get this to work on a modbus, so that multiple of the same type LD2410 can be connected to one ESP32 microcontroller?
I am trying to build a multisensor (PIR/mmwave/illuminance/temp/humidity) that will connect to a central ESP32 based microcontroller module (like the KC868)
I figured out how I will multiplex+extend the range of I2C bus for the Illuminance/TH sensors. The PIR will connect to one of the extended GPIO pins. The mmwave is the one I cannot figure out since the ESP32 has only 3 native UART bus, so I thought if the UART bus can be multiplied by using a modbus, then multiple mmwave sensors can be connected to the same microcontroller.
Thank you
I am also interested in connecting to an esp8266 a minimum of 3 pieces of ld2410 or a maximum of 5 pieces!? is it possible?
As binary sensor - why not. It requires one GPIO pin.
But not in configurable mode - esp8266 has 1 UART, so only one sensor can be connected.
esp32 has 3 UARTs, technically.
@soubhik - I am using the PR version and did not have to merge anything. All I did was add the dev
version of ESPHome to my install (it can coexist with the regular one) and then used the example YAML which pulls the needed code to program the ESP32.
The code that tells it where to get the integration that hasn’t been merged yet is:
external_components:
source: github://regevbr/esphome@ld2410
components: [ld2410]
Once it is merged into the released channel, I believe all that you need to do is remove the code above and re-upload the firmware.
Doesn anyone knows why this is not included in esphome yet? Today esphome 2023.5.0 is up, but this is still not included…?
Because the PR has not been merged.
That’s what i was asking… (why it was not included → why it was not merged yet, if it works…?)
I understand that only one can be controlled and set its parameters which is connected to rx tx to ld2410 respectively rx tx from esp 8266 and the rest just read clered or detected which are connected to the out pin from ld2410 and one gpio pin from esp8266?
I managed to get a LD2410C working with a Wemos D1 Mini Compatible ESP32 board and also got it to light up the internal blue LED when motion is detected. The LD2410C is connected using the UART pins (the pins marked TX and RX on the D1 Mini ESP32 board didn’t work and I had to use GPIO16 and GPIO17). Also the Bluetooth Proxy has been enabled for Home Assistant.
If it will help anyone, here is my config which got the LED working:
substitutions:
name: "esp32-motion-sensor"
esphome:
name: ${name}
name_add_mac_suffix: false
api:
ota:
logger:
level: INFO
baud_rate: 0
esp32:
board: esp32dev
framework:
type: esp-idf
esp32_ble_tracker:
scan_parameters:
interval: 1100ms
window: 1100ms
active: true
bluetooth_proxy:
active: true
cache_services: false
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
uart:
id: ld2410_uart
tx_pin: GPIO17
rx_pin: GPIO16
baud_rate: 256000
parity: NONE
stop_bits: 1
ld2410:
uart_id: ld2410_uart
binary_sensor:
- platform: ld2410
has_target:
name: Presence
has_moving_target:
name: Moving Target
on_press:
then:
- light.turn_on: led
on_release:
then:
- light.turn_off: led
has_still_target:
name: Still Target
output:
- platform: ledc
id: onboard_led
pin:
number: GPIO2
inverted: false
light:
- platform: monochromatic
name: "Onboard LED"
output: onboard_led
id: led
On ESP32, you may use almost any pins for UART. However, hardware UART pins are recommended for faster speed.
Also, you don’t need to switch serial logging off - ESP32 has 3 UARTs, so you’re good having both sensor and logger. Nevertheless, i had problems with using all 3 UARTs on some ESP32 Mini boards, but on other they work fine, all 3.
P.S. I don’t see that you use UART at all - just binary sensor, which is working without UART anyways.
Thanks for the feedback. I used GPIO16 and GPIO17 as the pinouts for my board seems to match the following diagram and it corresponds with UART2.
I also did have the distance and energy level sensors working but I removed them as they were creating lots of chatter to Home Assistant with the distance and energy levels constantly updating while I was in the room.
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
Yes, you did it right. IO16/17 are good. But if you don’t plan to use that energy stuff and fine-tuning gate thresholds, you don’t need UART.
As I have the LD2410C with bluetooth, I found it much easier to use the Android app and connect to it directly via bluetooth to fine tune the gate thresholds and settings rather than setting them in the yaml and having to upload it to the ESP32 board each time.
Wouldn’t I still need to use the UART to get the data for Move Target and Still Target binary sensors?
Yeah you need it, sorry to be unclear. I meant, there’s 5th pin on sensor, and it provides simple binary sensor of presence (without moving/still, joined one). In that case you can use it directly, without UART.
Using gpio binary pins seems to be a good idea and works well in many places. But one also needs to be aware that the delayed off time in the parameter settings can become bothersome.
Very true. The delayed off time for presense (combined move and static) can be configured on the LD2410. I have connected it to an ESP32 using the UART as that way I can directly access the move target sensor which responds very quickly.
I can read at least 2 persons writing that the android app is in English, but I can’t locate / convert it to English.
Any help on this?
Thanks
App is (automatically) in english only if device (phone) language is set to english.