找回密码
 立即注册
搜索
查看: 3585|回复: 5

[人体存在] ESPHOME关于LD2401B人在传感器的请教

[复制链接]

8

主题

60

回帖

830

积分

高级会员

积分
830
金钱
762
HASS币
0
发表于 2023-8-25 23:52:43 | 显示全部楼层 |阅读模式
感觉ESP32又改变书写要求了,原来的代码升级之后无法生成固件,github看了半天也没明白要怎么写,只是说检测距离变成数字组件了,也没给个示例说要放在哪,请教大佬,代码要怎么修改,求指点。

代码部分

代码部分

报错

报错
回复

使用道具 举报

18

主题

90

回帖

637

积分

高级会员

积分
637
金钱
529
HASS币
0
发表于 2023-8-26 08:35:09 来自手机 | 显示全部楼层
我的也是,求解
回复

使用道具 举报

25

主题

268

回帖

2123

积分

金牌会员

积分
2123
金钱
1830
HASS币
0
发表于 2023-8-26 09:46:06 | 显示全部楼层
本帖最后由 wpw72 于 2023-8-26 09:53 编辑

看下esphome ld2410的文档
ld2410:
  uart_id:
  throttle:
  id:

binary_sensor:
  - platform: ld2410
    has_target:
       name: presence

sensor:

switch:

number:

按文档格式写试试看,我能正常编译
看这个帖子:[技术讨论] ESPHome 2023.8.0更新支持 LD2410人体存在




回复

使用道具 举报

14

主题

261

回帖

2425

积分

金牌会员

积分
2425
金钱
2145
HASS币
50
发表于 2023-8-26 19:31:58 | 显示全部楼层
按照esphome官网介绍改写,功能一切正常。
LD2410 Sensor — ESPHome

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


回复

使用道具 举报

49

主题

625

回帖

4134

积分

论坛元老

积分
4134
金钱
3460
HASS币
30
发表于 2023-8-27 10:37:07 来自手机 | 显示全部楼层
有没有考虑过升级esphome到最新,或者换个esphome环境?我两个esphome一个编译正常,一个也是奇怪的提示各种错误,代码一模一样
回复

使用道具 举报

0

主题

200

回帖

1696

积分

金牌会员

积分
1696
金钱
1496
HASS币
0
发表于 2023-8-27 15:40:01 | 显示全部楼层
2410大更新了,参考这个https://github.com/esphome/esphome/pull/4434
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian ( 晋ICP备17001384号-1 )

GMT+8, 2025-7-2 14:46 , Processed in 0.651760 second(s), 13 queries , MemCached On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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