-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathfoxess-inverter.yaml
355 lines (309 loc) · 8.84 KB
/
foxess-inverter.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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
esphome:
name: foxess-inverter
includes:
- foxess_t_series.h
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
level: VERBOSE
baud_rate: 0
# Enable Home Assistant API
api:
ota:
password: "***********************"
wifi:
ssid: "***************************"
password: "*********************"
# manual_ip:
# static_ip: xxx.xxx.xxx.xx
# gateway: xxx.xxx.xxx.x
# subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Inverter Fallback Hotspot"
password: "*****************+"
captive_portal:
uart:
id: uart_bus
tx_pin: 16
rx_pin: 17
baud_rate: 9600
#debug:
button:
- platform: restart
name: "Foxess inverter restart"
switch:
- platform: gpio
pin: 4
name: "T-Series sending mode" #if "on" reading from inverter doesn't work!
internal: true #switch is not exposed to HA frontend, should you ever need to write to the inverter, just comment this line
text_sensor:
- platform: template
name: "T-Series Inverter Mode"
id: "inverter_mode_text_sensor"
icon: mdi:solar-power-variant
sensor:
- platform: custom
lambda: |-
auto foxesssensors = new foxesscomponent(id(uart_bus));
App.register_component(foxesssensors);
return {\
foxesssensors->grid_power, \
foxesssensors->generation_power, \
foxesssensors->loads_power, \
foxesssensors->grid_voltage_r, \
foxesssensors->grid_current_r, \
foxesssensors->grid_frequency_r, \
foxesssensors->grid_power_r, \
foxesssensors->grid_voltage_s, \
foxesssensors->grid_current_s, \
foxesssensors->grid_frequency_s, \
foxesssensors->grid_power_s, \
foxesssensors->grid_voltage_T, \
foxesssensors->grid_current_T, \
foxesssensors->grid_frequency_T, \
foxesssensors->grid_power_T, \
foxesssensors->pv1_voltage, \
foxesssensors->pv1_current, \
foxesssensors->pv2_voltage, \
foxesssensors->pv2_current, \
foxesssensors->pv3_voltage, \
foxesssensors->pv3_current, \
foxesssensors->pv4_voltage, \
foxesssensors->pv4_current, \
foxesssensors->boost_temperature, \
foxesssensors->inverter_temperature, \
foxesssensors->ambient_temperature, \
foxesssensors->today_yield, \
foxesssensors->generation_total, \
foxesssensors->pv1_power, \
foxesssensors->pv2_power, \
foxesssensors->pv3_power, \
foxesssensors->pv4_power, \
foxesssensors->inverter_state\
};
sensors:
- name: "T-Series Grid Power"
id: "grid_power"
unit_of_measurement: W
icon: mdi:lightning-bolt
- name: "T-Series Generation Power"
id: "generation_power"
unit_of_measurement: W
icon: mdi:lightning-bolt
- name: "T-Series loads Power"
id: "loads_power"
unit_of_measurement: W
icon: mdi:lightning-bolt
- name: "T-Series Grid Voltage R"
id: "grid_voltage_r"
unit_of_measurement: V
accuracy_decimals: 1
icon: mdi:flash
filters:
- multiply: 0.1
- throttle: 1h
- name: "T-Series Grid Current R"
id: "grid_current_r"
unit_of_measurement: A
accuracy_decimals: 1
icon: mdi:current-ac
filters:
- multiply: 0.1
- throttle: 1h
- name: "T-Series Grid Frequency R"
id: "grid_Frequency_r"
unit_of_measurement: Hz
accuracy_decimals: 2
icon: mdi:sine-wave
filters:
- multiply: 0.01
- throttle: 1h
- name: "T-Series Grid Power R"
id: "grid_power_r"
unit_of_measurement: W
icon: mdi:lightning-bolt
- name: "T-Series Grid Voltage S"
id: "grid_voltage_s"
unit_of_measurement: V
accuracy_decimals: 1
icon: mdi:flash
filters:
- multiply: 0.1
- throttle: 1h
- name: "T-Series Grid Current S"
id: "grid_current_s"
unit_of_measurement: A
accuracy_decimals: 1
icon: mdi:current-ac
filters:
- multiply: 0.1
- throttle: 1h
- name: "T-Series Grid Frequency S"
id: "grid_Frequency_s"
unit_of_measurement: Hz
accuracy_decimals: 2
icon: mdi:sine-wave
filters:
- multiply: 0.01
- throttle: 1h
- name: "T-Series Grid Power S"
id: "grid_power_s"
unit_of_measurement: W
icon: mdi:lightning-bolt
- name: "T-Series Grid Voltage T"
id: "grid_voltage_T"
unit_of_measurement: V
accuracy_decimals: 1
icon: mdi:flash
filters:
- multiply: 0.1
- throttle: 1h
- name: "T-Series Grid Current T"
id: "grid_current_t"
unit_of_measurement: A
accuracy_decimals: 1
icon: mdi:current-ac
filters:
- multiply: 0.1
- throttle: 1h
- name: "T-Series Grid Frequency T"
id: "grid_Frequency_t"
unit_of_measurement: Hz
accuracy_decimals: 2
icon: mdi:sine-wave
filters:
- multiply: 0.01
- throttle: 1h
- name: "T-Series Grid Power T"
id: "grid_power_t"
unit_of_measurement: W
icon: mdi:lightning-bolt
- name: "T-Series PV1 Voltage"
id: "pv1_voltage"
unit_of_measurement: V
accuracy_decimals: 1
icon: mdi:flash
filters:
- multiply: 0.1
- name: "T-Series PV1 Current"
id: "pv1_current"
unit_of_measurement: A
accuracy_decimals: 1
icon: mdi:current-ac
filters:
- multiply: 0.1
- name: "T-Series PV2 Voltage"
id: "pv2_voltage"
unit_of_measurement: V
accuracy_decimals: 1
icon: mdi:flash
filters:
- multiply: 0.1
- name: "T-Series PV2 Current"
id: "pv2_current"
unit_of_measurement: A
accuracy_decimals: 1
icon: mdi:current-ac
filters:
- multiply: 0.1
- name: "T-Series PV3 Voltage" #only relevant for models T8dual-T12dual and T15-T25
id: "pv3_voltage"
unit_of_measurement: V
accuracy_decimals: 1
icon: mdi:flash
filters:
- multiply: 0.1
- name: "T-Series PV3 Current" #only relevant for models T8dual-T12dual and T15-T25
id: "pv3_current"
unit_of_measurement: A
accuracy_decimals: 1
icon: mdi:current-ac
filters:
- multiply: 0.1
- name: "T-Series PV4 Voltage" #only relevant for models T8dual-T12dual and T15-T25
id: "pv4_voltage"
unit_of_measurement: V
accuracy_decimals: 1
icon: mdi:flash
filters:
- multiply: 0.1
- name: "T-Series PV4 Current" #only relevant for models T8dual-T12dual and T15-T25
id: "pv4_current"
unit_of_measurement: A
accuracy_decimals: 1
icon: mdi:current-ac
filters:
- multiply: 0.1
- name: "T-Series Boost Temperature" #boost temperature and inverter temperature seem to be always the same
id: "boost_temperature"
unit_of_measurement: °C
filters:
- throttle: 10min
- name: "T-Series Inverter Temperature" #boost temperature and inverter temperature seem to be always the same
id: "inverter_temperature"
unit_of_measurement: °C
filters:
- throttle: 10min
- name: "T-Series Ambient Temperature"
id: "ambient_temperature"
unit_of_measurement: °C
filters:
- throttle: 10min
- name: "T-Series Today Yield"
id: "today_yield"
unit_of_measurement: kWh
accuracy_decimals: 1
icon: mdi:solar-power
filters:
- multiply: 0.1
- name: "T-Series Generation Total"
id: "generation_total"
unit_of_measurement: kWh
device_class: energy #for use in energy dashboard
state_class: total_increasing #for use in energy dashboard
accuracy_decimals: 1
icon: mdi:solar-power
filters:
- multiply: 0.1
- name: "T-Series PV1 Power" #rs485 comm says this is always 0W, so this is calculated in the .h file by voltage*current
id: "pv1_power"
unit_of_measurement: W
icon: mdi:lightning-bolt
accuracy_decimals: 1
- name: "T-Series PV2 Power" #rs485 comm says this is always 0W, so this is calculated in the .h file by voltage*current
id: "pv2_power"
unit_of_measurement: W
icon: mdi:lightning-bolt
accuracy_decimals: 1
- name: "T-Series PV3 Power" #rs485 comm says this is always 0W, so this is calculated in the .h file by voltage*current
id: "pv3_power"
unit_of_measurement: W
icon: mdi:lightning-bolt
accuracy_decimals: 1
- name: "T-Series PV4 Power" #rs485 comm says this is always 0W, so this is calculated in the .h file by voltage*current
id: "pv4_power"
unit_of_measurement: W
icon: mdi:lightning-bolt
accuracy_decimals: 1
- name: "T-Series Inverter State"
id: "inverter_state"
internal: true
on_value:
then:
- lambda: |-
if(x==0) {
id(inverter_mode_text_sensor).publish_state("Offline");
}
else if(x==1) {
id(inverter_mode_text_sensor).publish_state("Online");
}
else if(x==2) {
id(inverter_mode_text_sensor).publish_state("Error");
}
else {
id(inverter_mode_text_sensor).publish_state("Waiting for response...");
}