techposts

ESPHome LD2420 Code

Aug 21st, 2024
6,755
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.73 KB | Software | 0 0
  1. esphome:
  2.   name: bedroompresencedetection
  3.   friendly_name: BedroomPresenceDetection
  4.   platformio_options:
  5.     upload_speed: 921600
  6.     board_build.flash_mode: dio
  7.  
  8. esp32:
  9.   board: seeed_xiao_esp32c3
  10.   variant: esp32c3
  11.  
  12. logger:
  13.   level: WARN
  14.   baud_rate: 0
  15.  
  16. # Enable Home Assistant API
  17. api:
  18.   encryption:
  19.     key: "xxxxxxxxxxxxxxxxx"
  20.  
  21. ota:
  22.   - platform: esphome
  23.     password: "xxxxxxxxx"
  24.  
  25. wifi:
  26.   ssid: "YourWIFi"
  27.   password: "YourWiFiPassword"
  28.  
  29.   # Enable fallback hotspot (captive portal) in case wifi connection fails
  30.   ap:
  31.     ssid: "Bedroompresencedetection"
  32.     password: "axxxxxxxxx"
  33.  
  34. captive_portal:
  35.  
  36.  
  37.  
  38. uart:
  39.   id: ld2420_radar
  40.   tx_pin: GPIO4
  41.   rx_pin: GPIO3
  42.   baud_rate: 115200
  43.   parity: NONE
  44.   stop_bits: 1
  45.  
  46.  
  47. ld2420:
  48.  
  49.  
  50. text_sensor:
  51.   - platform: ld2420
  52.     fw_version:
  53.       name: LD2420 Firmware
  54.  
  55. sensor:
  56.   - platform: ld2420
  57.     moving_distance:
  58.       name : Moving Distance
  59.  
  60. binary_sensor:
  61.   - platform: ld2420
  62.     has_target:
  63.       name: Presence
  64.  
  65. select:
  66.   - platform: ld2420
  67.     operating_mode:
  68.       name: Operating Mode
  69.  
  70. number:
  71.   - platform: ld2420
  72.     presence_timeout:
  73.       name: Detection Presence Timeout
  74.     min_gate_distance:
  75.       name: Detection Gate Minimum
  76.     max_gate_distance:
  77.       name: Detection Gate Maximum
  78.     # See "Number" section below for detail
  79.     gate_select:
  80.       name: Select Gate to Set
  81.     still_threshold:
  82.       name: Set Still Threshold Value
  83.     move_threshold:
  84.       name: Set Move Threshold Value
  85.        
  86. button:
  87.   - platform: ld2420
  88.     apply_config:
  89.       name: Apply Config
  90.     factory_reset:
  91.       name: Factory Reset
  92.     restart_module:
  93.       name: Restart Module
  94.     revert_config:
  95.       name: Undo Edits
  96.  
  97.  
Tags: smart Home
Advertisement
Add Comment
Please, Sign In to add comment