forked from digiblur/digiNRG_ESPHome
-
Notifications
You must be signed in to change notification settings - Fork 0
/
digi_nrg_2chan32.yaml
110 lines (98 loc) · 2.4 KB
/
digi_nrg_2chan32.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
substitutions:
# Change the disp_name to something you want
disp_name: 2C
# Interval of how often the power is updated
update_time: 10s
esphome:
name: digi_nrg_2chan32
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
mqtt:
broker: !secret mqtt_broker
username: !secret mqtt_user
password: !secret mqtt_pass
# Enable logging
logger:
#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
current:
name: ${disp_name} CT1 Amps
id: "ct1Amps"
power:
name: ${disp_name} CT1 Watts
accuracy_decimals: 1
id: "ct1Watts"
# Voltage using a 12VAC power transformer
gain_voltage: 32428
# Current calibration using a 100A/50ma SCT-013-000
gain_ct: 24131
phase_c:
current:
name: ${disp_name} CT2 Amps
id: "ct2Amps"
power:
name: ${disp_name} CT2 Watts
accuracy_decimals: 1
id: "ct2Watts"
# If the wattage is backwards due to the phase 180 degrees from the clamp direction
filters:
- multiply: -1.0
gain_voltage: 32428
gain_ct: 24131
frequency:
name: ${disp_name} Freq
line_frequency: 60Hz
gain_pga: 2X
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
update_interval: ${update_time}
icon: "mdi:flash-circle"
- platform: template
name: ${disp_name} Total Watts
id: "totalWatts"
lambda: return id(ct1Watts).state + id(ct2Watts).state;
accuracy_decimals: 0
unit_of_measurement: W
icon: "mdi:flash-circle"
update_interval: ${update_time}
- platform: total_daily_energy
name: ${disp_name} Total kWh
power_id: totalWatts
filters:
- multiply: 0.001
unit_of_measurement: kWh
time:
- platform: sntp
id: sntp_time
switch:
- platform: restart
name: ${disp_name} Restart