Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # v01 : 4 avril 2024 - 1er essai de ce capteur
- # carte : https://www.wemos.cc/en/latest/s2/s2_mini.html
- # builtinLed = 15; // builtinLed = GPIO15 sur Lolin S2 mini
- # source intéressante : https://community.home-assistant.io/t/build-a-smaller-human-body-radar-sensor-using-esp32-s2-and-ld2410c/554502
- # pour uploader depuis USB : https://forum.hacf.fr/t/resolu-impossible-de-flasher-des-lolin-esp32-mini-le-s3-et-le-s2/39428/7
- # une bonne vidéo pour les paramètres : https://youtu.be/3hcfngVSgXg?si=69YV4MdXR-yuEtpF
- # upload avec https://adafruit.github.io/Adafruit_WebSerial_ESPTool/
- # carte pour HA en bas de page de https://esphome.io/components/sensor/ld2410.html -> Remplacez ensuite toutes les instances de DEVICE par le nom de votre appareil (défini par friendly_name ci-après)
- # pour ajouter des capteurs de diagnostic : voir https://github.com/kpr-iot/kprESENCE/blob/main/TypeC/kprESENCE-TypeC.yaml
- esphome:
- name: ld2410-s2mini
- friendly_name: ld2410_s2mini
- comment: 1er essai sur ESP32-S2FN4R2 avec tx_pin en GPIO18 et rx_pin en GPIO33
- project:
- name: ESP32s2mini.LD2410
- version: v01
- # platformio_options:
- # board_build.extra_flags:
- # - "-DARDUINO_USB_CDC_ON_BOOT=0" # j'ignore encore à quoi ça sert, semblerait utile pour le pour le Lolin s2 mini
- # - "-DARDUINO_USB_MODE=0" # j'ignore encore à quoi ça sert, normalement commenté pour le Lolin s2 mini
- esp32:
- board: lolin_s2_mini
- framework:
- type: arduino
- # Enable logging
- logger:
- # level: WARN # ligne superflue
- # baud_rate: 0 # ligne superflue
- # Enable Home Assistant API
- api:
- encryption:
- key: "FO3ioNJczICDsLcEV6RTtsQR7cbfBaNGvcN+WUk4vP0="
- ota:
- password: !secret ota_password
- wifi:
- ssid: !secret wifi_ssid
- password: !secret wifi_password
- manual_ip:
- static_ip: 192.168.0.8 # à changer pour chaque capteur !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- gateway: 192.168.0.1
- subnet: 255.255.255.0
- # Enable fallback hotspot (captive portal) in case wifi connection fails
- ap:
- ssid: "Ld2410-S2Mini Fallback Hotspot"
- password: !secret wifi_password
- captive_portal:
- # collage depuis https://pastebin.com/yhzFTuY3
- web_server:
- port: 80
- version: 2
- local: true
- ld2410:
- # - uart_id: uart_1 # peut-être superflu ?
- uart:
- # id: uart_1 # peut-être superflu ?
- tx_pin: GPIO18 # tx_pin à vérifier : 17 sur un esp32-s3 mais 18 sur esp32-s2-mini
- rx_pin: GPIO33 # rx_pin à vérifier : 18 sur un esp32-s3 mais 33 sur esp32-s2-mini
- baud_rate: 256000
- parity: NONE
- stop_bits: 1
- # i2c:
- # - id: bus_a
- # sda: 12
- # scl: 11
- # scan: true
- sensor:
- - platform: ld2410
- light:
- name: light
- moving_distance:
- name: Moving Distance
- still_distance:
- name: Still Distance
- moving_energy:
- name: Moving 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
- - platform: uptime
- name: Uptime
- id: sys_uptime
- entity_category: "diagnostic"
- update_interval: 60s
- - platform: wifi_signal
- name: Wifi RSSI
- id: wifi_signal_db
- icon: mdi:wifi-strength-3
- update_interval: 60s
- entity_category: "diagnostic"
- 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
- 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
- # par défault pour les gates : (7 gates pour immobile et 9 pour en mouvement)
- # g0 de 0 à 0.75m, valeurs par défaut 'move/still' : 50/0
- # g1 de 0.75 à 1.5m, valeurs par défaut 'move/still' : 50/0
- # g2 de 1.5 à 2.25m, valeurs par défaut 'move/still' : 40/40
- # g3 de 2.25 à 3m, valeurs par défaut 'move/still' : 30/40
- # g4 de 3 à 3.75m, valeurs par défaut 'move/still' : 20/30
- # g5 de 3.75 à 4.5m, valeurs par défaut 'move/still' : 15/30
- # g6 de 4.5 à 5.25m, valeurs par défaut 'move/still' : 15/20
- # g7 de 5.25 à 6m, valeurs par défaut 'move/still' : 15/20
- # g8 de 6 à 6.75m, valeurs par défaut 'move/still' : 15/20
- 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
- switch:
- - platform: ld2410
- engineering_mode:
- name: Engineering Mode
- # restore_mode: RESTORE_DEFAULT_ON # activer le mode engineering en permanence selon https://forum.hacf.fr/t/tuto-ld2410-detecteur-de-presence-avec-esphome/29644/109
- bluetooth:
- name: Control Bluetooth
- button:
- - platform: ld2410
- factory_reset:
- name: "factory reset"
- restart:
- name: "restart"
- query_params:
- name: query params
- 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
- text_sensor:
- - platform: ld2410
- version:
- name: "firmware version"
- - platform: wifi_info
- ip_address:
- name: IP Address
- entity_category: "diagnostic"
- icon: mdi:ip-network
- ssid:
- name: Wifi SSID
- entity_category: "diagnostic"
- icon: mdi:wifi-check
- mac_address:
- name: Wifi MAC
- entity_category: "diagnostic"
- icon: mdi:ip-network
- bssid:
- name: ESP Connected BSSID
- entity_category: "diagnostic"
- icon: mdi:ip-network
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement