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

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

[硬件DIY] 卫生间多功能模块,集成浴霸,热水器,照明,电能计量.....

[复制链接]

43

主题

325

帖子

2728

积分

论坛DIY达人

积分
2728
金钱
2398
HASS币
50
发表于 2024-3-8 12:23:43 | 显示全部楼层 |阅读模式
本帖最后由 shadowba 于 2024-3-8 12:26 编辑

本着少用8266的数量的原则个人做了热水器、热水温度,浴霸灯、卫生间照明灯、微波人体传感器、光纤传感器以及电能计量集成控制,目前工作稳定
23.png

24.png

25.png

SCH_Schematic1_1-P1_2024-03-08.png

26.png

esphome:
  name: "toliet"
  comment: 厕所灯、浴霸、热水器
  platform: ESP8266
  board: esp01_1m
ota:
  password: ""
wifi:
  networks:
  - ssid: 
    password: 
  ap:
    ssid: "toliet"
    password: ""
captive_portal:
api:
#logger:
web_server:
  port: 80
time:
  - platform: sntp
    timezone: "Asia/Shanghai"
    id: sntp_time
    servers: "ntp1.aliyun.com"
    on_time:
      - seconds: 0
        minutes: 00
        hours: 23
        then:
         - light.control:
              id: lamp
              brightness: 50%
      - seconds: 0
        minutes: 20
        hours: 6
        then:
         - light.control:
              id: lamp
              brightness: 100%
uart:
  - id: uart_bus
    tx_pin: 1
    rx_pin: 3
    baud_rate: 256000
    parity: NONE
    stop_bits: 1
  - id: uart_bus1
    tx_pin: 2
    rx_pin: 12
    baud_rate: 4800
    stop_bits: 1
i2c:
  sda: 4
  scl: 5
  scan: true
  id: bus_a
pcf8574:
  - id: 'pcf8574_hub'
    address: 0x20
    pcf8575: true
dallas:
  - pin: GPIO13
    update_interval: 60s
sensor:
  - platform: dallas
    address: 0x61220ad445eef528
    name: "Toliet-water heater temperature"
    id: temperature
  - platform: bl0942
    uart_id: uart_bus1
    voltage:
      name: 'Toliet Voltage'
    current:
      name: 'Toliet Current'
    power:
      name: 'Toliet Power'
      id: power
    energy:
      name: 'Toliet Energy'
      accuracy_decimals: 2
    frequency:
      name: "Toliet Frequency"
    update_interval: 60s

  - platform: total_daily_energy
    name: 'Toliet Total Daily Energy'
    power_id: power
    restore: true 
    unit_of_measurement: 'kWh'
    state_class: total_increasing
    device_class: energy
    accuracy_decimals: 3
    filters:
# Multiplication factor from W to kW is 0.001
       - multiply: 0.001

  - platform: adc
    pin: A0
    name: "Toliet Brightness"
    id: VNButton
    update_interval: 1s
    filters:
      - multiply: 3.3
    on_value_range:
      - below: 2.2
        then:
          - binary_sensor.template.publish:
              id: fxp
              state: ON 
      - above: 2.2
        then:  
          - binary_sensor.template.publish:
              id: fxp
              state: OFF
ld2410:
  - uart_id: uart_bus  
light:
  - platform: monochromatic
    id: lamp
    icon: "mdi:wall-sconce-round"
    name: "Toliet-Lamp"
    output: pwm_output
    restore_mode: RESTORE_DEFAULT_OFF 
  - platform: binary
    id: lamp1
    icon: "mdi:lightbulb"
    name: "Toliet-Lamp1"
    output: light_output1
    restore_mode: RESTORE_DEFAULT_OFF
  - platform: binary
    id: lamp2
    icon: "mdi:lightbulb-group"
    name: "Toliet-Lamp2"
    output: light_output2
    restore_mode: RESTORE_DEFAULT_OFF
output:
  - platform: esp8266_pwm
    pin: GPIO15
    frequency: 5000Hz
    id: pwm_output
  - platform: gpio
    pin:
      pcf8574: pcf8574_hub
      # Use pin number 0
      number: 6
      # One of INPUT or OUTPUT
      mode:
        output: true
      inverted: false
    id: light_output1
  - platform: gpio
    pin:
      pcf8574: pcf8574_hub
      # Use pin number 0
      number: 5
      # One of INPUT or OUTPUT
      mode:
        output: true
      inverted: false
    id: light_output2
