Files
esphome-configs/espwater_old.yaml
2021-12-05 14:33:07 +00:00

117 lines
2.1 KiB
YAML

esphome:
name: espwater
platform: ESP8266
board: d1_mini
esp8266_restore_from_flash: true
# Enable logging
logger:
# Enable Home Assistant API
api:
password: "feelhome123"
ota:
password: "feelhome123"
wifi:
ssid: "lauIOT"
password: "superiot1"
domain: .home.cabestan.be
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Espsalon Fallback Hotspot"
password: "jTlMOFiFOzog"
captive_portal:
web_server:
port: 80
mqtt:
broker: hass20.home.cabestan.be
username: espsalon
password: sala45224
globals:
- id: drops_absolute
type: unsigned long int
restore_value: no
initial_value: '0'
- id: drops_today
type: int
restore_value: no
initial_value: '0'
- id: drops_1min
type: int
restore_value: no
initial_value: '0'
# display:
# - platform: lcd_gpio
# dimensions: 18x4
# data_pins:
# - D0
# - D1
# - D2
# - D3
# enable_pin: D4
# rs_pin: D5
# lambda: |-
# it.print("Hello World!");
switch:
- platform: gpio
name: "CO2 Led"
pin: 2
- platform: gpio
id: co2_drop
name: "CO2 Relay"
pin: D8
binary_sensor:
- platform: gpio
name: "Water Hall Sensor"
id: water_relay
pin:
number: D2
mode:
input: true
pullup: true
filters:
- delayed_on: 2ms
- delayed_off: 50ms
on_press:
then:
- switch.turn_on: co2_drop
- delay: 100ms
- switch.turn_off: co2_drop
- lambda: |-
id(drops_absolute) += 1;
id(drops_today) += 1;
id(drops_1min) += 1;
- mqtt.publish:
topic: test/liters_today
payload: !lambda |-
return to_string(float(id(drops_today)*0.25));
- mqtt.publish:
topic: test/liters_absolute
payload: !lambda |-
return to_string(float(id(drops_absolute)*0.25));
time:
- platform: sntp
on_time:
# reset counter every day
- seconds: 0
minutes: 0
hours: 0
then:
- lambda: |-
drops_today = 0;