-
Notifications
You must be signed in to change notification settings - Fork 1
/
energy-meter-1.yaml
217 lines (176 loc) · 4.47 KB
/
energy-meter-1.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
#------------------------------
#-- energy-meter-1.yaml
#-- Mesures de puissance de mes grands consommateurs (cuisinière et charge voiture)
#-- La mesure se fait simplement avec 3x transfos de courant clips avec un ADC i2C et un mini d1
#-- zf230928.1931
#--
# sources:
# Hardware utilisé pour ce projet: https://github.com/zuzu59/esphome_home5/tree/master/0_Projets/Mesure_courant_clip
# EspHome convertisseur ADC ADS1115: https://esphome.io/components/sensor/ads1115.html
# Simulateur électronique: https://www.falstad.com/circuit/
# Le petit transfo clip de courant a un rapport de 25mA à 20A, soit 0.025/20=0.00125 soit encore 1/800
# Donc à 16A, il donnera un courant de 20mA
esphome:
name: energy-meter-1
esp8266:
board: d1_mini
# Configuration WIFI
# On le force sur apzuzu6, plus stable
wifi:
ssid: !secret wifi_ssid_apzuzu6
password: !secret wifi_pass_apzuzu6
# networks:
# - ssid: !secret wifi_ssid_apzuzu7
# - password: !secret wifi_pass_apzuzu7
# - ssid: !secret wifi_ssid_apzuzu6
# - password: !secret wifi_pass_apzuzu6
# - ssid: !secret wifi_ssid_3G_zf
# - password: !secret wifi_pass_3G_zf2
# - ssid: !secret wifi_ssid_3G_zf2
# - password: !secret wifi_pass_3G_zf2
# - ssid: !secret wifi_ssid_3g_s7
# - password: !secret wifi_pass_3g_s7
# - ssid: !secret wifi_ssid_apzuzu6_EXT
# - password: !secret wifi_pass_apzuzu6_EXT
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "energy-meter-1 Fallback"
password: !secret ap_wifi_password
captive_portal:
# Enable logging
logger:
# level: VERBOSE
# Enable Home Assistant API
api:
# password: !secret api_password
encryption:
key: !secret api_encryption_key
# Enable OTA
ota:
password: !secret ota_password
# WEB Server
web_server:
port: 80
i2c:
sda: D2
scl: D1
scan: False
ads1115:
- address: 0x48
# continuous_mode: True
# Définition des Switch's
switch:
- platform: gpio
name: "energy-meter-1 LED"
inverted: True
id: led
pin: D4
- platform: restart
name: "energy-meter-1 Restart"
# Définitions des texts sensors
text_sensor:
- platform: version
name: "energy-meter-1 Version"
- platform: wifi_info
ip_address:
name: energy-meter-1 IP Address
id: wifi_ip
ssid:
name: energy-meter-1 Connected SSID
id: wifi_ssid
# Définitions des sensors
sensor:
- platform: wifi_signal
name: "energy-meter-1 Signal Wi-Fi"
update_interval: 60s
- platform: uptime
name: "energy-meter-1 uptime"
update_interval: 60s
- platform: ads1115
name: "energy-meter-1-A0"
multiplexer: 'A0_GND'
gain: 4.096
accuracy_decimals: 2
update_interval: 15s
unit_of_measurement: "A"
icon: "mdi:flash"
filters:
- calibrate_polynomial:
degree: 3
datapoints:
- 0.17 -> 0.35
- 1.04 -> 1.30
- 2.30 -> 5.13
- 3.25 -> 10.24
- lambda: |-
if (x <= 0.32) {
return 0.0;
} else {
return x;
}
- platform: ads1115
name: "energy-meter-1-A1"
multiplexer: 'A1_GND'
gain: 4.096
accuracy_decimals: 2
update_interval: 15s
unit_of_measurement: "A"
icon: "mdi:flash"
filters:
- calibrate_polynomial:
degree: 3
datapoints:
- 0.06 -> 0.35
- 0.74 -> 1.30
- 2.11 -> 5.13
- 3.00 -> 10.24
- lambda: |-
if (x <= 0.29) {
return 0.0;
} else {
return x;
}
- platform: ads1115
name: "energy-meter-1-A2"
multiplexer: 'A2_GND'
gain: 4.096
accuracy_decimals: 2
update_interval: 15s
unit_of_measurement: "A"
icon: "mdi:flash"
filters:
- calibrate_polynomial:
degree: 3
datapoints:
- 0.07 -> 0.35
- 0.72 -> 1.30
- 2.08 -> 5.13
- 3.00 -> 10.24
- lambda: |-
if (x <= 0.27) {
return 0.0;
} else {
return x;
}
- platform: ads1115
name: "energy-meter-1-A3"
multiplexer: 'A3_GND'
gain: 4.096
accuracy_decimals: 2
update_interval: 15s
unit_of_measurement: "A"
icon: "mdi:flash"
filters:
- calibrate_polynomial:
degree: 3
datapoints:
- 0.09 -> 0.35
- 0.83 -> 1.30
- 2.09 -> 5.13
- 3.00 -> 10.24
- lambda: |-
if (x <= 0.29) {
return 0.0;
} else {
return x;
}