-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathp1dsmrreader-webserver.yaml
304 lines (269 loc) · 6.44 KB
/
p1dsmrreader-webserver.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
substitutions:
device: p1dsmrreader
name: P1DSMRReader
location: Meterkast
reboot_timeout: 1h
update_interval: 10min
esphome:
name: ${device}
name_add_mac_suffix: True
platform: ESP32
board: esp32dev
platformio_options:
upload_speed: 921600
includes:
- uartp1reader.h
libraries:
- "Dsmr"
on_boot:
- delay: 1000ms
- switch.turn_on: p1rts
on_shutdown:
- switch.turn_off: p1rts
- delay: 1000ms
<<: !include common/common.yaml
<<: !include common/logger.yaml
# Enable to have a web server to display info
<<: !include common/web_server.yaml
status_led:
pin:
number: 27
inverted: True
switch:
- !include common/switch/restart.yaml
- platform: gpio
pin: 4
id: p1rts
internal: true
binary_sensor:
- !include common/binary_sensor/status.yaml
uart:
baud_rate: 115200
rx_pin: 16
rx_buffer_size: 512
data_bits: 8
parity: NONE
stop_bits: 1
id: p1uart
text_sensor:
- platform: template
id: "p1version"
name: "DSMR Version"
#lambda: "return {};"
- platform: template
id: "p1timestamp"
name: "Electricity Timestamp"
#lambda: "return {};"
- platform: template
id: "p1gastimestamp"
name: "Gas Timestamp"
sensor:
- !include common/sensor/wifi-signal.yaml
- !include common/sensor/uptime.yaml
- platform: pulse_counter
name: "Water Consumption Per Minute"
pin:
number: GPIO17
mode: INPUT
internal_filter: 13us
accuracy_decimals: 0
count_mode:
rising_edge: DISABLE
falling_edge: INCREMENT
update_interval: 60s
unit_of_measurement: "dm³"
id: water_per_minute
filters:
- throttle: 1.5s
total:
name: "Total Water Consumption"
unit_of_measurement: "dm³"
accuracy_decimals: 0
id: water_total
- platform: template
id: "p1electricitytariff"
name: "Electricity Tariff"
accuracy_decimals: 0
filters:
- or:
- delta: 1.0
- throttle: 60s
- platform: template
id: "p1electricityconsumedlowtariff"
name: "Electricity Consumed Low Tariff"
unit_of_measurement: Wh
accuracy_decimals: 0
filters:
- or:
- delta: 1.0
- throttle: 10s
- platform: template
id: "p1electricityconsumedhightariff"
name: "Electricity Consumed High Tariff"
unit_of_measurement: Wh
accuracy_decimals: 0
filters:
- or:
- delta: 1.0
- throttle: 10s
- platform: template
id: "p1electricityproducedlowtariff"
name: "Electricity Produced Low Tariff"
unit_of_measurement: Wh
accuracy_decimals: 0
filters:
- or:
- delta: 1.0
- throttle: 10s
- platform: template
id: "p1electricityproducedhightariff"
name: "Electricity Produced High Tariff"
unit_of_measurement: Wh
accuracy_decimals: 0
filters:
- or:
- delta: 1.0
- throttle: 10s
- platform: template
id: "p1actualpowerconsumed"
name: "Actual Power Consumed"
unit_of_measurement: W
accuracy_decimals: 0
filters:
- or:
- delta: 1.0
- throttle: 10s
- platform: template
id: "p1actualpowerproduced"
name: "Actual Power Produced"
unit_of_measurement: W
accuracy_decimals: 0
filters:
- or:
- delta: 1.0
- throttle: 10s
- platform: template
id: "p1gasconsumed"
name: "Gas Consumed"
unit_of_measurement: "dm³"
accuracy_decimals: 0
filters:
- or:
- delta: 1.0
- throttle: 30s
- platform: template
id: "p1powerconsumedl1"
name: "Actual Power Consumed L1"
unit_of_measurement: W
accuracy_decimals: 0
filters:
- or:
- delta: 1.0
- throttle: 10s
- platform: template
id: "p1powerconsumedl2"
name: "Actual Power Consumed L2"
unit_of_measurement: W
accuracy_decimals: 0
filters:
- or:
- delta: 1.0
- throttle: 10s
- platform: template
id: "p1powerconsumedl3"
name: "Actual Power Consumed L3"
unit_of_measurement: W
accuracy_decimals: 0
filters:
- or:
- delta: 1.0
- throttle: 10s
- platform: template
id: "p1powerproducedl1"
name: "Actual Power Produced L1"
unit_of_measurement: W
accuracy_decimals: 0
filters:
- or:
- delta: 1.0
- throttle: 10s
- platform: template
id: "p1powerproducedl2"
name: "Actual Power Produced L2"
unit_of_measurement: W
accuracy_decimals: 0
filters:
- or:
- delta: 1.0
- throttle: 10s
- platform: template
id: "p1powerproducedl3"
name: "Actual Power Produced L3"
unit_of_measurement: W
accuracy_decimals: 0
filters:
- or:
- delta: 1.0
- throttle: 10s
- platform: template
id: "p1voltagel1"
name: "Actual Voltage L1"
accuracy_decimals: 1
filters:
- or:
- delta: 1.0
- throttle: 10s
- platform: template
id: "p1voltagel2"
name: "Actual Voltage L2"
accuracy_decimals: 1
filters:
- or:
- delta: 1.0
- throttle: 10s
- platform: template
id: "p1voltagel3"
name: "Actual Voltage L3"
accuracy_decimals: 1
filters:
- or:
- delta: 1.0
- throttle: 10s
- platform: template
id: "p1currentl1"
name: "Actual Current L1"
accuracy_decimals: 0
filters:
- or:
- delta: 1.0
- throttle: 10s
- platform: template
id: "p1currentl2"
name: "Actual Current L2"
accuracy_decimals: 0
filters:
- or:
- delta: 1.0
- throttle: 10s
- platform: template
id: "p1currentl3"
name: "Actual Current L3"
accuracy_decimals: 0
filters:
- or:
- delta: 1.0
- throttle: 10s
custom_component:
id: dsmr
lambda: |-
auto p1sensor = new UARTP1ReaderComponent(
id(p1uart), id(p1version), id(p1timestamp), id(p1electricitytariff),
id(p1electricityconsumedlowtariff), id(p1electricityconsumedhightariff),
id(p1electricityproducedlowtariff), id(p1electricityproducedhightariff),
id(p1actualpowerconsumed), id(p1actualpowerproduced), id(p1gastimestamp),
id(p1gasconsumed), id(p1powerconsumedl1), id(p1powerconsumedl2), id(p1powerconsumedl3),
id(p1powerproducedl1), id(p1powerproducedl2), id(p1powerproducedl3),
id(p1voltagel1), id(p1voltagel2), id(p1voltagel3), id(p1currentl1), id(p1currentl2), id(p1currentl3)
);
App.register_component(p1sensor);
return {p1sensor};