Skip to content

Instantly share code, notes, and snippets.

@CODeRUS
Created July 8, 2020 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CODeRUS/e73f89a375a6717434897a2d7e2fc891 to your computer and use it in GitHub Desktop.
Save CODeRUS/e73f89a375a6717434897a2d7e2fc891 to your computer and use it in GitHub Desktop.
ESPHome water meter bathroom
esphome:
name: water_consumption_bathroom
platform: ESP8266
board: nodemcuv2
platformio_options:
platform: "espressif8266@2.5.3"
wifi:
ssid: !secret ap_name
password: !secret ap_password
fast_connect: true
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Water Consumption Bathroom"
password: !secret hotspot_password
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
password: !secret api_password
ota:
password: !secret ota_password
binary_sensor:
- platform: status
name: "water_consumption_bathroom_status"
- platform: gpio
name: "water_consumption_bathroom_cold"
pin:
number: D5
mode: INPUT_PULLUP
filters:
- delayed_on: 100ms
- delayed_off: 100ms
- platform: template
name: "water_consumption_bathroom_hot"
lambda: |-
if (id(water_consumption_bathroom_hot_analog).state > 0.2) {
return true;
} else {
return false;
}
sensor:
- platform: uptime
name: "water_consumption_bathroom_uptime"
- platform: adc
pin: A0
id: water_consumption_bathroom_hot_analog
update_interval: 2s
internal: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment