-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathHA-ESPHome_energy_meter_detailed_power.yaml
177 lines (166 loc) · 4.82 KB
/
HA-ESPHome_energy_meter_detailed_power.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
# Currently reactive_power, power_factor, and chip_temperature are only in the dev version of ESPHome
substitutions:
# Change the disp_name to something you want
disp_name: House
# Interval of how often the power is updated
update_time: 10s
# Current transformer calibrations:
# 80A/26.6mA SCT-010: 39571
# 100A/50mA SCT-013: 26315
# 120A/40ma SCT-016: 39473 - default kit CT
# 200A/100mA SCT-024: 26315
# 200A/50mA SCT-024: 52630
current_cal: '39473'
# AC Transformer voltage calibration 9VAC Jameco 157041: 37106
# For Meters >= v1.4 rev3: 3920
voltage_cal: '3920'
esphome:
name: energy_meter
platform: ESP32
board: nodemcu-32s
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_pass
manual_ip:
static_ip: !secret ip_eh_nrgnode_2chan32
gateway: !secret ip_gateway
subnet: !secret ip_subnet
dns1: !secret ip_dns1
# Enable if you want to send this data to an MQTT broker
# mqtt:
# broker: !secret mqtt_broker
# username: !secret mqtt_user
# password: !secret mqtt_pass
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
web_server:
port: 80
spi:
clk_pin: 18
miso_pin: 19
mosi_pin: 23
sensor:
- platform: wifi_signal
name: ${disp_name} WiFi Signal
update_interval: 60s
- platform: atm90e32
cs_pin: 5
phase_a:
voltage:
name: ${disp_name} Volts
accuracy_decimals: 1
unit_of_measurement: V
device_class: voltage
current:
name: ${disp_name} CT1 Amps
id: "ct1Amps"
unit_of_measurement: A
device_class: current
# The max value for current that the meter can output is 65.535. If you expect to measure current over 65A,
# divide the gain_ct by 2 (120A CT) or 4 (200A CT) and multiply the current and power values by 2 or 4 by uncommenting the filter below
# filters:
# - multiply: 2
power:
name: ${disp_name} CT1 Watts
accuracy_decimals: 1
id: "ct1Watts"
unit_of_measurement: W
device_class: power
# filters:
# - multiply: 2
reactive_power:
name: ${disp_name} CT1 Reactive Power
accuracy_decimals: 1
id: "ct1Reactive"
unit_of_measurement: VAR
device_class: reactive_power
# filters:
# - multiply: 2
power_factor:
name: ${disp_name} CT1 Power Factor
device_class: power_factor
gain_voltage: ${voltage_cal}
gain_ct: ${current_cal}
phase_c:
current:
name: ${disp_name} CT2 Amps
id: "ct2Amps"
unit_of_measurement: A
device_class: current
# The max value for current that the meter can output is 65.535. If you expect to measure current over 65A,
# divide the gain_ct by 2 (120A CT) or 4 (200A CT) and multiply the current and power values by 2 or 4 by uncommenting the filter below
# filters:
# - multiply: 2
power:
name: ${disp_name} CT2 Watts
accuracy_decimals: 1
id: "ct2Watts"
unit_of_measurement: W
device_class: power
# filters:
# - multiply: 2
reactive_power:
name: ${disp_name} CT2 Reactive Power
accuracy_decimals: 1
id: "ct2Reactive"
unit_of_measurement: VAR
device_class: reactive_power
# filters:
# - multiply: 2
power_factor:
name: ${disp_name} CT2 Power Factor
device_class: power_factor
gain_voltage: ${voltage_cal}
gain_ct: ${current_cal}
frequency:
name: ${disp_name} Freq
unit_of_measurement: Hz
device_class: frequency
chip_temperature:
name: ${disp_name} Chip Temp
unit_of_measurement: °C
device_class: temperature
line_frequency: 60Hz
gain_pga: 1X
update_interval: ${update_time}
- platform: template
name: ${disp_name} Total Amps
id: "totalAmps"
lambda: return id(ct1Amps).state + id(ct2Amps).state;
accuracy_decimals: 2
unit_of_measurement: A
device_class: current
update_interval: ${update_time}
- platform: template
name: ${disp_name} Total Watts
id: "totalWatts"
lambda: return id(ct1Watts).state + id(ct2Watts).state;
accuracy_decimals: 0
unit_of_measurement: W
device_class: power
update_interval: ${update_time}
- platform: template
name: ${disp_name} Total Reactive Power
id: "totalReactivePower"
lambda: return id(ct1Reactive).state + id(ct2Reactive).state;
accuracy_decimals: 0
unit_of_measurement: VAR
device_class: reactive_power
update_interval: ${update_time}
- platform: total_daily_energy
name: ${disp_name} Total kWh
power_id: totalWatts
filters:
- multiply: 0.001
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
time:
- platform: sntp
id: sntp_time
switch:
- platform: restart
name: ${disp_name} Restart