diff --git a/plants.yaml b/plants.yaml index ff22b41..2d1539e 100644 --- a/plants.yaml +++ b/plants.yaml @@ -25,42 +25,53 @@ wifi: password: !secret wifi_password manual_ip: static_ip: 192.168.1.55 - gateway: 192.168.0.1 + 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" -# light: - # - platform: status_led - # name: "Switch state" - # pin: GPIO2 - # restore_mode: ALWAYS_OFF +mqtt: + broker: mqtt.hadow.fr + port: 18832 + username: fire + password: !secret mqtt_password + topic_prefix: "esp_plants" -switch: - - platform: gpio - pin: GPIO15 - inverted: true - name: "light pump" - - platform: gpio - pin: GPIO17 - inverted: true - name: "heavy pump" +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: GPIO16 + pin: GPIO6 id: probe1 -# # ATH20+BMP280 -# i2c: -# sda: 17 -# scl: 18 -# scan: true -# id: probe_ath_bmp_1 +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 @@ -68,29 +79,52 @@ sensor: name: "temperature" update_interval: 30s - platform: adc - pin: GPIO6 + pin: GPIO5 name: "soil moisture sensor, digital" update_interval: 30s attenuation: auto - platform: adc - pin: GPIO7 + pin: GPIO4 name: "soil moisture sensor, analog" update_interval: 30s attenuation: auto - # - platform: bmp280_i2c - # i2c_id: probe_ath_bmp_1 - # update_interval: 60s - # temperature: - # name: "BMP temp" - # oversampling: 2x - # pressure: - # name: "BMP Pressure" - # - platform: aht10 - # i2c_id: probe_ath_bmp_1 - # update_interval: 60s - # temperature: - # name: "AHT20 temp" - # id: aht20_temp - # accuracy_decimals: 1 + - 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: