-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue2-main-panel.yaml
335 lines (301 loc) · 13.5 KB
/
vue2-main-panel.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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
substitutions:
devicename: "vue2-main-panel"
friendly_name: Vue2 Main Panel
timezone: America/Los_Angeles
devicetype: Emporia Vue 2
uptime_refresh: 60s
wifi_refresh: 120s
static_ip: 192.168.50.121
gateway: 192.168.50.1
subnet: 255.255.254.0
# Name all ciruits and set phases
name_circuit_1: "02-Generator Feed A"
phase_circuit_1: phase_a
name_circuit_2: "04-Generator Feed B"
phase_circuit_2: phase_b
name_circuit_3: "06-Feed to Inverter A"
phase_circuit_3: phase_a
name_circuit_4: "08-Feed to Inverter B"
phase_circuit_4: phase_b
name_circuit_5: "10-Shop A"
phase_circuit_5: phase_a
name_circuit_6: "12-Shop B"
phase_circuit_6: phase_b
name_circuit_7: "14/16-Chargeverter A/B"
phase_circuit_7: phase_a
name_circuit_8: "18-Dishwasher"
phase_circuit_8: phase_a
name_circuit_9: "20-Master Bath Heat"
phase_circuit_9: phase_a
name_circuit_10: "26/28-Tess 2 A/B"
phase_circuit_10: phase_a
name_circuit_11: "17-Garage Outlets"
phase_circuit_11: phase_a
name_circuit_12: "13/15-Tess 1 A/B"
phase_circuit_12: phase_a
name_circuit_13: "Heat Pump"
phase_circuit_13: phase_a
name_circuit_14: "Hot Tub"
phase_circuit_14: phase_a
name_circuit_15: "Not Used"
phase_circuit_15: phase_a
name_circuit_16: "Not Used"
phase_circuit_16: phase_a
packages:
wifi: !include .base-staticip-wifi.yaml
web_server: !include .base-web_server.yaml
update_sensors: !include .base-uptime-sensors.yaml
esphome:
name: ${devicename}
friendly_name: ${friendly_name}
comment: ${devicetype}
api: #Enable API
encryption:
key: !secret hass_encryption_key
ota: #Enable OTA updates
password: !secret ota_password
external_components:
- source: github://emporia-vue-local/esphome@dev
components:
- emporia_vue
# - source: github://pr#3500
# components:
# # list all components modified by this Pull Request here
# - web_server
# - web_server_idf
# - web_server_base
# - captive_portal
esp32:
board: esp32dev
framework:
type: esp-idf
version: recommended
# Enable logging
logger:
preferences:
# the default of 1min is far too short--flash chip is rated
# for approx 100k writes.
flash_write_interval: "4h"
output:
- platform: ledc
pin: GPIO12
id: buzzer
light:
- platform: status_led
name: "D3_LED"
pin: 23
restore_mode: ALWAYS_ON
i2c:
sda: 21
scl: 22
scan: false
frequency: 200kHz # recommended range is 50-200kHz
id: i2c_a
time:
- platform: sntp
id: my_time
timezone: $timezone
on_time_sync:
then:
- logger.log: "Synchronized system clock"
# these are called references in YAML. They allow you to reuse
# this configuration in each sensor, while only defining it once
.defaultfilters:
- &moving_avg
# we capture a new sample every 0.24 seconds, so the time can
# be calculated from the number of samples as n * 0.24.
sliding_window_moving_average:
# we average over the past 2.88 seconds
window_size: 12
# we push a new value every 1.44 seconds
send_every: 6
- &invert
# invert and filter out any values below 0.
lambda: 'return max(-x, 0.0f);'
- &pos
# filter out any values below 0.
lambda: 'return max(x, 0.0f);'
- &abs
# take the absolute value of the value
lambda: 'return abs(x);'
sensor:
- platform: emporia_vue
i2c_id: i2c_a
phases:
- id: phase_a # Verify that this specific phase/leg is connected to correct input wire color on device listed below
input: BLACK # Vue device wire color
calibration: 0.02275 # 0.022 is used as the default as starting point but may need adjusted to ensure accuracy
# To calculate new calibration value use the formula <in-use calibration value> * <accurate voltage> / <reporting voltage>
voltage:
name: "Phase A Voltage"
id: phase_a_voltage
filters: [*moving_avg, *pos]
frequency:
name: "Phase A Frequency"
filters: [*moving_avg, *pos]
- id: phase_b # Verify that this specific phase/leg is connected to correct input wire color on device listed below
input: RED # Vue device wire color
calibration: 0.0215 # 0.022 is used as the default as starting point but may need adjusted to ensure accuracy
# To calculate new calibration value use the formula <in-use calibration value> * <accurate voltage> / <reporting voltage>
voltage:
name: "Phase B Voltage"
id: phase_b_voltage
filters: [*moving_avg, *pos]
phase_angle:
name: "Phase B Phase Angle"
filters: [*moving_avg, *pos]
ct_clamps:
- phase_id: phase_a
input: "A" # Verify the CT going to this device input also matches the phase/leg
power:
name: "Phase A Power"
id: phase_a_power
device_class: power
filters: [*moving_avg, *pos]
- phase_id: phase_b
input: "B" # Verify the CT going to this device input also matches the phase/leg
power:
name: "Phase B Power"
id: phase_b_power
device_class: power
filters: [*moving_avg, *pos]
# Pay close attention to set the phase_id for each breaker by matching it to the phase/leg it connects to in the panel
- { phase_id: $phase_circuit_1, input: "1", power: { name: "$name_circuit_1 Power", id: cir1, filters: [ *moving_avg, *pos ] } }
- { phase_id: $phase_circuit_2, input: "2", power: { name: "$name_circuit_2 Power", id: cir2, filters: [ *moving_avg, *pos ] } }
- { phase_id: $phase_circuit_3, input: "3", power: { name: "$name_circuit_3 Power", id: cir3, filters: [ *moving_avg, *pos ] } }
- { phase_id: $phase_circuit_4, input: "4", power: { name: "$name_circuit_4 Power", id: cir4, filters: [ *moving_avg, *pos ] } }
#- { phase_id: $phase_circuit_5, input: "5", power: { name: "$name_circuit_5 Power", id: cir5, filters: [ *moving_avg, *pos, multiply: 2 ] } }
- { phase_id: $phase_circuit_5, input: "5", power: { name: "$name_circuit_5 Power", id: cir5, filters: [ *moving_avg, *pos ] } }
- { phase_id: $phase_circuit_6, input: "6", power: { name: "$name_circuit_6 Power", id: cir6, filters: [ *moving_avg, *pos ] } }
- { phase_id: $phase_circuit_7, input: "7", power: { name: "$name_circuit_7 Power", id: cir7, filters: [ *moving_avg, *pos, multiply: 2 ] } }
- { phase_id: $phase_circuit_8, input: "8", power: { name: "$name_circuit_8 Power", id: cir8, filters: [ *moving_avg, *pos ] } }
- { phase_id: $phase_circuit_9, input: "9", power: { name: "$name_circuit_9 Power", id: cir9, filters: [ *moving_avg, *pos ] } }
- { phase_id: $phase_circuit_10, input: "10", power: { name: "$name_circuit_10 Power", id: cir10, filters: [ *moving_avg, *pos, multiply: 2 ] } }
- { phase_id: $phase_circuit_11, input: "11", power: { name: "$name_circuit_11 Power", id: cir11, filters: [ *moving_avg, *pos ] } }
- { phase_id: $phase_circuit_12, input: "12", power: { name: "$name_circuit_12 Power", id: cir12, filters: [ *moving_avg, *pos, multiply: 2 ] } }
- { phase_id: $phase_circuit_13, input: "13", power: { name: "$name_circuit_13 Power", id: cir13, filters: [ *moving_avg, *pos, multiply: 2 ] } }
- { phase_id: $phase_circuit_14, input: "14", power: { name: "$name_circuit_14 Power", id: cir14, filters: [ *moving_avg, *pos, multiply: 2 ] } }
- { phase_id: $phase_circuit_15, input: "15", power: { name: "$name_circuit_15 Power", id: cir15, filters: [ *moving_avg, *pos ] } }
- { phase_id: $phase_circuit_16, input: "16", power: { name: "$name_circuit_16 Power", id: cir16, filters: [ *moving_avg, *pos ] } }
- platform: template
name: "Total Power"
lambda: return id(phase_a_power).state + id(phase_b_power).state;
update_interval: 2.88s
id: total_power
unit_of_measurement: "W"
- platform: total_daily_energy
name: "Total Daily Energy"
power_id: total_power
unit_of_measurement: 'kWh'
accuracy_decimals: 3
filters:
- multiply: 0.001
- platform: template
name: "Total Voltage"
lambda: return id(phase_a_voltage).state + id(phase_b_voltage).state;
unit_of_measurement: "V"
# Sub Panel Combined Power
# - platform: template
# name: "Sub Panel Total Power"
# lambda: return id(cir1).state + id(cir2).state;
# update_interval: 2.88s
# id: sub_panel_total_power
# unit_of_measurement: "W"
# - platform: total_daily_energy
# name: "Sub Panel Total Daily Energy"
# power_id: sub_panel_total_power
# accuracy_decimals: 0
# Tesla 1 combined Power
# - platform: template
# name: "Tesla 1 Total Power"
# lambda: return id(cir3).state + id(cir4).state;
# update_interval: 2.88s
# id: tesla_1_total_power
# unit_of_measurement: "W"
# - platform: total_daily_energy
# name: "Tesla 1 Total Daily Energy"
# power_id: tesla_1_total_power
# accuracy_decimals: 0
# Heat Pump combined Power
# - platform: template
# name: "Heat Pump Total Power"
# lambda: return id(cir5).state + id(cir6).state + id(cir13).state;
# update_interval: 2.88s
# id: heat_pump_total_power
# unit_of_measurement: "W"
# - platform: total_daily_energy
# name: "Heat Pump Total Daily Energy"
# power_id: heat_pump_total_power
# accuracy_decimals: 0
# Shop combined Power
- platform: template
name: "Shop Total Power"
lambda: return id(cir5).state + id(cir6).state;
update_interval: 2.88s
id: shop_total_power
unit_of_measurement: "W"
- platform: total_daily_energy
name: "Shop Total Daily Energy"
power_id: shop_total_power
unit_of_measurement: 'kWh'
accuracy_decimals: 3
filters:
- multiply: 0.001
# Tesla 2 combined Power
# - platform: template
# name: "Tesla 2 Total Power"
# lambda: return id(cir15).state + id(cir16).state;
# update_interval: 2.88s
# id: tesla_2_total_power
# unit_of_measurement: "W"
# - platform: total_daily_energy
# name: "Tesla 2 Total Daily Energy"
# power_id: tesla_2_total_power
# accuracy_decimals: 0
- platform: template
name: "Balance Power"
lambda: !lambda |-
return max(0.0f, id(total_power).state -
id( cir1).state -
id( cir2).state -
id( cir3).state -
id( cir4).state -
id( cir5).state -
id( cir6).state -
id( cir7).state -
id( cir8).state -
id( cir9).state -
id(cir10).state -
id(cir11).state -
id(cir12).state -
id(cir13).state -
id(cir14).state -
id(cir15).state -
id(cir16).state);
update_interval: 2.88s
id: balance_power
unit_of_measurement: "W"
- platform: total_daily_energy
name: "Balance Daily Energy"
power_id: balance_power
unit_of_measurement: 'kWh'
accuracy_decimals: 3
filters:
# Multiplication factor from W to kW is 0.001
- multiply: 0.001
- { power_id: cir1, platform: total_daily_energy, accuracy_decimals: 3, name: "$name_circuit_1 Daily Energy", unit_of_measurement: "kWh", filters: [ multiply: 0.001] }
- { power_id: cir2, platform: total_daily_energy, accuracy_decimals: 3, name: "$name_circuit_2 Daily Energy", unit_of_measurement: "kWh", filters: [ multiply: 0.001] }
- { power_id: cir3, platform: total_daily_energy, accuracy_decimals: 3, name: "$name_circuit_3 Daily Energy", unit_of_measurement: "kWh", filters: [ multiply: 0.001] }
- { power_id: cir4, platform: total_daily_energy, accuracy_decimals: 3, name: "$name_circuit_4 Daily Energy", unit_of_measurement: "kWh", filters: [ multiply: 0.001] }
- { power_id: cir5, platform: total_daily_energy, accuracy_decimals: 3, name: "$name_circuit_5 Daily Energy", unit_of_measurement: "kWh", filters: [ multiply: 0.001] }
- { power_id: cir6, platform: total_daily_energy, accuracy_decimals: 3, name: "$name_circuit_6 Daily Energy", unit_of_measurement: "kWh", filters: [ multiply: 0.001] }
- { power_id: cir7, platform: total_daily_energy, accuracy_decimals: 3, name: "$name_circuit_7 Daily Energy", unit_of_measurement: "kWh", filters: [ multiply: 0.001] }
- { power_id: cir8, platform: total_daily_energy, accuracy_decimals: 3, name: "$name_circuit_8 Daily Energy", unit_of_measurement: "kWh", filters: [ multiply: 0.001] }
- { power_id: cir9, platform: total_daily_energy, accuracy_decimals: 3, name: "$name_circuit_9 Daily Energy", unit_of_measurement: "kWh", filters: [ multiply: 0.001] }
- { power_id: cir10, platform: total_daily_energy, accuracy_decimals: 3, name: "$name_circuit_10 Daily Energy", unit_of_measurement: "kWh", filters: [ multiply: 0.001] }
- { power_id: cir11, platform: total_daily_energy, accuracy_decimals: 3, name: "$name_circuit_11 Daily Energy", unit_of_measurement: "kWh", filters: [ multiply: 0.001] }
- { power_id: cir12, platform: total_daily_energy, accuracy_decimals: 3, name: "$name_circuit_12 Daily Energy", unit_of_measurement: "kWh", filters: [ multiply: 0.001] }
- { power_id: cir13, platform: total_daily_energy, accuracy_decimals: 3, name: "$name_circuit_13 Daily Energy", unit_of_measurement: "kWh", filters: [ multiply: 0.001] }
- { power_id: cir14, platform: total_daily_energy, accuracy_decimals: 3, name: "$name_circuit_14 Daily Energy", unit_of_measurement: "kWh", filters: [ multiply: 0.001] }
- { power_id: cir15, platform: total_daily_energy, accuracy_decimals: 3, name: "$name_circuit_15 Daily Energy", unit_of_measurement: "kWh", filters: [ multiply: 0.001] }
- { power_id: cir16, platform: total_daily_energy, accuracy_decimals: 3, name: "$name_circuit_16 Daily Energy", unit_of_measurement: "kWh", filters: [ multiply: 0.001] }