# origineel https://github.com/esphome/esphome/pull/4434 # Dit is een ESPHOME script # zoek op aliexpress naar de LD2410C substitutions: pretty: MMW1 RXPIN: GPIO21 TXPIN: GPIO17 out_pin: GPIO16 # zet de pinnen op de esp32 # Dit hoeven niet de RX en TX pinnen te zijn voor een esp32 # Als je deze wel gebruikt, flash dan eerst de esp en dan pas de # LD2410C aansluiten # voor een esp8266 dan moet je de RX en TX pinnen gebruiken # vanwege de hoge baudrate van 25600 esphome: name: mmw1 # allways in lowercase! comment: LD2410C esp32: board: mhetesp32minikit framework: type: arduino #pas deze eventueel aan naar een esp8266 # # esp8266: # board: d1_mini # laat frameworki: staan mqtt: broker: !secret mqttbroker # pas de namen aan in de secrets.yaml bv # mqttbroker: 192.168.240.100 ota: password: !secret ota_password wifi: ssid: !secret wifi_ssid password: !secret wifi_password ap: ssid: !secret ap_ssid password: !secret ap_password web_server: port: 80 # zet de webserver uit als je een esp8266 gebruikt # anders crasht ie telkens external_components: source: github://regevbr/esphome@ld2410 components: [ld2410, select] api: services: - service: set_ld2410_bluetooth_password variables: password: string then: - bluetooth_password.set: id: ld2410_comp password: !lambda 'return password;' uart: id: ld2410_uart tx_pin: ${TXPIN} rx_pin: ${RXPIN} baud_rate: 256000 parity: NONE stop_bits: 1 ld2410: uart_id: ld2410_uart throttle: 1500ms id: ld2410_comp 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 button: - platform: ld2410 factory_reset: name: "factory reset" restart: name: "restart" query_params: name: query params number: - platform: ld2410 timeout: name: timeout 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 g0_still_threshold: name: g0 still threshold g1_move_threshold: name: g1 move threshold g1_still_threshold: name: g1 still threshold g2_move_threshold: name: g2 move threshold g2_still_threshold: name: g2 still threshold g3_move_threshold: name: g3 move threshold g3_still_threshold: name: g3 still threshold g4_move_threshold: name: g4 move threshold g4_still_threshold: name: g4 still threshold g5_move_threshold: name: g5 move threshold g5_still_threshold: name: g5 still threshold g6_move_threshold: name: g6 move threshold g6_still_threshold: name: g6 still threshold g7_move_threshold: name: g7 move threshold g7_still_threshold: name: g7 still threshold g8_move_threshold: name: g8 move threshold g8_still_threshold: name: g8 still threshold light_threshold: name: light threshold text_sensor: - platform: ld2410 version: name: "presenece sensor version" mac_address: name: "presenece sensor mac address" switch: - platform: ld2410 engineering_mode: name: "engineering mode" bluetooth: name: control Bluetooth binary_sensor: - platform: ld2410 has_target: name: "presence" has_moving_target: name: "movement" has_still_target: name: "still" out_pin_presence_status: name: out pin presence status - platform: gpio pin: ${out_pin} name: ${pretty} Presence device_class: presence sensor: - platform: ld2410 moving_distance: name: "Moving distance (cm)" still_distance: name: "Still Distance (cm)" moving_energy: name: "Move Energy (%)" still_energy: name: "Still Energy (%)" detection_distance: name: "Distance Detection (cm)" g0_move_energy: name: g0 move energy g0_still_energy: name: g0 still energy g1_move_energy: name: g1 move energy g1_still_energy: name: g1 still energy g2_move_energy: name: g2 move energy g2_still_energy: name: g2 still energy g3_move_energy: name: g3 move energy g3_still_energy: name: g3 still energy g4_move_energy: name: g4 move energy g4_still_energy: name: g4 still energy g5_move_energy: name: g5 move energy g5_still_energy: name: g5 still energy g6_move_energy: name: g6 move energy g6_still_energy: name: g6 still energy g7_move_energy: name: g7 move energy g7_still_energy: name: g7 still energy g8_move_energy: name: g8 move energy g8_still_energy: name: g8 still energy light: name: light