-
Notifications
You must be signed in to change notification settings - Fork 4
/
integration_alpha_ess.yaml
467 lines (443 loc) · 14.5 KB
/
integration_alpha_ess.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
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
#modbus sensor configuration
modbus:
- name: modbuspvsystem
type: tcp
host: !secret alphaess_modbus_host_ip
port: !secret alphaess_modbus_host_port
message_wait_milliseconds: 5 # waittime between 2 messages
timeout: 10 # timeout in seconds before connection is closed
delay: 1 # delay in seconds at startup
#definition of sensors
sensors:
#Measurements other
- name: Alpha ESS Grid Frequency
unique_id: PV_Grid_Frequency
slave: !secret alphaess_modbus_slaveId
address: 1052
input_type: holding
data_type: int16
unit_of_measurement: "Hz"
device_class: frequency
state_class: measurement
scan_interval: 30
scale: 0.01
precision: 2
- name: Alpha ESS INV Temperature
unique_id: PV_INV_Temperature
slave: !secret alphaess_modbus_slaveId
address: 1077
input_type: holding
data_type: int16
unit_of_measurement: "°C"
device_class: temperature
state_class: measurement
scan_interval: 60
scale: 0.1
precision: 2
#Measurements current power
# Power to/from GRID
- name: Alpha ESS Total Power Grid
unique_id: PV_TotalPower_Grid
slave: !secret alphaess_modbus_slaveId
address: 33
input_type: holding
data_type: int32
unit_of_measurement: W
device_class: power
state_class: measurement
scan_interval: 10
scale: 1
precision: 2
# Power to/from Battery
- name: Alpha ESS Total Power Battery
unique_id: PV_TotalPower_Battery
slave: !secret alphaess_modbus_slaveId
address: 294
input_type: holding
data_type: int16
unit_of_measurement: W
device_class: power
state_class: measurement
scan_interval: 10
scale: 1
precision: 2
# Power Inverter
- name: Alpha ESS Total Power Inverter
unique_id: PV_TotalPower_Inverter
slave: !secret alphaess_modbus_slaveId
address: 1036
input_type: holding
data_type: int32
unit_of_measurement: W
device_class: power
state_class: measurement
scan_interval: 10
scale: 1
precision: 2
# Power of String 1 (connector PV1 on the inverter)
- name: Alpha ESS Total Power String 1
unique_id: alpha_ess_total_power_string_1
slave: !secret alphaess_modbus_slaveId
address: 1055
input_type: holding
data_type: uint32
unit_of_measurement: "W"
device_class: power
state_class: measurement
scan_interval: 5
scale: 1
precision: 2
- name: Alpha ESS PV1 Voltage
unique_id: PV_PV1_Voltage
slave: !secret alphaess_modbus_slaveId
address: 1053
input_type: holding
data_type: int16
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
scan_interval: 60
scale: 0.1
precision: 2
- name: Alpha ESS PV1 Current
unique_id: PV_PV1_Current
slave: !secret alphaess_modbus_slaveId
address: 1054
input_type: holding
data_type: int16
unit_of_measurement: "A"
device_class: current
state_class: measurement
scan_interval: 60
scale: 0.1
precision: 2
# Power of String 2 (connector PV3 on the inverter)
- name: Alpha ESS Total Power String 2
unique_id: alpha_ess_total_power_string_2
slave: !secret alphaess_modbus_slaveId
address: 1059
input_type: holding
data_type: uint32
unit_of_measurement: "W"
device_class: power
state_class: measurement
scan_interval: 5
scale: 1
precision: 2
- name: Alpha ESS PV2 Voltage
unique_id: PV_PV2_Voltage
slave: !secret alphaess_modbus_slaveId
address: 1057
input_type: holding
data_type: int16
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
scan_interval: 60
scale: 0.1
precision: 2
- name: Alpha ESS PV2 Current
unique_id: PV_PV2_Current
slave: !secret alphaess_modbus_slaveId
address: 1058
input_type: holding
data_type: int16
unit_of_measurement: "A"
device_class: current
state_class: measurement
scan_interval: 60
scale: 0.1
precision: 2
# Power of String 3 (connector PV2 on the inverter)
- name: Alpha ESS Total Power String 3
unique_id: alpha_ess_total_power_string_3
slave: !secret alphaess_modbus_slaveId
address: 1063
input_type: holding
data_type: uint32
unit_of_measurement: "W"
device_class: power
state_class: measurement
scan_interval: 5
scale: 1
precision: 2
# Power of String 4 (connector PV4 on the inverter)
- name: Alpha ESS Total Power String 4
unique_id: alpha_ess_total_power_string_4
slave: !secret alphaess_modbus_slaveId
address: 1067
input_type: holding
data_type: uint32
unit_of_measurement: "W"
device_class: power
state_class: measurement
scan_interval: 5
scale: 1
precision: 2
#ENERGY MEASUREMENTS STATISTIC
# Total Energy Feed to Grid
- name: Alpha ESS Total Energy Feed to Grid
unique_id: PV_TotalEnergyFeed_Grid
slave: !secret alphaess_modbus_slaveId
address: 16
input_type: holding
data_type: uint32
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
scan_interval: 60
scale: 0.01
precision: 2
# Total Energy Consume from Grid
- name: Alpha ESS Total Energy Consumption from Grid
unique_id: PV_TotalEnergyConsume_Grid
slave: !secret alphaess_modbus_slaveId
address: 18
input_type: holding
data_type: uint32
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
scan_interval: 60
scale: 0.01
precision: 2
# Total Energy Charge Batteryy
- name: Alpha ESS Total Energy Charge Battery
unique_id: PV_TotalEnergyCharge_Battery
slave: !secret alphaess_modbus_slaveId
address: 288
input_type: holding
data_type: uint32
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
scan_interval: 60
scale: 0.1
precision: 2
# Total Energy Discharge Battery
- name: Alpha ESS Total Energy Discharge Battery
unique_id: PV_TotalEnergyDischarge_Battery
slave: !secret alphaess_modbus_slaveId
address: 290
input_type: holding
data_type: uint32
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
scan_interval: 60
scale: 0.1
precision: 2
# Total Energy Charge Battery from Grid
- name: Total Energy Charge Battery from Grid
unique_id: PV_TotalEnergyChargeFromGrid_Battery
slave: !secret alphaess_modbus_slaveId
address: 292
input_type: holding
data_type: uint32
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
scan_interval: 60
scale: 0.1
precision: 2
# Total Energy From PV
- name: Alpha ESS Total Energy from PV
unique_id: PV_TotalEnergyFromPV_PV
slave: !secret alphaess_modbus_slaveId
address: 1086
input_type: holding
data_type: uint32
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
scan_interval: 60
scale: 0.1
precision: 2
# BATTERY
#SOC
- name: Alpha ESS SOC Battery
unique_id: PV_SOC_Battery
slave: !secret alphaess_modbus_slaveId
address: 258
input_type: holding
data_type: int16
unit_of_measurement: "%"
device_class: battery
state_class: measurement
scan_interval: 10
scale: 0.1
precision: 2
- name: Alpha ESS Battery Min Cell Temp
unique_id: PV_Battery_Min_Cell_Temp
slave: !secret alphaess_modbus_slaveId
address: 269
input_type: holding
data_type: uint16
unit_of_measurement: "°C"
device_class: temperature
state_class: measurement
scan_interval: 10
scale: 0.1
precision: 2
- name: Alpha ESS Battery Max Cell Temp
unique_id: PV_Battery_Max_Cell_Temp
slave: !secret alphaess_modbus_slaveId
address: 272
input_type: holding
data_type: uint16
unit_of_measurement: "°C"
device_class: temperature
state_class: measurement
scan_interval: 10
scale: 0.1
precision: 2
- name: Alpha ESS Battery Max Charge Current
unique_id: PV_Battery_Max_Charge_Current
slave: !secret alphaess_modbus_slaveId
address: 273
input_type: holding
data_type: uint16
unit_of_measurement: "A"
device_class: current
state_class: measurement
scan_interval: 10
scale: 0.1
precision: 2
- name: Alpha ESS Battery Max Discharge Current
unique_id: PV_Battery_Max_Discharge_Current
slave: !secret alphaess_modbus_slaveId
address: 274
input_type: holding
data_type: uint16
unit_of_measurement: "A"
device_class: current
state_class: measurement
scan_interval: 10
scale: 0.1
precision: 2
- name: Alpha ESS Battery remaining time
unique_id: PV_Battery_remaining_time
slave: !secret alphaess_modbus_slaveId
address: 295
input_type: holding
data_type: int16
unit_of_measurement: minutes
state_class: measurement
scan_interval: 60
scale: 1
precision: 2
- name: Alpha ESS Battery Voltage
unique_id: PV_Battery_Voltage
slave: !secret alphaess_modbus_slaveId
address: 256
input_type: holding
data_type: int16
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
scan_interval: 60
scale: 0.1
precision: 2
# PV Settings
# feedrate into the grid (percentage of the installed PV-Power)
- name: Alpha ESS Max Feed to Grid
unique_id: PV_MaxFeedIntoGrid
slave: !secret alphaess_modbus_slaveId
address: 2048
input_type: holding
data_type: uint16
unit_of_measurement: "%"
state_class: measurement
scan_interval: 60
scale: 1
precision: 2
#GRID Meter
#Rate of gridmeter
- name: Alpha ESS Gridmeter CT Rate
unique_id: PV_GridMeter_CT_Rate
slave: !secret alphaess_modbus_slaveId
address: 1
input_type: holding
data_type: uint16
state_class: measurement
scan_interval: 60
scale: 1
precision: 1
- name: Alpha ESS PVMeter CT Rate
unique_id: PV_PVMeter_CT_Rate
slave: !secret alphaess_modbus_slaveId
address: 129
input_type: holding
data_type: uint16
state_class: measurement
scan_interval: 60
scale: 1
precision: 1
#Helper for setting target SoC
input_number:
alpha_ess_helper_target_soc_value:
name: "Setting Target SoC"
min: 0
max: 100
icon: mdi:cloud_percent
unit_of_measurement: "%"
mode: slider
step: 1.0
#Helper for setting the MaxFeedToGrid
alpha_ess_helper_feedtogrid_value:
name: "Setting Max Feed to Grid"
min: 0
max: 100
icon: mdi:cloud_percent
unit_of_measurement: "%"
mode: slider
step: 1.0
#Automations
automation:
- id: "Alpha_ESS_Setting_FeedToGrid"
alias: PV_Set_FeedToGrid_Value
description: "With slide the MaxFeedToGrid rate is set and send to System via modbus"
trigger:
- platform: state
entity_id:
- input_number.alpha_ess_helper_feedtogrid_value
condition: []
action:
- service: modbus.write_register
data:
hub: modbuspvsystem
address: 2048
slave: 85
value: "{{ (states('input_number.alpha_ess_helper_feedtogrid_value') | int)}}"
mode: single
- id: "Alpha_ESS_Setting_TargetSoC"
alias: PV_Set_TargetSoC_Value
description: "With slide the target SoC is set and send to System via modbus"
trigger:
- platform: state
entity_id:
- input_number.alpha_ess_helper_target_soc_value
condition: []
action:
- service: modbus.write_register
data:
hub: modbuspvsystem
address: 2128
slave: 85
value: "{{ (states('input_number.alpha_ess_helper_target_soc_value') | int)}}"
mode: single
#Sensor templates
template:
- sensor:
#Total consumption of the home
- name: alpha_ess_totalenergyconsume_home
unit_of_measurement: "kWh"
state: "{{ states('sensor.pv_totalenergyfrompv_pv') |float + states('sensor.pv_totalenergyconsume_grid') | float - states('sensor.pv_totalenergyfeed_grid') | float }}"
#Total current production
- name: alpha_ess_actual_production
unit_of_measurement: "W"
state: "{{ (states('sensor.alpha_ess_total_power_string_1') | int + states('sensor.alpha_ess_total_power_string_2') | int + states('sensor.alpha_ess_total_power_string_3') | int + states('sensor.alpha_ess_total_power_string_4') | int) |int }}"
#Total consumption of the house
- name: alpha_ess_actual_house_consumption
unit_of_measurement: "W"
state: "{{ (states('sensor.pv_totalpower_inverter')|float + states('sensor.pv_totalpower_grid')|float ) }}"