Created
April 16, 2021 20:37
-
-
Save esbenr/a49b38854053c12c8cc399e44d3277a8 to your computer and use it in GitHub Desktop.
Ali Express ESP32+DHT11 soil moist plant sensor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
esphome: | |
name: flower01 | |
platform: ESP32 | |
board: esp32dev | |
wifi: | |
ssid: "[WIFI SSID]" | |
password: "[WIFI password]" | |
# Enable fallback hotspot (captive portal) in case wifi connection fails | |
ap: | |
ssid: "Flower01 Fallback Hotspot" | |
password: "on85QkPGjuDv" | |
captive_portal: | |
# Enable logging | |
logger: | |
# Enable Home Assistant API | |
api: | |
ota: | |
sensor: | |
- platform: dht | |
model: DHT11 | |
pin: 22 | |
temperature: | |
name: "Flower01 Temperature" | |
id: "flower01_temperature" | |
humidity: | |
name: "Flower01 Humidity" | |
id: "flower01_humdity" | |
update_interval: 20s | |
- platform: adc | |
pin: 32 | |
name: "Flower01 Moisture" | |
id: "flower01_moisture" | |
attenuation: 11db | |
unit_of_measurement: '%' | |
icon: "mdi:water-percent" | |
filters: | |
# 1.1v = in water (1.4v) | |
# 1.94v = dry (3.2v) | |
lambda: |- | |
return (3.015 - x) * 100.0 / (3.015 - 1.1); | |
switch: | |
- platform: gpio | |
name: "Flower01 Led" | |
id: "flower01_led" | |
pin: | |
number: 16 | |
inverted: yes | |
#deep_sleep: | |
# run_duration: 120s | |
# sleep_duration: 18min |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alternative configuration, that I should try to mix and match: