-
Notifications
You must be signed in to change notification settings - Fork 104
/
6chan_energy_meter_house_solar_ha_kwh.yaml
275 lines (250 loc) · 6.59 KB
/
6chan_energy_meter_house_solar_ha_kwh.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
# 6 Channel Example Config for Split Single Phase whole house, solar, and 2 other circuits
substitutions:
# Change the disp_name to something you want
disp_name: Energy Meter
friendly_name: CircuitSetup Energy Meter
# Interval of how often the power is updated
update_time: 10s
# Current Transformers:
# 20A/25mA SCT-006: 11143
# 30A/1V SCT-013-030: 8650
# 50A/1V SCT-013-050: 15420
# 50A/16.6mA SCT-010: 41334
# 80A/26.6mA SCT-010: 41660
# 100A/50ma SCT-013-000: 27518
# 120A/40mA: SCT-016: 41787
# 200A/100mA SCT-024: 27518
# 200A/50mA SCT-024: 55036
house_current_cal: '27518'
solar_current_cal: '27518'
current_cal: '27518'
# Jameco 9VAC Transformer:
# For meter versions:
# >= v1.3: 7305
voltage_cal: '7305'
esphome:
name: energy-meter
friendly_name: "${friendly_name}"
project:
name: circuitsetup.6c-energy-meter-main
version: "1.4.1"
esp32:
board: nodemcu-32s
wifi:
# Set up a wifi access point
ap: {}
captive_portal:
esp32_improv:
# Sets up Bluetooth LE to allow the user
# to provision wifi credentials to the device.
authorizer: none
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
- platform: esphome
dashboard_import:
package_import_url: github://circuitsetup/Expandable-6-Channel-ESP32-Energy-Meter/Software/ESPHome/6chan_energy_meter_main_board.yaml@master
import_full_config: true
spi:
clk_pin: 18
miso_pin: 19
mosi_pin: 23
sensor:
- platform: wifi_signal
name: ${disp_name} WiFi
update_interval: 60s
#IC1
- platform: atm90e32
cs_pin: 5
#CT1
phase_a:
voltage:
name: ${disp_name} Volts
id: HouseL1Volts
accuracy_decimals: 1
current:
name: ${disp_name} House L1 Amps
id: HouseL1Amps
power:
name: ${disp_name} House L1 Watts
id: HouseL1Watts
gain_voltage: ${voltage_cal}
gain_ct: ${house_current_cal}
#CT2
phase_b:
current:
name: ${disp_name} Solar L1 Amps
id: SolarL1Amps
power:
name: ${disp_name} Solar L1 Watts
id: SolarL1Watts
gain_voltage: ${voltage_cal}
gain_ct: ${solar_current_cal}
#CT3
phase_c:
current:
name: ${disp_name} Hot Water Amps
id: HotWaterAmps
power:
name: ${disp_name} Hot Water Watts
id: HotWaterWatts
gain_voltage: ${voltage_cal}
gain_ct: ${current_cal}
frequency:
name: ${disp_name} Freq
line_frequency: 60Hz
gain_pga: 1X
update_interval: ${update_time}
#IC2
- platform: atm90e32
cs_pin: 4
#CT4
phase_a:
current:
name: ${disp_name} Dryer Amps
id: DryerAmps
power:
name: ${disp_name} Dryer Watts
id: DryerWatts
gain_voltage: ${voltage_cal}
gain_ct: ${current_cal}
#CT5
phase_b:
current:
name: ${disp_name} Solar L2 Amps
id: SolarL2Amps
power:
name: ${disp_name} CT5 Watts
id: SolarL2Watts
gain_voltage: ${voltage_cal}
gain_ct: ${solar_current_cal}
#CT6
phase_c:
current:
name: ${disp_name} House L2 Amps
id: HouseL2Amps
power:
name: ${disp_name} House L2 Watts
id: HouseL2Watts
gain_voltage: ${voltage_cal}
gain_ct: ${house_current_cal}
line_frequency: 60Hz
gain_pga: 1X
update_interval: ${update_time}
#Total House Amps
- platform: template
name: ${disp_name} Total House Amps
id: totalHouseAmps
lambda: return id(HouseL1Amps).state + id(HouseL2Amps).state ;
accuracy_decimals: 2
unit_of_measurement: A
device_class: current
update_interval: ${update_time}
#Total House Watts
- platform: template
name: ${disp_name} Total House Watts
id: totalHouseWatts
lambda: return id(HouseL1Watts).state + id(HouseL2Watts).state ;
accuracy_decimals: 1
unit_of_measurement: W
device_class: power
update_interval: ${update_time}
#Total House Watts Negative
- platform: template
name: ${disp_name} Total House Return To Grid Watts
id: returnToGridWatts
lambda: |-
if (id(totalHouseWatts).state > 0) {
return 0;
} else {
return abs(id(totalHouseWatts).state) ;
}
accuracy_decimals: 1
unit_of_measurement: W
device_class: power
update_interval: ${update_time}
#House Negative kWh (HA Return to Grid)
- platform: total_daily_energy
name: ${disp_name} House Return To Grid kWh
power_id: returnToGridWatts
filters:
- multiply: 0.001
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
#Total House Watts Positive
- platform: template
name: ${disp_name} Total House Positive Watts
id: totalHousePositiveWatts
lambda: |-
if (id(totalHouseWatts).state < 0) {
return 0;
} else {
return id(totalHouseWatts).state ;
}
accuracy_decimals: 1
unit_of_measurement: W
device_class: power
update_interval: ${update_time}
#House positive kWh
- platform: total_daily_energy
name: ${disp_name} House kWh
power_id: totalHousePositiveWatts
filters:
- multiply: 0.001
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
#Total Solar Amps
- platform: template
name: ${disp_name} Total Solar Amps
id: totalSolarAmps
lambda: return id(SolarL1Amps).state + id(SolarL2Amps).state ;
accuracy_decimals: 2
unit_of_measurement: A
device_class: current
update_interval: ${update_time}
#Total Solar Watts
- platform: template
name: ${disp_name} Total Solar Watts
id: totalSolarWatts
lambda: return id(SolarL1Watts).state + id(SolarL2Watts).state ;
accuracy_decimals: 1
unit_of_measurement: W
device_class: power
update_interval: ${update_time}
#Solar kWh
- platform: total_daily_energy
name: ${disp_name} Solar kWh
power_id: totalSolarWatts
filters:
- multiply: 0.001
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
#Individual Hot Water kWh
- platform: total_daily_energy
name: ${disp_name} Hot Water kWh
power_id: HotWaterWatts
filters:
- multiply: 0.001
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
#Individual Dryer kWh
- platform: total_daily_energy
name: ${disp_name} Dryer kWh
power_id: DryerWatts
filters:
- multiply: 0.001
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
switch:
- platform: restart
name: ${disp_name} Restart
time:
- platform: sntp
id: sntp_time