forked from EddieDSuza/techwitheddie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
water_sensor.yaml
67 lines (54 loc) · 1.46 KB
/
water_sensor.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
esphome:
name: "water-tank-right"
friendly_name: water_tank_right
esp8266:
board: nodemcuv2
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "XXX+fDB9A="
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esphome-Web-238E1D"
password: "RcDMK9XXXasNA7v"
captive_portal:
sensor:
- platform: wifi_signal
name: "WiFi Signal Sensor"
update_interval: 60s #to display WiFi signal strength
- platform: ultrasonic
trigger_pin: D5
echo_pin: D6
unit_of_measurement: "%"
icon: "mdi:water-percent"
accuracy_decimals: 0
pulse_time: 200ms
timeout: 4.0m
update_interval: 5s
name: "Rain Water storage" #You may change the tank name
# tank height: 1.20m
# distance between sensor and water brim 0.10m
# full tank: tank height-0.10m = 1.10m
# current reading: x
# used = (x - 0.10m)
# remaining = (1.10m - used)
# percent = (remaining / 1.10m) * 100
filters:
- lambda: return (1-((x-.10)/1.10))*100;
- filter_out: nan
- platform: ultrasonic
trigger_pin: D5
echo_pin: D6
update_interval: 1200000ms #5 minutes. You can change this value
name: "Remaining Water in Tank"
unit_of_measurement: "l"
accuracy_decimals: 0
filters:
- lambda: return (1-((x-.10)/1.10))*1000;
- filter_out: nan