sensors change
This commit is contained in:
@@ -5,7 +5,7 @@ esphome:
|
|||||||
esp32:
|
esp32:
|
||||||
board: esp32-s3-devkitc-1
|
board: esp32-s3-devkitc-1
|
||||||
framework:
|
framework:
|
||||||
type: esp-idf
|
type: arduino
|
||||||
version: latest
|
version: latest
|
||||||
|
|
||||||
logger:
|
logger:
|
||||||
@@ -21,14 +21,9 @@ ota:
|
|||||||
|
|
||||||
wifi:
|
wifi:
|
||||||
networks:
|
networks:
|
||||||
- ssid: !secret wifi_ssid
|
- ssid: !secret wifi_ssid4
|
||||||
password: !secret wifi_password
|
password: !secret wifi_password4
|
||||||
manual_ip:
|
power_save_mode: none
|
||||||
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:
|
ap:
|
||||||
ssid: "Esp32S3N16R8 Fallback Hotspot"
|
ssid: "Esp32S3N16R8 Fallback Hotspot"
|
||||||
@@ -79,18 +74,17 @@ i2c:
|
|||||||
scl: 20
|
scl: 20
|
||||||
sda: 21
|
sda: 21
|
||||||
scan: true
|
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:
|
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 =====
|
# ===== PMS5003 PM2.5 Sensor =====
|
||||||
- platform: pmsx003
|
- platform: pmsx003
|
||||||
type: PMSX003
|
type: PMSX003
|
||||||
@@ -102,70 +96,63 @@ sensor:
|
|||||||
name: "PM <10.0µm Concentration"
|
name: "PM <10.0µm Concentration"
|
||||||
uart_id: uart_pms
|
uart_id: uart_pms
|
||||||
update_interval: 30s
|
update_interval: 30s
|
||||||
# ===== AHT10 Temperature & Humidity =====
|
# ===== BME688 Indoor Air Quality =====
|
||||||
- platform: aht10
|
- platform: bme68x_bsec2
|
||||||
temperature:
|
temperature:
|
||||||
name: "AHT10 Temperature"
|
name: "BME688 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:
|
pressure:
|
||||||
name: "BME680 Pressure"
|
name: "BME688 Pressure"
|
||||||
|
id: bme688_pressure
|
||||||
humidity:
|
humidity:
|
||||||
id: "humidity"
|
name: "BME688 Humidity"
|
||||||
name: "BME680 Humidity"
|
iaq:
|
||||||
gas_resistance:
|
name: "BME688 IAQ"
|
||||||
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
|
id: iaq
|
||||||
icon: "mdi:gauge"
|
co2_equivalent:
|
||||||
# calculation: comp_gas = log(R_gas[ohm]) + 0.04 log(Ohm)/%rh * hum[%rh]
|
name: "BME688 CO2 Equivalent"
|
||||||
lambda: |-
|
breath_voc_equivalent:
|
||||||
return log(id(gas_resistance).state) + 0.04 * id(humidity).state;
|
name: "BME688 Breath VOC Equivalent"
|
||||||
state_class: "measurement"
|
# ===== 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:
|
text_sensor:
|
||||||
- platform: template
|
- platform: template
|
||||||
name: "BME680 IAQ Classification"
|
name: "BME688 IAQ Classification"
|
||||||
icon: "mdi:checkbox-marked-circle-outline"
|
|
||||||
lambda: |-
|
lambda: |-
|
||||||
if (int(id(iaq).state) <= 50) {
|
if ( int(id(iaq).state) <= 50) {
|
||||||
return {"Excellent"};
|
return {"Excellent"};
|
||||||
}
|
}
|
||||||
else if (int(id(iaq).state) <= 100) {
|
else if (int(id(iaq).state) >= 51 && int(id(iaq).state) <= 100) {
|
||||||
return {"Good"};
|
return {"Good"};
|
||||||
}
|
}
|
||||||
else if (int(id(iaq).state) <= 150) {
|
else if (int(id(iaq).state) >= 101 && int(id(iaq).state) <= 150) {
|
||||||
return {"Lightly polluted"};
|
return {"Lightly polluted"};
|
||||||
}
|
}
|
||||||
else if (int(id(iaq).state) <= 200) {
|
else if (int(id(iaq).state) >= 151 && int(id(iaq).state) <= 200) {
|
||||||
return {"Moderately polluted"};
|
return {"Moderately polluted"};
|
||||||
}
|
}
|
||||||
else if (int(id(iaq).state) <= 250) {
|
else if (int(id(iaq).state) >= 201 && int(id(iaq).state) <= 250) {
|
||||||
return {"Heavily polluted"};
|
return {"Heavily polluted"};
|
||||||
}
|
}
|
||||||
else if (int(id(iaq).state) <= 350) {
|
else if (int(id(iaq).state) >= 251 && int(id(iaq).state) <= 350) {
|
||||||
return {"Severely polluted"};
|
return {"Severely polluted"};
|
||||||
}
|
}
|
||||||
else if (int(id(iaq).state) <= 500) {
|
else if (int(id(iaq).state) >= 351) {
|
||||||
return {"Extremely polluted"};
|
return {"Extremely polluted"};
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return {"unknown"};
|
return {"error"};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -29,8 +29,10 @@ ota:
|
|||||||
|
|
||||||
wifi:
|
wifi:
|
||||||
networks:
|
networks:
|
||||||
- ssid: !secret wifi_ssid3
|
- ssid: !secret wifi_ssid5
|
||||||
password: !secret wifi_password3
|
password: !secret wifi_password4
|
||||||
|
- ssid: !secret wifi_ssid4
|
||||||
|
password: !secret wifi_password4
|
||||||
|
|
||||||
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
||||||
ap:
|
ap:
|
||||||
|
Reference in New Issue
Block a user