本帖最后由 msaiwl 于 2024-4-17 09:26 编辑
采用esp8266-01S 作为主控,烧录esphome固件,控制可控硅实现空气净化器功率调节,带一个实体按钮 可以手动多档调节,也可以接入HA自动控制,目前是定时开启关闭
实物
装配过程
模型
风扇
主板
原理图是参考 sorrypqa 这位大佬的
滤芯
资料包太大了上传不了。。。。
esphome 固件
esphome:
name: air
friendly_name: air
esp8266:
board: esp01_1m
# 是否打印日志
logger:
level: debug
# Enable Home Assistant API
api:
encryption:
key: "vsEHBfjh1VUEG4jmKzeAxUsvl1"
ota:
password: "46480ac8d8e3871293a28c4f4"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Air Fallback Hotspot"
password: "3SSgXxEXkb5c"
# Example configuration entry
binary_sensor:
- platform: gpio
pin: GPIO2
name: "空气净化器"
filters:
- delayed_on: 50ms
- delayed_off: 50ms
- delayed_on_off: 50ms #延迟开关:仅当二进制传感器至少在指定的时间段内保持在相同状态时,才发送打开或关闭值。用于解除二进制开关的抖动
on_multi_click:
- timing:
- OFF for at most 0.5s
- ON for at least 0.3s
then:
- lambda: |-
if (id(air_Speed).speed == 65) {
auto call = id(air_Speed).turn_on();
call.set_speed(75);
call.perform();
} else if (id(air_Speed).speed == 75) {
auto call = id(air_Speed).turn_on();
call.set_speed(100);
call.perform();
}else if (id(air_Speed).speed == 100) {
auto call = id(air_Speed).turn_off();
call.set_speed(60);
call.perform();
}else {
auto call = id(air_Speed).turn_on();
call.set_speed(65);
call.perform();
}
output:
- platform: ac_dimmer
id: dimmer1
gate_pin: GPIO0 #用于控制可控硅的引脚。
# inverted: true
method: leading pulse
zero_cross_pin: #用于感测交流过零事件的引脚
number: GPIO3
mode:
input: true
# inverted: true
fan:
- platform: speed
output: dimmer1
name: "air_Speed"
id: air_Speed
speed_count: 100
restore_mode: RESTORE_DEFAULT_ON #
on_turn_on:
then:
- fan.turn_on:
id: air_Speed
speed: 65 #默认sudu
开源地址:【ESPHome】——空气净化器 - 嘉立创EDA开源硬件平台 (oshwhub.com)
|