174 lines
3.6 KiB
YAML
174 lines
3.6 KiB
YAML
esphome:
|
|
name: esp-control
|
|
friendly_name: ESP-CONTROL
|
|
|
|
esp32:
|
|
board: esp32-s3-devkitc-1
|
|
framework:
|
|
type: esp-idf
|
|
version: latest
|
|
|
|
logger:
|
|
level: verbose
|
|
|
|
api:
|
|
encryption:
|
|
key: !secret api_key
|
|
|
|
ota:
|
|
- platform: esphome
|
|
password: !secret ota_password
|
|
|
|
wifi:
|
|
networks:
|
|
- ssid: !secret wifi_ssid
|
|
password: !secret wifi_password
|
|
manual_ip:
|
|
static_ip: 192.168.1.60
|
|
gateway: 192.168.1.254
|
|
subnet: 255.255.255.0
|
|
dns1: 9.9.9.9
|
|
dns2: 149.112.112.112
|
|
|
|
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: 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"};
|
|
}
|
|
|
|
|
|
|
|
captive_portal:
|