binary_sensor:
  - platform: ld2410
    has_moving_target:
      id: motion
      name: "Toliet Moving Target"
    has_still_target:
      id: still
      name: Toliet Still Target
      filters:
        - delayed_on: 10ms
        - delayed_off: 10s 
      on_press:
         - if:
            condition:
              and:
                - binary_sensor.is_off: fxp
                - binary_sensor.is_off: blight
            then:    
              - light.turn_on: lamp
      on_release:  
         - if:
            condition:
              and:
                - binary_sensor.is_off: blight 
            then:
              - light.turn_off: lamp
  - platform: gpio
    name: "Toliet lamp"
    pin:
      pcf8574: pcf8574_hub
      # Use pin number 0
      number: 2
      # One of INPUT or OUTPUT
      mode:
        input: true
      inverted: false   
    id: lampsw
    filters:
        - delayed_on: 10ms 
    on_press:          
        - switch.toggle: template_swi
  - platform: gpio
    name: "Toliet lamp1"
    pin:
      pcf8574: pcf8574_hub
      # Use pin number 0
      number: 3
      # One of INPUT or OUTPUT
      mode:
        input: true
      inverted: false 
    id: lampsw1
    filters:
        - delayed_on: 10ms 
    on_press:          
        - light.toggle: lamp1
  - platform: gpio
    name: "Toliet lamp2"
    pin:
      pcf8574: pcf8574_hub
      # Use pin number 0
      number: 4
      # One of INPUT or OUTPUT
      mode:
        input: true
      inverted: false  
    id: lampsw2
    filters:
        - delayed_on: 10ms 
    on_press:          
        - light.toggle: lamp2
  - platform: template
    id: blight
    lambda: |-
      if (id(template_swi).state == true) {
        return true;
      } else {
        return false;
      }
  - platform: template     
    name: "light binary_sensor"
    id: fxp
    device_class: light
climate:
  - platform: thermostat
    name: "Toliet Water Heater Controller"
    sensor: temperature
    min_heating_off_time: 120s
    min_heating_run_time: 120s
    min_idle_time: 30s
    heat_deadband: 5
    heat_overrun: 5
    visual:
      min_temperature: 25
      max_temperature: 65
      temperature_step: 1°C  
    heat_action:
      - switch.turn_on: rs_output
    idle_action:
      - switch.turn_off: rs_output
    default_preset: Home
    on_boot_restore_from: memory  
    preset:
      - name: Home
        default_target_temperature_low: 45°C
switch:
  - platform: template
    id: template_swi
    turn_on_action:
      - switch.template.publish:
          id: template_swi
          state: ON 
      - light.turn_on: lamp
    turn_off_action: 
      - switch.template.publish:  
          id: template_swi
          state: OFF 
      - light.turn_off: lamp
  - platform: gpio
   # name: "Toliet HOT"
    pin:
      pcf8574: pcf8574_hub
      # Use pin number 0
      number: 7
      # One of INPUT or OUTPUT
      mode:
        output: true
      inverted: false
    id: rs_output
  - platform: gpio
    pin: 14
    id: gmdz
    name: gmdz_switch
    restore_mode: ALWAYS_ON
button:
  - platform: restart
    name: "Toliet Restart"




嘉立创制版文件
Gerber_PCB1_2024-03-018.zip (339.29 KB, 下载次数: 1, 售价: 2 金钱)

评分

参与人数 2金钱 +21 收起 理由
sorrypqa + 16 感谢楼主分享!
yc0209 + 5 高手,这是高手!

查看全部评分

回复

使用道具 举报

3

主题

154

帖子

1764

积分

金牌会员

Rank: 6Rank: 6

积分
1764
金钱
1610
HASS币
10
发表于 2024-3-8 14:34:01 | 显示全部楼层
感谢分享   
回复

使用道具 举报

0

主题

608

帖子

2516

积分

金牌会员

Rank: 6Rank: 6

积分
2516
金钱
1908
HASS币
0
发表于 2024-3-8 14:56:07 | 显示全部楼层
热水器温度和设置温度怎么弄
回复

使用道具 举报

5

主题

127

帖子

805

积分

高级会员

Rank: 4

积分
805
金钱
678
HASS币
0
发表于 2024-3-8 15:03:41 | 显示全部楼层
只能顶礼膜拜
回复

使用道具 举报

6

主题

114

帖子

1411

积分

金牌会员

Rank: 6Rank: 6

积分
1411
金钱
1297
HASS币
0
发表于 2024-3-8 15:07:21 | 显示全部楼层
感谢分享  ,打板制作
回复

使用道具 举报

51

主题

1341

帖子

5604

积分

论坛DIY达人

积分
5604
金钱
4263
HASS币
20
发表于 2024-3-9 07:52:15 | 显示全部楼层
不错,学习学习,谢谢分享!
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-25 16:28 , Processed in 0.462428 second(s), 32 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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