-
Notifications
You must be signed in to change notification settings - Fork 114
/
Copy path6chan_energy_meter_house_solar_ha_kwh.yaml
233 lines (217 loc) · 6.17 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
# 6 Channel Example Config for Split Single Phase whole house, solar, and 2 other circuits
# See all options at https://esphome.io/components/sensor/atm90e32.html
substitutions:
# Change the disp_name to something you want
disp_name: Energy Meter
friendly_name: CircuitSetup Energy Meter
# Interval of how often the power data is updated
update_time: 10s
# Change current_cal to the corresponding CT's that you're using
# If different CTs per current channel, remove or change "${current_cal}" from
# "gain_ct" below and replace with the CT calibration number respectively
# 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'
# This only needs to be changed if you're using something other than the
# Jameco 9VAC Transformer:
voltage_cal: '7305'
packages:
common: github://CircuitSetup/Expandable-6-Channel-ESP32-Energy-Meter/Software/ESPHome/6chan_common.yaml
sensor:
#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