Skip to content

Instantly share code, notes, and snippets.

@letsautomatenet
Created September 7, 2023 12:32
Show Gist options
  • Save letsautomatenet/80764a6f5362a60c11bf25b23cbe8f7d to your computer and use it in GitHub Desktop.
Save letsautomatenet/80764a6f5362a60c11bf25b23cbe8f7d to your computer and use it in GitHub Desktop.
Water Sensor - Non-Contact - ESPHome
esphome:
name: water-sensor-1
friendly_name: Water Sensor 1
esp8266:
board: d1_mini
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
# If you go to this page it generates one for you automatically!
# https://esphome.io/components/api.html#configuration-variables
key: "Generate a key and put it here"
ota:
password: "randomsecurepassword"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Water-Sensor-1 Fallback Hotspot"
password: "differentrandomsecurepassword"
captive_portal:
binary_sensor:
- platform: gpio
pin:
number: D1
mode:
input: true
pullup: true
name: Water Sensor 1
device_class: moisture
filters:
- invert
- platform: gpio
pin:
number: D2
mode:
input: true
pullup: true
name: Water Sensor 2
device_class: moisture
filters:
- invert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment