control box
This commit is contained in:
@@ -1,17 +1,16 @@
|
|||||||
esphome:
|
esphome:
|
||||||
name: esp-filter2
|
name: esp-control
|
||||||
friendly_name: ESP-FILTER2
|
friendly_name: ESP-CONTROL
|
||||||
|
|
||||||
esp32:
|
esp32:
|
||||||
board: esp32-s3-devkitc-1
|
board: esp32-s3-devkitc-1
|
||||||
framework:
|
framework:
|
||||||
type: arduino
|
type: esp-idf
|
||||||
|
version: latest
|
||||||
|
|
||||||
# Enable logging
|
|
||||||
logger:
|
logger:
|
||||||
level: verbose
|
level: verbose
|
||||||
|
|
||||||
# Enable Home Assistant API
|
|
||||||
api:
|
api:
|
||||||
encryption:
|
encryption:
|
||||||
key: !secret api_key
|
key: !secret api_key
|
||||||
@@ -21,16 +20,16 @@ ota:
|
|||||||
password: !secret ota_password
|
password: !secret ota_password
|
||||||
|
|
||||||
wifi:
|
wifi:
|
||||||
ssid: !secret wifi_ssid
|
networks:
|
||||||
password: !secret wifi_password
|
- ssid: !secret wifi_ssid
|
||||||
manual_ip:
|
password: !secret wifi_password
|
||||||
static_ip: 192.168.1.60
|
manual_ip:
|
||||||
gateway: 192.168.1.254
|
static_ip: 192.168.1.60
|
||||||
subnet: 255.255.255.0
|
gateway: 192.168.1.254
|
||||||
dns1: 9.9.9.9
|
subnet: 255.255.255.0
|
||||||
dns2: 149.112.112.112
|
dns1: 9.9.9.9
|
||||||
|
dns2: 149.112.112.112
|
||||||
|
|
||||||
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
|
||||||
ap:
|
ap:
|
||||||
ssid: "Esp32S3N16R8 Fallback Hotspot"
|
ssid: "Esp32S3N16R8 Fallback Hotspot"
|
||||||
password: "v41VUZA7A1VA"
|
password: "v41VUZA7A1VA"
|
||||||
@@ -40,19 +39,134 @@ mqtt:
|
|||||||
port: 18832
|
port: 18832
|
||||||
username: fire
|
username: fire
|
||||||
password: !secret mqtt_password
|
password: !secret mqtt_password
|
||||||
topic_prefix: "esp_filter_blower_fan"
|
topic_prefix: "esp_control"
|
||||||
|
|
||||||
|
|
||||||
output:
|
output:
|
||||||
- platform: ledc
|
- platform: ledc
|
||||||
pin: GPIO5
|
pin: GPIO5
|
||||||
id: fan_pwm_output
|
id: fan_pwm_output1
|
||||||
|
frequency: 25000Hz
|
||||||
|
- platform: ledc
|
||||||
|
pin: GPIO6
|
||||||
|
id: fan_pwm_output2
|
||||||
|
frequency: 25000Hz
|
||||||
|
- platform: ledc
|
||||||
|
pin: GPIO7
|
||||||
|
id: fan_pwm_output3
|
||||||
frequency: 25000Hz
|
frequency: 25000Hz
|
||||||
|
|
||||||
fan:
|
fan:
|
||||||
- platform: speed
|
- platform: speed
|
||||||
output: fan_pwm_output
|
output: fan_pwm_output1
|
||||||
name: "12V Blower Fan"
|
name: "12V fan 1"
|
||||||
|
- platform: speed
|
||||||
|
output: fan_pwm_output2
|
||||||
|
name: "12V fan 2"
|
||||||
|
- platform: speed
|
||||||
|
output: fan_pwm_output3
|
||||||
|
name: "12V fan 3"
|
||||||
|
|
||||||
|
# ===== PMS5003 PM2.5 Sensor =====
|
||||||
|
uart:
|
||||||
|
id: uart_pms
|
||||||
|
rx_pin: 47
|
||||||
|
tx_pin: 48
|
||||||
|
baud_rate: 9600
|
||||||
|
|
||||||
|
i2c:
|
||||||
|
- id: bus_i2c
|
||||||
|
scl: 20
|
||||||
|
sda: 21
|
||||||
|
scan: true
|
||||||
|
|
||||||
|
sensor:
|
||||||
|
# ===== SGP40 Indoor Air Quality (VOC) =====
|
||||||
|
- platform: sgp4x
|
||||||
|
voc:
|
||||||
|
name: "VOC Index"
|
||||||
|
i2c_id: bus_i2c
|
||||||
|
address: 0x59
|
||||||
|
update_interval: 30s
|
||||||
|
compensation:
|
||||||
|
temperature_source: aht10_temperature
|
||||||
|
humidity_source: aht10_humidity
|
||||||
|
# ===== PMS5003 PM2.5 Sensor =====
|
||||||
|
- platform: pmsx003
|
||||||
|
type: PMSX003
|
||||||
|
pm_1_0:
|
||||||
|
name: "PM <1.0µm Concentration"
|
||||||
|
pm_2_5:
|
||||||
|
name: "PM <2.5µm Concentration"
|
||||||
|
pm_10_0:
|
||||||
|
name: "PM <10.0µm Concentration"
|
||||||
|
uart_id: uart_pms
|
||||||
|
update_interval: 30s
|
||||||
|
# ===== AHT10 Temperature & Humidity =====
|
||||||
|
- platform: aht10
|
||||||
|
temperature:
|
||||||
|
name: "AHT10 Temperature"
|
||||||
|
id: aht10_temperature
|
||||||
|
humidity:
|
||||||
|
name: "AHT10 Humidity"
|
||||||
|
id: aht10_humidity
|
||||||
|
address: 0x38
|
||||||
|
i2c_id: bus_i2c
|
||||||
|
update_interval: 30s
|
||||||
|
# ===== BME680 Indoor Air Quality =====
|
||||||
|
- platform: bme680
|
||||||
|
temperature:
|
||||||
|
name: "BME680 Temperature"
|
||||||
|
oversampling: 16x
|
||||||
|
pressure:
|
||||||
|
name: "BME680 Pressure"
|
||||||
|
humidity:
|
||||||
|
id: "humidity"
|
||||||
|
name: "BME680 Humidity"
|
||||||
|
gas_resistance:
|
||||||
|
id: "gas_resistance"
|
||||||
|
name: "BME680 Gas Resistance"
|
||||||
|
address: 0x77
|
||||||
|
i2c_id: bus_i2c
|
||||||
|
update_interval: 60s
|
||||||
|
- platform: template
|
||||||
|
name: "BME680 Indoor Air Quality"
|
||||||
|
id: iaq
|
||||||
|
icon: "mdi:gauge"
|
||||||
|
# calculation: comp_gas = log(R_gas[ohm]) + 0.04 log(Ohm)/%rh * hum[%rh]
|
||||||
|
lambda: |-
|
||||||
|
return log(id(gas_resistance).state) + 0.04 * id(humidity).state;
|
||||||
|
state_class: "measurement"
|
||||||
|
|
||||||
|
text_sensor:
|
||||||
|
- platform: template
|
||||||
|
name: "BME680 IAQ Classification"
|
||||||
|
icon: "mdi:checkbox-marked-circle-outline"
|
||||||
|
lambda: |-
|
||||||
|
if (int(id(iaq).state) <= 50) {
|
||||||
|
return {"Excellent"};
|
||||||
|
}
|
||||||
|
else if (int(id(iaq).state) <= 100) {
|
||||||
|
return {"Good"};
|
||||||
|
}
|
||||||
|
else if (int(id(iaq).state) <= 150) {
|
||||||
|
return {"Lightly polluted"};
|
||||||
|
}
|
||||||
|
else if (int(id(iaq).state) <= 200) {
|
||||||
|
return {"Moderately polluted"};
|
||||||
|
}
|
||||||
|
else if (int(id(iaq).state) <= 250) {
|
||||||
|
return {"Heavily polluted"};
|
||||||
|
}
|
||||||
|
else if (int(id(iaq).state) <= 350) {
|
||||||
|
return {"Severely polluted"};
|
||||||
|
}
|
||||||
|
else if (int(id(iaq).state) <= 500) {
|
||||||
|
return {"Extremely polluted"};
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return {"unknown"};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user