131 lines
2.5 KiB
YAML
131 lines
2.5 KiB
YAML
esphome:
|
|
name: esp-plants
|
|
friendly_name: ESP-PLANTS
|
|
|
|
esp32:
|
|
board: esp32-s3-devkitc-1
|
|
framework:
|
|
type: arduino
|
|
|
|
# Enable logging
|
|
logger:
|
|
level: verbose
|
|
|
|
# Enable Home Assistant API
|
|
api:
|
|
encryption:
|
|
key: !secret api_key
|
|
|
|
ota:
|
|
- platform: esphome
|
|
password: !secret ota_password
|
|
|
|
wifi:
|
|
ssid: !secret wifi_ssid
|
|
password: !secret wifi_password
|
|
manual_ip:
|
|
static_ip: 192.168.1.55
|
|
gateway: 192.168.1.254
|
|
subnet: 255.255.255.0
|
|
dns1: 9.9.9.9
|
|
dns2: 149.112.112.112
|
|
|
|
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
|
ap:
|
|
ssid: "Esp32S3N16R8 Fallback Hotspot"
|
|
password: "v41VUZA7A1VA"
|
|
|
|
mqtt:
|
|
broker: mqtt.hadow.fr
|
|
port: 18832
|
|
username: fire
|
|
password: !secret mqtt_password
|
|
topic_prefix: "esp_plants"
|
|
|
|
i2c:
|
|
- id: bus_i2c_ph_probe
|
|
scl: 17
|
|
sda: 16
|
|
scan: true
|
|
- id: bus_i2c_air_sensor
|
|
scl: 21
|
|
sda: 20
|
|
scan: true
|
|
|
|
# temperature probe
|
|
one_wire:
|
|
- platform: gpio
|
|
pin: GPIO6
|
|
id: probe1
|
|
|
|
switch:
|
|
- platform: gpio
|
|
pin: GPIO35
|
|
inverted: true
|
|
name: "relay 1"
|
|
- platform: gpio
|
|
pin: GPIO36
|
|
inverted: true
|
|
name: "relay 2"
|
|
- platform: gpio
|
|
pin: GPIO37
|
|
inverted: true
|
|
name: "relay 3"
|
|
|
|
|
|
sensor:
|
|
- platform: dallas_temp
|
|
one_wire_id: probe1
|
|
name: "temperature"
|
|
update_interval: 30s
|
|
- platform: adc
|
|
pin: GPIO5
|
|
name: "soil moisture sensor, digital"
|
|
update_interval: 30s
|
|
attenuation: auto
|
|
- platform: adc
|
|
pin: GPIO4
|
|
name: "soil moisture sensor, analog"
|
|
update_interval: 30s
|
|
attenuation: auto
|
|
- platform: aht10
|
|
variant: AHT20
|
|
i2c_id: bus_i2c_air_sensor
|
|
temperature:
|
|
name: "AHT21 Temperature"
|
|
id: aht21_temperature
|
|
humidity:
|
|
name: "AHT21 Humidity"
|
|
id: aht21_humidity
|
|
address: 0x38
|
|
update_interval: 30s
|
|
- platform: ens160_i2c
|
|
i2c_id: bus_i2c_air_sensor
|
|
eco2:
|
|
name: "ENS160 eCO2"
|
|
tvoc:
|
|
name: "ENS160 Total Volatile Organic Compounds"
|
|
aqi:
|
|
id: ens160_air_quality_index
|
|
name: "ENS160 Air Quality Index"
|
|
compensation:
|
|
temperature: aht21_temperature
|
|
humidity: aht21_humidity
|
|
address: 0x53
|
|
update_interval: 30s
|
|
|
|
text_sensor:
|
|
- platform: template
|
|
name: "ENS160 Air Quality Rating"
|
|
lambda: |-
|
|
switch ( (int) (id(ens160_air_quality_index).state) ) {
|
|
case 1: return {"Excellent"};
|
|
case 2: return {"Good"};
|
|
case 3: return {"Moderate"};
|
|
case 4: return {"Poor"};
|
|
case 5: return {"Unhealthy"};
|
|
default: return {"Not Available"};
|
|
}
|
|
|
|
captive_portal:
|