-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemporia-vue2.yaml
More file actions
317 lines (291 loc) · 10.8 KB
/
emporia-vue2.yaml
File metadata and controls
317 lines (291 loc) · 10.8 KB
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
substitutions:
device_name: emporia-vue-2
friendly_name: Emporia Vue 2
packages:
common: !include .common.yaml
external_components:
- source: github://emporia-vue-local/esphome@dev
components:
- emporia_vue
esp32:
board: esp32dev
framework:
type: esp-idf
version: recommended
logger:
level: INFO
preferences:
# the default of 1min is far too short--flash chip is rated
# for approx 100k writes.
flash_write_interval: "48h"
i2c:
sda: 21
scl: 22
scan: false
# frequency: 200kHz # recommended range is 50-200kHz
frequency: 400kHz # recommended range is 50-200kHz (Fixes I2C error 3)
timeout: 1ms
id: i2c_a
time:
- platform: sntp
id: my_time
# these are called references in YAML. They allow you to reuse
# this configuration in each sensor, while only defining it once
.defaultfilters:
- &throttle_avg
# average all raw readings together over a 5 second span before publishing
throttle_average: 5s
- &throttle_time
# only send the most recent measurement every 5 seconds
throttle: 5s
- &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: RED # Vue device wire color
calibration: 0.02127 # 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"
filters: [*throttle_avg, *pos]
- id: phase_b # 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.02331 # 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"
filters: [*throttle_avg, *pos]
ct_clamps:
- phase_id: phase_a
input: "A" # Verify the CT going to this device input also matches the phase/leg
power:
id: phase_a_power
device_class: power
filters: [*pos]
- phase_id: phase_b
input: "B" # Verify the CT going to this device input also matches the phase/leg
power:
id: phase_b_power
device_class: power
filters: [*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
#MiniSplit
- {
phase_id: phase_a,
input: "1",
power:
{ id: cir1, filters: [*pos] },
}
#MiniSplit
- {
phase_id: phase_b,
input: "2",
power:
{ id: cir2, filters: [*pos] },
}
# Fridge
- {
phase_id: phase_a,
input: "3",
power:
{id: cir3, filters: [*pos] },
}
# Septic Pump
- {
phase_id: phase_b,
input: "4",
power:
{ id: cir4, filters: [*pos] },
}
# Water Heater
- {
phase_id: phase_a,
input: "5",
power:
{ id: cir5, filters: [*pos] },
}
# Water Heater
- {
phase_id: phase_b,
input: "6",
power:
{ id: cir6, filters: [*pos] },
}
# AC Condensor
- {
phase_id: phase_b,
input: "7",
power:
{ id: cir7, filters: [*pos] },
}
# AC Condensor
- {
phase_id: phase_a,
input: "8",
power:
{ id: cir8, filters: [*pos] },
}
# AC Blower
- {
phase_id: phase_b,
input: "9",
power:
{ id: cir9, filters: [*pos] },
}
# AC Blower
- {
phase_id: phase_a,
input: "10",
power:
{
id: cir10,
filters: [*pos],
},
}
# Pool
- {
phase_id: phase_a,
input: "11",
power:
{
id: cir11,
filters: [*pos],
},
}
# Pool
- {
phase_id: phase_b,
input: "12",
power:
{
id: cir12,
filters: [*pos],
},
}
- {
phase_id: phase_a,
input: "13",
power:
{
id: cir13,
filters: [*pos],
},
}
- {
phase_id: phase_b,
input: "14",
power:
{
id: cir14,
filters: [*pos],
},
}
- {
phase_id: phase_a,
input: "15",
power:
{
id: cir15,
filters: [*pos],
},
}
- {
phase_id: phase_b,
input: "16",
power:
{
id: cir16,
filters: [*pos],
},
}
on_update:
then:
- component.update: total_power
- component.update: balance_power
- { platform: copy, name: "Phase A Power", source_id: phase_a_power, filters: *throttle_avg }
- { platform: copy, name: "Phase B Power", source_id: phase_b_power, filters: *throttle_avg }
- { platform: copy, name: "Circuit 1 Power", source_id: cir1, filters: *throttle_avg }
- { platform: copy, name: "Circuit 2 Power", source_id: cir2, filters: *throttle_avg }
- { platform: copy, name: "Circuit 3 Power", source_id: cir3, filters: *throttle_avg }
- { platform: copy, name: "Circuit 4 Power", source_id: cir4, filters: *throttle_avg }
- { platform: copy, name: "Circuit 5 Power", source_id: cir5, filters: *throttle_avg }
- { platform: copy, name: "Circuit 6 Power", source_id: cir6, filters: *throttle_avg }
- { platform: copy, name: "Circuit 7 Power", source_id: cir7, filters: *throttle_avg }
- { platform: copy, name: "Circuit 8 Power", source_id: cir8, filters: *throttle_avg }
- { platform: copy, name: "Circuit 9 Power", source_id: cir9, filters: *throttle_avg }
- { platform: copy, name: "Circuit 10 Power", source_id: cir10, filters: *throttle_avg }
- { platform: copy, name: "Circuit 11 Power", source_id: cir11, filters: *throttle_avg }
- { platform: copy, name: "Circuit 12 Power", source_id: cir12, filters: *throttle_avg }
- { platform: copy, name: "Circuit 13 Power", source_id: cir13, filters: *throttle_avg }
- { platform: copy, name: "Circuit 14 Power", source_id: cir14, filters: *throttle_avg }
- { platform: copy, name: "Circuit 15 Power", source_id: cir15, filters: *throttle_avg }
- { platform: copy, name: "Circuit 16 Power", source_id: cir16, filters: *throttle_avg }
- platform: template
lambda: return id(phase_a_power).state + id(phase_b_power).state;
update_interval: never
id: total_power
device_class: power
state_class: measurement
unit_of_measurement: "W"
filters: *throttle_avg
- platform: total_daily_energy
name: "Total Daily Energy"
power_id: total_power
accuracy_decimals: 0
restore: false
filters: *throttle_time
- 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: never
id: balance_power
device_class: power
state_class: measurement
unit_of_measurement: "W"
filters: *throttle_avg
- platform: total_daily_energy
name: "Balance Daily Energy"
power_id: balance_power
accuracy_decimals: 0
restore: false
filters: *throttle_time
- { power_id: cir1, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 1 Daily Energy", filters: *throttle_time }
- { power_id: cir2, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 2 Daily Energy", filters: *throttle_time }
- { power_id: cir3, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 3 Daily Energy", filters: *throttle_time }
- { power_id: cir4, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 4 Daily Energy", filters: *throttle_time }
- { power_id: cir5, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 5 Daily Energy", filters: *throttle_time }
- { power_id: cir6, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 6 Daily Energy", filters: *throttle_time }
- { power_id: cir7, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 7 Daily Energy", filters: *throttle_time }
- { power_id: cir8, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 8 Daily Energy", filters: *throttle_time }
- { power_id: cir9, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 9 Daily Energy", filters: *throttle_time }
- { power_id: cir10, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 10 Daily Energy", filters: *throttle_time }
- { power_id: cir11, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 11 Daily Energy", filters: *throttle_time }
- { power_id: cir12, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 12 Daily Energy", filters: *throttle_time }
- { power_id: cir13, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 13 Daily Energy", filters: *throttle_time }
- { power_id: cir14, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 14 Daily Energy", filters: *throttle_time }
- { power_id: cir15, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 15 Daily Energy", filters: *throttle_time }
- { power_id: cir16, platform: total_daily_energy, accuracy_decimals: 0, restore: false, name: "Circuit 16 Daily Energy", filters: *throttle_time }