134 lines
2.6 KiB
YAML
134 lines
2.6 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_ssid4
|
|
password: !secret wifi_password4
|
|
|
|
# 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_air_sensor
|
|
scl: 21
|
|
sda: 20
|
|
scan: true
|
|
|
|
# temperature probes
|
|
one_wire:
|
|
- platform: gpio
|
|
pin: GPIO6
|
|
id: probe0
|
|
- platform: gpio
|
|
pin: GPIO7
|
|
id: probe1
|
|
- platform: gpio
|
|
pin: GPIO15
|
|
id: probe2
|
|
- platform: gpio
|
|
pin: GPIO16
|
|
id: probe3
|
|
|
|
output:
|
|
- platform: ledc
|
|
pin: GPIO5
|
|
id: pwm_output1
|
|
frequency: 25000Hz
|
|
|
|
fan:
|
|
- platform: speed
|
|
output: pwm_output1
|
|
name: "12V pump"
|
|
|
|
|
|
sensor:
|
|
- platform: dallas_temp
|
|
one_wire_id: probe0
|
|
name: "temperature 0" #air
|
|
update_interval: 30s
|
|
- platform: dallas_temp
|
|
one_wire_id: probe1
|
|
name: "temperature 1" #aquaponics
|
|
update_interval: 30s
|
|
- platform: dallas_temp
|
|
one_wire_id: probe2
|
|
name: "temperature 2" #fish tank
|
|
update_interval: 30s
|
|
- platform: dallas_temp
|
|
one_wire_id: probe3
|
|
name: "temperature 3" #fish tank 2
|
|
update_interval: 30s
|
|
- 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:
|