forked from mhendriks/esphome-p1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
waterlezer.yaml
136 lines (115 loc) · 2.92 KB
/
waterlezer.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
substitutions:
device_name: waterlezer
device_description: Water meter sensor
version: "v22.12.3"
esphome:
name: ${device_name}
comment: "${device_description}"
name_add_mac_suffix: false
platformio_options:
upload_speed: 921600
project:
name: smartstuff.waterlezer
version: ${version}
esp8266:
board: esp12e
restore_from_flash: true
status_led:
pin:
number: 2
inverted: true
dashboard_import:
package_import_url: github://tomrennen/esphome-p1/waterlezer.yaml
wifi:
# ssid: !secret ssid
# password: !secret password
ap:
ssid: ${device_name}
web_server:
captive_portal:
logger:
level: INFO
ota:
reboot_timeout: 10min
num_attempts: 5
api:
#via Home Assistant Ontwikkelhulpmiddelen > services zoeken op esphome.watermeter_set_water_reading en via deze methode de juiste beginstand invoeren
services:
- service: set_water_reading
variables:
meter_value: int
then:
- globals.set:
id: totalWaterUsage
value: !lambda "return ( meter_value );"
globals:
- id: totalWaterUsage
type: int
restore_value: true # aanpassen naar no indien de nieuwe waarde onder de oude ligt
initial_value: '0' # beginstand van je watermeter -> aanpassen via Home Assistant services
button:
- platform: restart
name: "_Restart device"
- platform: factory_reset
name: "_Restart with Factory Default Settings"
sensor:
- platform: pulse_counter
pin:
number: 5
mode:
input: true
pullup: true #v3.5 aanzetten
id: watermeter_pulse
name: "Watermeter pulse"
count_mode:
rising_edge: DISABLE
falling_edge: INCREMENT
state_class: measurement
update_interval: 1s
internal_filter: 100us
accuracy_decimals: 0
unit_of_measurement: 'L/min'
- platform: pulse_counter
pin:
number: 5
mode:
input: true
pullup: true
id: watermeter_raw_pulse
name: "Watermeter raw pulse"
unit_of_measurement: 'L/min'
- platform: template
name: "Watermeter total"
state_class: "total_increasing"
device_class: "water"
icon: mdi:water
update_interval: 1s
unit_of_measurement: L
accuracy_decimals: 0
lambda: |-
if (id(watermeter_pulse).state > 0) id(totalWaterUsage) += 1;
return id(totalWaterUsage);
- platform: wifi_signal
name: "WiFi Signal Sensor"
update_interval: 60s
- platform: uptime
name: "Uptime"
text_sensor:
- platform: wifi_info
ip_address:
name: IP-adres
icon: mdi:ip-network
ssid:
name: Netwerk
icon: mdi:access-point-network
mac_address:
name: Mac-adres
icon: mdi:folder-key-network-outline
- platform: template
name: "Config Version"
icon: "mdi:label-outline"
update_interval: 6h
lambda: return {"${version}"};
- platform: version
name: "ESPHome Version"
hide_timestamp: true