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

 找回密码
 立即注册
楼主: book123

[技术探讨] 人体存在传感器DIY交流:雷达+红外+亮度+温湿度+ESP32开发板

  [复制链接]

1

主题

48

帖子

341

积分

中级会员

Rank: 3Rank: 3

积分
341
金钱
293
HASS币
0
发表于 2022-7-20 00:00:18 | 显示全部楼层
太牛了,最完善的方案了
回复

使用道具 举报

23

主题

263

帖子

1561

积分

金牌会员

Rank: 6Rank: 6

积分
1561
金钱
1298
HASS币
0
发表于 2022-7-20 10:25:58 | 显示全部楼层
小白再次请教,这个password是自己设吗
屏幕截图 2022-07-20 102504.png
回复

使用道具 举报

14

主题

249

帖子

1988

积分

金牌会员

Rank: 6Rank: 6

积分
1988
金钱
1734
HASS币
50
 楼主| 发表于 2022-7-20 12:26:35 来自手机 | 显示全部楼层
是的 ,设成你自己熟悉的密码。
回复

使用道具 举报

26

主题

217

帖子

913

积分

高级会员

Rank: 4

积分
913
金钱
696
HASS币
0
发表于 2022-7-22 20:47:33 | 显示全部楼层
真牛皮。。。
回复

使用道具 举报

9

主题

358

帖子

3037

积分

论坛元老

Rank: 8Rank: 8

积分
3037
金钱
2679
HASS币
0
发表于 2022-7-25 11:38:02 | 显示全部楼层
book123 发表于 2022-7-13 18:56
是我自己打印的,等稍后我把3d文件共享给大家。

太牛拉
在等楼主的分享 谢谢!
回复

使用道具 举报

0

主题

17

帖子

204

积分

中级会员

Rank: 3Rank: 3

积分
204
金钱
187
HASS币
0
发表于 2022-7-25 15:46:44 | 显示全部楼层
厉害!学习了
回复

使用道具 举报

0

主题

46

帖子

402

积分

中级会员

Rank: 3Rank: 3

积分
402
金钱
356
HASS币
0
发表于 2022-7-25 22:31:18 | 显示全部楼层
学习一下          。
回复

使用道具 举报

20

主题

459

帖子

2819

积分

金牌会员

Rank: 6Rank: 6

积分
2819
金钱
2360
HASS币
0
发表于 2022-7-26 14:52:13 | 显示全部楼层
一直在等楼主的3D文件
回复

使用道具 举报

14

主题

249

帖子

1988

积分

金牌会员

Rank: 6Rank: 6

积分
1988
金钱
1734
HASS币
50
 楼主| 发表于 2022-8-6 12:28:06 | 显示全部楼层
本帖最后由 book123 于 2022-8-17 19:32 编辑

基于ESP32开发板之上,集合1115雷达、BH1750光照度、DHT11温湿度、热红外等传感模块的四合一传感器完整的esphome代码,其中1115可调节灵敏度。
共享给大家参考。(20220817对代码进行优化,如下)
esphome:
  name: 换成你的信息

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:
  level: DEBUG  #You Can Use "INFO" Level
  baud_rate: 0 #disable logging over uart
# Enable Home Assistant API
api:

ota:

wifi:
  ssid: "换成你的信息"
  password: "换成你的信息"

# Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "换成你的信息"
    password: "换成你的信息"

captive_portal:

# Enable Web
web_server:
  port: 80


# Rada LD115H
binary_sensor:
  - platform: gpio
    pin: GPIO12
    name: "LD115H Sensor"
    device_class: motion
    id: motion_01
    #触发时打开GPIO2输出,点亮了板载LED
    on_press:
      - switch.turn_on: motion_01_light
    #恢复时关闭GPIO2输出,熄灭了板载 LED
    on_release:
       - switch.turn_off: motion_01_light  

switch:
  - platform: gpio
    pin: GPIO2
    # inverted: true
    name: "ESP32S-01-zhuwo body light"
    id: motion_01_light



sensor:
# Wifi signal
  - platform: wifi_signal
    name: "ESP32-zhuwo WiFi Sensor"
    update_interval: 60s

uart:
  id: uart_bus
  rx_pin: GPIO10
  tx_pin: GPIO9
  baud_rate: 115200
  data_bits: 8
  stop_bits: 1
  parity: NONE
#  debug:
#    direction: BOTH
#    dummy_receiver: true
#    after:
#      delimiter: "\n"
#    sequence:
#      - lambda: UARTDebug::log_string(direction, bytes);

number:
  - platform: template
    name: th1
    id: human_presence_1_th1
    min_value: 0
    max_value: 500
    initial_value: 120
    optimistic: true
    step: 10
    restore_value: true
    set_action:
      - uart.write: !lambda 
                      int th1v = (int)ceil(x);
                      std::string th1vs = "th1=" + to_string(th1v);
                      return std::vector<unsigned char>(th1vs.begin(), th1vs.end());
      - delay: 3s
      - uart.write: "save"
  - platform: template
    name: th2
    id: human_presence_1_th2
    min_value: 0
    max_value: 1000
    initial_value: 150
    optimistic: true
    step: 10
    restore_value: true
    set_action:
      - uart.write: !lambda
                     int th2v = (int)ceil(x);
                     std::string th2vs = "th2= " + to_string(th2v);
                     return std::vector<unsigned char>(th2vs.begin(), th2vs.end());
      - delay: 3s
      - uart.write: "save"

  - platform: template
    name: dtime
    id: human_presence_1_dtime
    min_value: 0
    max_value: 20
    initial_value: 5
    optimistic: true
    step: 1
    restore_value: true
    unit_of_measurement: s
    set_action:
      - uart.write: !lambda 
                      int dtimev = (int)ceil(x);
                      std::string dtimevs = "dtime=" + to_string(dtimev);
                      return std::vector<unsigned char>(dtimevs.begin(), dtimevs.end());
      - delay: 3s
      - uart.write: "save"

  - platform: template
    name: mov_sn
    id: human_presence_1_mov_sn
    min_value: 0
    max_value: 10
    initial_value: 3
    optimistic: true
    step: 1
    restore_value: true
    set_action:
      - uart.write: !lambda 
                      int mov_snv = (int)ceil(x);
                      std::string mov_snvs = "mov_sn=" + to_string(mov_snv);
                      return std::vector<unsigned char>(mov_snvs.begin(), mov_snvs.end());
      - delay: 3s
      - uart.write: "save"

  - platform: template
    name: occ_sn
    id: human_presence_1_occ_sn
    min_value: 0
    max_value: 10
    initial_value: 5
    optimistic: true
    step: 1
    restore_value: true
    set_action:
      - uart.write: !lambda 
                      int occ_snv = (int)ceil(x);
                      std::string occ_snvs = "occ_sn" + to_string(occ_snv);
                      return std::vector<unsigned char>(occ_snvs.begin(), occ_snvs.end());
      - delay: 3s
      - uart.write: "save"

在HA里:
1.jpg
2.jpg
3.jpg

回复

使用道具 举报

14

主题

249

帖子

1988

积分

金牌会员

Rank: 6Rank: 6

积分
1988
金钱
1734
HASS币
50
 楼主| 发表于 2022-8-6 16:48:16 | 显示全部楼层
showphi 发表于 2022-7-26 14:52
一直在等楼主的3D文件

由于版本较多,文件比较乱,等我整理一下发出来。
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-4-27 07:36 , Processed in 0.798767 second(s), 32 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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