『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 3136|回复: 26

[已解决] nodemcu+LD2410B制作人体存在传感器(新版配置文件)

[复制链接]

6

主题

137

帖子

1517

积分

金牌会员

Rank: 6Rank: 6

积分
1517
金钱
1380
HASS币
0
发表于 2023-3-4 13:50:54 | 显示全部楼层 |阅读模式
本帖最后由 HHHhhhH 于 2024-2-22 13:29 编辑

采用nodemcu+LD2410B,刷入ESPhome固件  
配置文件如下

esphome:
  name: "ld2410-1"

esp8266:
  board: nodemcuv2

wifi:
  ssid: "H3"
  password: "31222.."
  manual_ip:
    static_ip: 192.168.0.131
    gateway: 192.168.0.1
    subnet: 255.255.255.0

  ap:
    ssid: "2410"
    password: "123456789"

captive_portal:

logger:
  baud_rate: 0

api:
  password: "123456789"
ota:
  password: "123456789"

uart:
  baud_rate: 256000
  tx_pin: GPIO1  # Replace with your TX pin
  rx_pin: GPIO3  # Replace with your RX pin
  parity: NONE
  stop_bits: 1

ld2410:


sensor:
  # 配置传感器组件
  - platform: ld2410
    moving_distance:
      name: Moving Distance
    still_distance:
      name: Still Distance
    moving_energy:
      name: Move 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


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
    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

binary_sensor:
  # 配置二进制传感器组件
  - platform: ld2410
    has_target:
      name: Presence
    has_moving_target:
      name: Moving Target
    has_still_target:
      name: Still Target




此配置文件直接刷如后,进HA集成esphome设备中修改距离参数!!!









捕获sss.PNG
捕获sdf.PNG
回复

使用道具 举报

23

主题

629

帖子

4336

积分

元老级技术达人

积分
4336
金钱
3692
HASS币
30

教程狂人

QQ
发表于 2023-3-4 14:44:15 | 显示全部楼层
报错信息里不是写的很清楚了嘛,配置文件增加下面代码
logger:
  baud_rate: 0
回复

使用道具 举报

2

主题

104

帖子

1362

积分

金牌会员

Rank: 6Rank: 6

积分
1362
金钱
1258
HASS币
0
发表于 2023-3-4 14:53:33 | 显示全部楼层
模块通电连上WIFI后再给LD2410通电试试。
回复

使用道具 举报

2

主题

123

帖子

1657

积分

金牌会员

Rank: 6Rank: 6

积分
1657
金钱
1534
HASS币
0
发表于 2023-3-4 15:05:49 | 显示全部楼层
TX和RX接线反了
回复

使用道具 举报

6

主题

137

帖子

1517

积分

金牌会员

Rank: 6Rank: 6

积分
1517
金钱
1380
HASS币
0
 楼主| 发表于 2023-3-4 17:29:55 | 显示全部楼层
alei643 发表于 2023-3-4 14:44
报错信息里不是写的很清楚了嘛,配置文件增加下面代码

感谢回复,已修改
回复

使用道具 举报

6

主题

137

帖子

1517

积分

金牌会员

Rank: 6Rank: 6

积分
1517
金钱
1380
HASS币
0
 楼主| 发表于 2023-3-4 17:30:57 | 显示全部楼层
jole 发表于 2023-3-4 14:53
模块通电连上WIFI后再给LD2410通电试试。

感谢回复,确实先通电再接才可以
回复

使用道具 举报

6

主题

137

帖子

1517

积分

金牌会员

Rank: 6Rank: 6

积分
1517
金钱
1380
HASS币
0
 楼主| 发表于 2023-3-4 17:32:24 | 显示全部楼层

感谢回复,第一次弄这个,不知道RX与TX需要对接
回复

使用道具 举报

9

主题

78

帖子

583

积分

高级会员

Rank: 4

积分
583
金钱
505
HASS币
0
发表于 2023-3-4 21:26:40 来自手机 | 显示全部楼层
加上mcu板子,是为了远距离使用吗?
回复

使用道具 举报

6

主题

137

帖子

1517

积分

金牌会员

Rank: 6Rank: 6

积分
1517
金钱
1380
HASS币
0
 楼主| 发表于 2023-3-5 10:28:28 | 显示全部楼层
172859773 发表于 2023-3-4 21:26
加上mcu板子,是为了远距离使用吗?

不会打板、焊接,mcu直接引出5V为了方便
回复

使用道具 举报

50

主题

1300

帖子

4884

积分

论坛DIY达人

积分
4884
金钱
3584
HASS币
20
发表于 2023-3-8 15:41:33 | 显示全部楼层
好吧,趁着今天LD2410B特价,也买几块玩玩.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-4-24 16:22 , Processed in 3.832590 second(s), 36 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表