-
Notifications
You must be signed in to change notification settings - Fork 0
/
veitur-meter-reader.yaml.example
265 lines (252 loc) · 7.17 KB
/
veitur-meter-reader.yaml.example
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
substitutions:
name: "veitur-meter"
esphome:
name: "${name}"
# Use friendly name for sensor prefixes
friendly_name: "${name}"
includes:
- veitur-meter-reader.h
# Automatically add the mac address to the name
name_add_mac_suffix: true
project:
name: "esphome.${name}"
version: "1.0"
esp8266:
board: d1
# API is a requirement of the dashboard import.
api:
# OTA is required for Over-the-Air updating
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Optional static IP
# manual_ip:
# static_ip: !secret wifi_ipaddress
# gateway: !secret wifi_gateway
# subnet: !secret wifi_subnet
ap:
ssid: "${name}"
password: "123456789"
captive_portal:
# Enable logging
logger:
level: DEBUG # or INFO
baud_rate: 0 # disable logging over uart
esp8266_store_log_strings_in_flash: false # Avoid flash wear and tear
# Create a switch to trigger P1 data request from meter
switch:
- platform: gpio
name: "P1 Request Trigger"
pin: D5
id: p1_request
# Request data every 10s
interval:
- interval: 10s
then:
- switch.turn_on: p1_request
- delay: 50ms
- switch.turn_off: p1_request
uart:
id: uart_bus
rx_pin: D7
rx_buffer_size: 3072
baud_rate: 9600
data_bits: 7
parity: NONE
stop_bits: 1
sensor:
- platform: uptime
name: "Uptime"
- platform: wifi_signal
name: "Wi-Fi Signal"
update_interval: 60s
- platform: custom
lambda: |-
auto meter_sensor = new MeterReader(id(uart_bus));
App.register_component(meter_sensor);
return {
meter_sensor->cumulativeActiveImport,
meter_sensor->cumulativeActiveExport,
meter_sensor->cumulativeReactiveImport,
meter_sensor->cumulativeReactiveExport,
meter_sensor->momentaryActiveImport,
meter_sensor->momentaryActiveExport,
meter_sensor->momentaryReactiveImport,
meter_sensor->momentaryReactiveExport,
meter_sensor->momentaryActiveImportL1,
meter_sensor->momentaryActiveExportL1,
meter_sensor->momentaryActiveImportL2,
meter_sensor->momentaryActiveExportL2,
meter_sensor->momentaryActiveImportL3,
meter_sensor->momentaryActiveExportL3,
meter_sensor->momentaryReactiveImportL1,
meter_sensor->momentaryReactiveExportL1,
meter_sensor->momentaryReactiveImportL2,
meter_sensor->momentaryReactiveExportL2,
meter_sensor->momentaryReactiveImportL3,
meter_sensor->momentaryReactiveExportL3,
meter_sensor->voltageL1,
meter_sensor->voltageL2,
meter_sensor->voltageL3,
meter_sensor->currentL1,
meter_sensor->currentL2,
meter_sensor->currentL3,
meter_sensor->hotWaterVolume,
meter_sensor->hotWaterFlowRate,
meter_sensor->inletWaterTemperature,
meter_sensor->outletWaterTemperature,
meter_sensor->energyContentVolume,
meter_sensor->energyFlowRate,
meter_sensor->meterId
};
sensors:
- name: "Cumulative Active Import"
unit_of_measurement: kWh
accuracy_decimals: 3
state_class: "total_increasing"
device_class: "energy"
- name: "Cumulative Active Export"
unit_of_measurement: kWh
accuracy_decimals: 3
state_class: "total_increasing"
device_class: "energy"
- name: "Cumulative Reactive Import"
unit_of_measurement: kvarh
accuracy_decimals: 3
- name: "Cumulative Reactive Export"
unit_of_measurement: kvarh
accuracy_decimals: 3
- name: "Momentary Active Import"
unit_of_measurement: kW
accuracy_decimals: 3
state_class: "measurement"
device_class: "power"
- name: "Momentary Active Export"
unit_of_measurement: kW
accuracy_decimals: 3
state_class: "measurement"
device_class: "power"
- name: "Momentary Reactive Import"
unit_of_measurement: kvar
accuracy_decimals: 3
- name: "Momentary Reactive Export"
unit_of_measurement: kvar
accuracy_decimals: 3
- name: "Momentary Active Import Phase 1"
unit_of_measurement: kW
accuracy_decimals: 3
state_class: "measurement"
device_class: "power"
- name: "Momentary Active Export Phase 1"
unit_of_measurement: kW
accuracy_decimals: 3
state_class: "measurement"
device_class: "power"
- name: "Momentary Active Import Phase 2"
unit_of_measurement: kW
accuracy_decimals: 3
state_class: "measurement"
device_class: "power"
- name: "Momentary Active Export Phase 2"
unit_of_measurement: kW
accuracy_decimals: 3
state_class: "measurement"
device_class: "power"
- name: "Momentary Active Import Phase 3"
unit_of_measurement: kW
accuracy_decimals: 3
state_class: "measurement"
device_class: "power"
- name: "Momentary Active Export Phase 3"
unit_of_measurement: kW
accuracy_decimals: 3
state_class: "measurement"
device_class: "power"
- name: "Momentary Reactive Import Phase 1"
unit_of_measurement: kvar
accuracy_decimals: 3
- name: "Momentary Reactive Export Phase 1"
unit_of_measurement: kvar
accuracy_decimals: 3
- name: "Momentary Reactive Import Phase 2"
unit_of_measurement: kvar
accuracy_decimals: 3
- name: "Momentary Reactive Export Phase 2"
unit_of_measurement: kvar
accuracy_decimals: 3
- name: "Momentary Reactive Import Phase 3"
unit_of_measurement: kvar
accuracy_decimals: 3
- name: "Momentary Reactive Export Phase 3"
unit_of_measurement: kvar
accuracy_decimals: 3
- name: "Voltage Phase 1"
unit_of_measurement: V
accuracy_decimals: 3
state_class: "measurement"
device_class: "voltage"
- name: "Voltage Phase 2"
unit_of_measurement: V
accuracy_decimals: 3
state_class: "measurement"
device_class: "voltage"
- name: "Voltage Phase 3"
unit_of_measurement: V
accuracy_decimals: 3
state_class: "measurement"
device_class: "voltage"
- name: "Current Phase 1"
unit_of_measurement: A
accuracy_decimals: 3
state_class: "measurement"
device_class: "current"
- name: "Current Phase 2"
unit_of_measurement: A
accuracy_decimals: 3
state_class: "measurement"
device_class: "current"
- name: "Current Phase 3"
unit_of_measurement: A
accuracy_decimals: 3
state_class: "measurement"
device_class: "current"
- name: "Hot Water Volume"
unit_of_measurement: m³
accuracy_decimals: 3
state_class: "total_increasing"
device_class: "water"
- name: "Hot Water Flow Rate"
unit_of_measurement: m³/h
accuracy_decimals: 3
state_class: "measurement"
- name: "Hot Water Inlet Temperature"
unit_of_measurement: °C
accuracy_decimals: 1
state_class: "measurement"
- name: "Hot Water Outlet Temperature"
unit_of_measurement: °C
accuracy_decimals: 1
state_class: "measurement"
- name: "Hot Water Energy Content Volume"
unit_of_measurement: kWh
accuracy_decimals: 3
state_class: "measurement"
- name: "Hot Water Energy Flow Rate"
unit_of_measurement: kW
accuracy_decimals: 3
state_class: "measurement"
- name: "Meter ID"
text_sensor:
- platform: wifi_info
ip_address:
name: "IP Address"
ssid:
name: "Wi-Fi SSID"
bssid:
name: "Wi-Fi BSSID"
mac_address:
name: Mac Address
- platform: version
name: "ESPHome Version"
hide_timestamp: false