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

 找回密码
 立即注册
查看: 1262|回复: 5

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

[复制链接]

7

主题

61

帖子

547

积分

高级会员

Rank: 4

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

代码部分

代码部分

报错

报错
回复

使用道具 举报

7

主题

73

帖子

388

积分

中级会员

Rank: 3Rank: 3

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

使用道具 举报

16

主题

137

帖子

1181

积分

金牌会员

Rank: 6Rank: 6

积分
1181
金钱
1044
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

主题

249

帖子

1990

积分

金牌会员

Rank: 6Rank: 6

积分
1990
金钱
1736
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


回复

使用道具 举报

44

主题

632

帖子

3560

积分

论坛元老

Rank: 8Rank: 8

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

使用道具 举报

0

主题

120

帖子

938

积分

高级会员

Rank: 4

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

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-4-28 05:02 , Processed in 0.602716 second(s), 30 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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