{"id":97854,"date":"2025-02-03T12:49:58","date_gmt":"2025-02-03T11:49:58","guid":{"rendered":"https:\/\/inrepublica.fr\/blog\/?p=97854"},"modified":"2025-02-03T12:49:59","modified_gmt":"2025-02-03T11:49:59","slug":"utiliser-le-detecteur-de-presence-ld2410c-hilink","status":"publish","type":"post","link":"https:\/\/inrepublica.fr\/blog\/2025\/02\/03\/utiliser-le-detecteur-de-presence-ld2410c-hilink\/","title":{"rendered":"Utiliser le d\u00e9tecteur de pr\u00e9sence LD2410c HiLink"},"content":{"rendered":"\n<p>Dans le cadre de la domotique avec Home Assistant on peut facilement et \u00e0 peu de frais se faire un d\u00e9tecteur de pr\u00e9sence qui fonctionne correctement:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"800\" src=\"https:\/\/i0.wp.com\/inrepublica.fr\/blog\/wp-content\/uploads\/2025\/02\/hilink_2410c.png?resize=800%2C800&#038;ssl=1\" alt=\"hilink 2410c\" class=\"wp-image-97855\" srcset=\"https:\/\/i0.wp.com\/inrepublica.fr\/blog\/wp-content\/uploads\/2025\/02\/hilink_2410c.png?w=800&amp;ssl=1 800w, https:\/\/i0.wp.com\/inrepublica.fr\/blog\/wp-content\/uploads\/2025\/02\/hilink_2410c.png?resize=300%2C300&amp;ssl=1 300w, https:\/\/i0.wp.com\/inrepublica.fr\/blog\/wp-content\/uploads\/2025\/02\/hilink_2410c.png?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/inrepublica.fr\/blog\/wp-content\/uploads\/2025\/02\/hilink_2410c.png?resize=768%2C768&amp;ssl=1 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>Pour ce faire on va utiliser un d\u00e9tecteur d&rsquo;onde millim\u00e9trique HiLink 2410c. La version C est sur une petite platine avec des PIN en 2.54mm tr\u00e8s facilement utilisable avec une carte micro contr\u00f4leur type wemos S2 mini:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/i0.wp.com\/inrepublica.fr\/blog\/wp-content\/uploads\/2025\/02\/s2_mini_v1.0.0_2_16x16.jpg?resize=1024%2C1024&#038;ssl=1\" alt=\"wemos s2 mini verso\" class=\"wp-image-97856\" srcset=\"https:\/\/i0.wp.com\/inrepublica.fr\/blog\/wp-content\/uploads\/2025\/02\/s2_mini_v1.0.0_2_16x16.jpg?resize=1024%2C1024&amp;ssl=1 1024w, https:\/\/i0.wp.com\/inrepublica.fr\/blog\/wp-content\/uploads\/2025\/02\/s2_mini_v1.0.0_2_16x16.jpg?resize=300%2C300&amp;ssl=1 300w, https:\/\/i0.wp.com\/inrepublica.fr\/blog\/wp-content\/uploads\/2025\/02\/s2_mini_v1.0.0_2_16x16.jpg?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/inrepublica.fr\/blog\/wp-content\/uploads\/2025\/02\/s2_mini_v1.0.0_2_16x16.jpg?resize=768%2C768&amp;ssl=1 768w, https:\/\/i0.wp.com\/inrepublica.fr\/blog\/wp-content\/uploads\/2025\/02\/s2_mini_v1.0.0_2_16x16.jpg?resize=1536%2C1536&amp;ssl=1 1536w, https:\/\/i0.wp.com\/inrepublica.fr\/blog\/wp-content\/uploads\/2025\/02\/s2_mini_v1.0.0_2_16x16.jpg?w=1600&amp;ssl=1 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Pour se faire on va relier les pins TX \/ RX \/ OUT \/ GND \/ VCC (5v) sur les pins 35 \/ 33 \/ 18 \/ 16 \/ GND \/ VBUS (5v) du wemos S2 mini. Ensuite il ne reste plus qu&rsquo;a se rendre dans ESPHome puis ajouter ce code en YAML pour la carte:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">esphome:\n  name: wemos-ld2410c\n  friendly_name: wemos-ld2410c\n\nesp32:\n  board: esp32-s2-saola-1\n  framework:\n    type: arduino\n\n# Enable logging\nlogger:\n\n# Enable Home Assistant API\napi:\n  encryption:\n    key: \"XXXXXXXXXXX\"\n\nota:\n  - platform: esphome\n    password: \"XXXXXXXXXXXXX\"\n\nwifi:\n  ssid: !secret wifi_ssid\n  password: !secret wifi_password\n\n  # Enable fallback hotspot (captive portal) in case wifi connection fails\n  ap:\n    ssid: \"Wemos-S2-Mini Fallback Hotspot\"\n    password: \"FOJM59ISinsC\"\n\ncaptive_portal:\n\nweb_server:\n  port: 80\n\nld2410:\n  id: ld2410_radar\n  \nuart:\n  tx_pin: GPIO18\n  rx_pin: GPIO33\n  baud_rate: 256000\n  parity: NONE\n  stop_bits: 1\n\nnumber:\n  - platform: ld2410\n    timeout:\n      name: Radar Timeout\n    max_move_distance_gate:\n      name: Radar Max Move Distance\n    max_still_distance_gate:\n      name: Radar Max Still Distance\n    g0:\n      move_threshold:\n        name: g0 move threshold\n      still_threshold:\n        name: g0 still threshold\n    g1:\n      move_threshold:\n        name: g1 move threshold\n      still_threshold:\n        name: g1 still threshold\n    g2:\n      move_threshold:\n        name: g2 move threshold\n      still_threshold:\n        name: g2 still threshold\n    g3:\n      move_threshold:\n        name: g3 move threshold\n      still_threshold:\n        name: g3 still threshold\n    g4:\n      move_threshold:\n        name: g4 move threshold\n      still_threshold:\n        name: g4 still threshold\n    g5:\n      move_threshold:\n        name: g5 move threshold\n      still_threshold:\n        name: g5 still threshold\n    g6:\n      move_threshold:\n        name: g6 move threshold\n      still_threshold:\n        name: g6 still threshold\n    g7:\n      move_threshold:\n        name: g7 move threshold\n      still_threshold:\n        name: g7 still threshold\n    g8:\n      move_threshold:\n        name: g8 move threshold\n      still_threshold:\n        name: g8 still threshold\n\nbinary_sensor:\n  - platform: ld2410\n    has_target:\n      name: Radar Target\n      id: radar_has_target\n    has_moving_target:\n      name: Radar Moving Target\n    has_still_target:\n      name: Radar Still Target\n\n\nsensor:\n  - platform: ld2410\n    moving_distance:\n      name: Radar Moving Distance\n      id: moving_distance\n    still_distance:\n      name: Radar Still Distance\n      id: still_distance\n    moving_energy:\n      name: Radar Move Energy\n    still_energy:\n      name: Radar Still Energy\n    detection_distance:\n      name: Radar Detection Distance\n      id: radar_detection_distance\n    g0:\n      move_energy:\n        name: g0 move energy\n      still_energy:\n        name: g0 still energy\n    g1:\n      move_energy:\n        name: g1 move energy\n      still_energy:\n        name: g1 still energy\n    g2:\n      move_energy:\n        name: g2 move energy\n      still_energy:\n        name: g2 still energy\n    g3:\n      move_energy:\n        name: g3 move energy\n      still_energy:\n        name: g3 still energy\n    g4:\n      move_energy:\n        name: g4 move energy\n      still_energy:\n        name: g4 still energy\n    g5:\n      move_energy:\n        name: g5 move energy\n      still_energy:\n        name: g5 still energy\n    g6:\n      move_energy:\n        name: g6 move energy\n      still_energy:\n        name: g6 still energy\n    g7:\n      move_energy:\n        name: g7 move energy\n      still_energy:\n        name: g7 still energy\n    g8:\n      move_energy:\n        name: g8 move energy\n      still_energy:\n        name: g8 still energy<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Dans le cadre de la domotique avec Home Assistant on peut facilement et \u00e0 peu de frais se faire un d\u00e9tecteur de pr\u00e9sence qui fonctionne &hellip; <\/p>\n","protected":false},"author":1,"featured_media":97855,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[249,6],"tags":[251,270,269,250,268],"class_list":["post-97854","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-home-assistant","category-logiciel-libre","tag-domotique","tag-esphome","tag-hilink","tag-home-assistant","tag-wemos"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/inrepublica.fr\/blog\/wp-content\/uploads\/2025\/02\/hilink_2410c.png?fit=800%2C800&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pbOkQ3-psi","_links":{"self":[{"href":"https:\/\/inrepublica.fr\/blog\/wp-json\/wp\/v2\/posts\/97854","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/inrepublica.fr\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/inrepublica.fr\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/inrepublica.fr\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/inrepublica.fr\/blog\/wp-json\/wp\/v2\/comments?post=97854"}],"version-history":[{"count":1,"href":"https:\/\/inrepublica.fr\/blog\/wp-json\/wp\/v2\/posts\/97854\/revisions"}],"predecessor-version":[{"id":97858,"href":"https:\/\/inrepublica.fr\/blog\/wp-json\/wp\/v2\/posts\/97854\/revisions\/97858"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/inrepublica.fr\/blog\/wp-json\/wp\/v2\/media\/97855"}],"wp:attachment":[{"href":"https:\/\/inrepublica.fr\/blog\/wp-json\/wp\/v2\/media?parent=97854"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/inrepublica.fr\/blog\/wp-json\/wp\/v2\/categories?post=97854"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/inrepublica.fr\/blog\/wp-json\/wp\/v2\/tags?post=97854"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}