grf21a
Oct 24th, 2025
64
0
Never
This is comment for paste LD2410 ESPHome Code
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Hi TechPosts, I found that the above code did not work for me and I suspect that this is because specific functions have been depreciated over time within the code and now cause errors to be reported. One example is "throttle: 1500ms" which is now replaced by Filters.
  2.  
  3. I managed to adjust several sections of the code to the following to get it working. I hope this can help some others out there that may be struggling:
  4.  
  5. web_server:
  6. port: 80
  7. include_internal: true
  8.  
  9. # ---------------------------------------------------------------------------------
  10.  
  11. light:
  12. - platform: binary
  13. name: "Blue Status Light"
  14. output: light_output
  15. id: led_light
  16. restore_mode: ALWAYS_OFF
  17.  
  18. output:
  19. - platform: gpio
  20. pin: GPIO2
  21. id: light_output
  22.  
  23. uart:
  24. id: uart_bus
  25. tx_pin: GPIO21 # Adjust pins depending on your ESP32-C3 board
  26. rx_pin: GPIO20
  27. baud_rate: 256000
  28. parity: NONE
  29. stop_bits: 1
  30.  
  31. ld2410:
  32. uart_id: uart_bus
  33. id: ld2410_comp
  34.  
  35. select:
  36. - platform: ld2410
  37. distance_resolution:
  38. name: distance resolution
  39. baud_rate:
  40. name: baud rate
  41. light_function:
  42. name: light function
  43. out_pin_level:
  44. name: out pin level
  45.  
  46. button:
  47. - platform: ld2410
  48. factory_reset:
  49. name: "factory reset"
  50. restart:
  51. name: "restart"
  52. query_params:
  53. name: query params
  54.  
  55. number:
  56. - platform: ld2410
  57. timeout:
  58. name: timeout
  59. max_move_distance_gate:
  60. name: max move distance gate
  61. max_still_distance_gate:
  62. name: max still distance gate
  63. g0:
  64. move_threshold:
  65. name: g0 move threshold
  66. still_threshold:
  67. name: g0 still threshold
  68. g1:
  69. move_threshold:
  70. name: g1 move threshold
  71. still_threshold:
  72. name: g1 still threshold
  73. g2:
  74. move_threshold:
  75. name: g2 move threshold
  76. still_threshold:
  77. name: g2 still threshold
  78. g3:
  79. move_threshold:
  80. name: g3 move threshold
  81. still_threshold:
  82. name: g3 still threshold
  83. g4:
  84. move_threshold:
  85. name: g4 move threshold
  86. still_threshold:
  87. name: g4 still threshold
  88. g5:
  89. move_threshold:
  90. name: g5 move threshold
  91. still_threshold:
  92. name: g5 still threshold
  93. g6:
  94. move_threshold:
  95. name: g6 move threshold
  96. still_threshold:
  97. name: g6 still threshold
  98. g7:
  99. move_threshold:
  100. name: g7 move threshold
  101. still_threshold:
  102. name: g7 still threshold
  103. g8:
  104. move_threshold:
  105. name: g8 move threshold
  106. still_threshold:
  107. name: g8 still threshold
  108. light_threshold:
  109. name: light threshold
  110.  
  111. text_sensor:
  112. - platform: ld2410
  113. version:
  114. name: "presenece sensor version"
  115. mac_address:
  116. name: "presenece sensor mac address"
  117.  
  118. switch:
  119. - platform: ld2410
  120. engineering_mode:
  121. name: "engineering mode"
  122. bluetooth:
  123. name: control Bluetooth
  124.  
  125. sensor:
  126. - platform: internal_temperature
  127. name: "Internal Temperature"
  128.  
  129. - platform: ld2410
  130. moving_distance:
  131. name: "Moving distance (cm)"
  132. filters:
  133. - throttle: 1s
  134. still_distance:
  135. name: "Still Distance (cm)"
  136. moving_energy:
  137. name: "Move Energy (%)"
  138. still_energy:
  139. name: "Still Energy (%)"
  140. detection_distance:
  141. name: "Distance Detection (cm)"
  142. g0:
  143. move_energy:
  144. name: g0 move energy
  145. still_energy:
  146. name: g0 still energy
  147. g1:
  148. move_energy:
  149. name: g1 move energy
  150. still_energy:
  151. name: g1 still energy
  152. g2:
  153. move_energy:
  154. name: g2 move energy
  155. still_energy:
  156. name: g2 still energy
  157. g3:
  158. move_energy:
  159. name: g3 move energy
  160. still_energy:
  161. name: g3 still energy
  162. g4:
  163. move_energy:
  164. name: g4 move energy
  165. still_energy:
  166. name: g4 still energy
  167. g5:
  168. move_energy:
  169. name: g5 move energy
  170. still_energy:
  171. name: g5 still energy
  172. g6:
  173. move_energy:
  174. name: g6 move energy
  175. still_energy:
  176. name: g6 still energy
  177. g7:
  178. move_energy:
  179. name: g7 move energy
  180. still_energy:
  181. name: g7 still energy
  182. g8:
  183. move_energy:
  184. name: g8 move energy
  185. still_energy:
  186. name: g8 still energy
  187. light:
  188. name: light
  189.  
  190. binary_sensor:
  191.  
  192. - platform: ld2410
  193. has_target:
  194. name: Presence
  195. has_moving_target:
  196. name: Moving Target
  197. has_still_target:
  198. name: Still Target
  199.  
Advertisement
Add Comment
Please, Sign In to add comment