161 lines
3.2 KiB
YAML
161 lines
3.2 KiB
YAML
esphome:
|
|
name: esp-control
|
|
friendly_name: ESP-CONTROL
|
|
|
|
esp32:
|
|
board: esp32-s3-devkitc-1
|
|
framework:
|
|
type: arduino
|
|
version: latest
|
|
|
|
logger:
|
|
level: verbose
|
|
|
|
api:
|
|
encryption:
|
|
key: !secret api_key
|
|
|
|
ota:
|
|
- platform: esphome
|
|
password: !secret ota_password
|
|
|
|
wifi:
|
|
networks:
|
|
- ssid: !secret wifi_ssid4
|
|
password: !secret wifi_password4
|
|
power_save_mode: none
|
|
|
|
ap:
|
|
ssid: "Esp32S3N16R8 Fallback Hotspot"
|
|
password: "v41VUZA7A1VA"
|
|
|
|
mqtt:
|
|
broker: mqtt.hadow.fr
|
|
port: 18832
|
|
username: fire
|
|
password: !secret mqtt_password
|
|
topic_prefix: "esp_control"
|
|
|
|
|
|
output:
|
|
- platform: ledc
|
|
pin: GPIO5
|
|
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
|
|
|
|
fan:
|
|
- platform: speed
|
|
output: fan_pwm_output1
|
|
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: 37
|
|
tx_pin: 38
|
|
baud_rate: 9600
|
|
|
|
i2c:
|
|
- id: bus_i2c
|
|
scl: 20
|
|
sda: 21
|
|
scan: true
|
|
frequency: 200000 Hz
|
|
|
|
bme68x_bsec2_i2c:
|
|
i2c_id: bus_i2c
|
|
address: 0x77
|
|
model: bme688
|
|
operating_age: 28d
|
|
sample_rate: LP
|
|
supply_voltage: 3.3V
|
|
|
|
sensor:
|
|
# ===== 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
|
|
# ===== BME688 Indoor Air Quality =====
|
|
- platform: bme68x_bsec2
|
|
temperature:
|
|
name: "BME688 Temperature"
|
|
pressure:
|
|
name: "BME688 Pressure"
|
|
id: bme688_pressure
|
|
humidity:
|
|
name: "BME688 Humidity"
|
|
iaq:
|
|
name: "BME688 IAQ"
|
|
id: iaq
|
|
co2_equivalent:
|
|
name: "BME688 CO2 Equivalent"
|
|
breath_voc_equivalent:
|
|
name: "BME688 Breath VOC Equivalent"
|
|
# ===== SDC41 CO2 =====
|
|
- platform: scd4x
|
|
id: scd41
|
|
measurement_mode: periodic
|
|
automatic_self_calibration: true
|
|
update_interval: 60s
|
|
co2:
|
|
name: "SDC41 CO2"
|
|
temperature:
|
|
name: "SDC41 Temperature"
|
|
humidity:
|
|
name: "SDC41 Humidity"
|
|
ambient_pressure_compensation_source: bme688_pressure
|
|
|
|
text_sensor:
|
|
- platform: template
|
|
name: "BME688 IAQ Classification"
|
|
lambda: |-
|
|
if ( int(id(iaq).state) <= 50) {
|
|
return {"Excellent"};
|
|
}
|
|
else if (int(id(iaq).state) >= 51 && int(id(iaq).state) <= 100) {
|
|
return {"Good"};
|
|
}
|
|
else if (int(id(iaq).state) >= 101 && int(id(iaq).state) <= 150) {
|
|
return {"Lightly polluted"};
|
|
}
|
|
else if (int(id(iaq).state) >= 151 && int(id(iaq).state) <= 200) {
|
|
return {"Moderately polluted"};
|
|
}
|
|
else if (int(id(iaq).state) >= 201 && int(id(iaq).state) <= 250) {
|
|
return {"Heavily polluted"};
|
|
}
|
|
else if (int(id(iaq).state) >= 251 && int(id(iaq).state) <= 350) {
|
|
return {"Severely polluted"};
|
|
}
|
|
else if (int(id(iaq).state) >= 351) {
|
|
return {"Extremely polluted"};
|
|
}
|
|
else {
|
|
return {"error"};
|
|
}
|
|
|
|
|
|
|
|
captive_portal:
|