Skip to content

Instantly share code, notes, and snippets.

@McSlow
Last active February 10, 2025 19:23
Show Gist options
  • Save McSlow/9c64e31557708c534b1210967b1bced8 to your computer and use it in GitHub Desktop.
Save McSlow/9c64e31557708c534b1210967b1bced8 to your computer and use it in GitHub Desktop.
esphome:
name: "wasserzaehler"
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "pumuckel3000"
ota:
# place _your_ wifi_ssd and wifi_password in esphome's secret store :)
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "pumuckelsWasserZaehler"
password: "pumuckel4000"
captive_portal:
# Connect Reed contact to GPIO16 and GND.
binary_sensor:
- platform: gpio
pin:
number: GPIO16
inverted: True
mode:
input: true
pullup: true
name: "water_reed"
filters:
- delayed_on: 10ms
internal: True
on_press:
- sensor.template.publish:
id: water_sens
state: 10
on_release:
- sensor.template.publish:
id: water_sens
state: 0
sensor:
- platform: uptime
name: Uptime Sensor Gaswasserzaehler
- platform: template
name: "Water Sensor"
id: water_sens
update_interval: never
device_class: water
unit_of_measurement: L
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment