-
Notifications
You must be signed in to change notification settings - Fork 2
/
ferroamp_easee_pv-loadbalancing.yaml
150 lines (148 loc) · 5.16 KB
/
ferroamp_easee_pv-loadbalancing.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
blueprint:
domain: automation
name: Ferroamp + Easee PV Loadbalancing
description: This automation connects Ferroamp and Easee for PV load balancing.
<br><br>You need to have both Ferroamp and Easee integration up and running through
HACS. See readme.
source_url: https://github.com/riksarchen/ferroamp_easee_pv-loadbalancing/blob/main/ferroamp_easee_pv-loadbalancing.yaml
input:
isolarpower:
name: Ferroamp Solar power sensor
description: 'By default: sensor.ferroamp_solar_power'
selector:
entity:
domain: sensor
device_class: power
multiple: false
default: sensor.ferroamp_solar_power
iconsumptionpower:
name: Ferroamp Consumption power sensor
description: 'By default: sensor.ferroamp_consumption_power'
selector:
entity:
domain: sensor
device_class: power
multiple: false
default: sensor.ferroamp_consumption_power
ibatterysoc:
name: Ferroamp HOME battery state of charge sensor
description: 'By default: sensor.ferroamp_system_state_of_charge'
selector:
entity:
domain: sensor
device_class: battery
multiple: false
default: sensor.ferroamp_system_state_of_charge
iexternalvoltage:
name: Ferroamp External voltage sensor
description: 'By default: sensor.ferroamp_external_voltage'
selector:
entity:
domain: sensor
device_class: voltage
multiple: false
default: sensor.ferroamp_external_voltage
ichargerpower:
name: Easee charging power sensor
description: 'By default (kW): sensor.<your easee name>_power'
selector:
entity:
domain: sensor
device_class: power
multiple: false
ichargerdynamiclimit:
name: Easee Charger Dynamic limit sensor
description: 'By default: sensor.<your easee name>_dynamic_charger_limit'
selector:
entity:
domain: sensor
device_class: current
multiple: false
ichargerstatus:
name: Easee Charger Status sensor
description: 'By default: sensor.<your easee name>_status'
selector:
entity:
domain: sensor
multiple: false
iminbatterylevel:
name: 'Boost charging with homebattery if SoC is above:'
description: Boost charging with home battery power if home battery SoC is above
this limit.
selector:
number:
min: 0.0
max: 100.0
step: 1.0
unit_of_measurement: '%'
mode: slider
default: 20
ibatteryboostpower:
name: Maximum homebattery discharge capacity
description: Set your home battery maximum discharge power.
selector:
number:
unit_of_measurement: W
mode: box
step: 100
min: 0
max: 25000
default: 5000
itimestart:
name: Activate time
description: Set the time you want the load balancing to activate. This is important
to avoid low charging currents during nighttime.
default: 08:00:00
selector:
time: {}
itimeend:
name: Deactivate time
description: Set the time you want the load balancing to deactivate. This is
important to avoid low charging currents during nighttime.
default: '22:00:00'
selector:
time: {}
trigger:
- platform: state
entity_id:
- !input 'isolarpower'
condition:
- condition: state
entity_id: !input 'ichargerstatus'
state: charging
- condition: template
value_template: '{{ (states(entChargerDynamicLimit)|int) != valCurrentAvailableForCharging
}}'
- condition: time
after: !input 'itimestart'
before: !input 'itimeend'
action:
- service: easee.set_charger_dynamic_limit
data:
charger_id: '{{ state_attr(entChargerStatus,''id'') }}
'
current: '{{ valCurrentAvailableForCharging }}
'
variables:
entChargerDynamicLimit: !input 'ichargerdynamiclimit'
entSolarPower: !input 'isolarpower'
entConsumptionPower: !input 'iconsumptionpower'
entBatterySOC: !input 'ibatterysoc'
entBatteryMinSoC: !input 'iminbatterylevel'
entBatteryBoostPower: !input 'ibatteryboostpower'
entChargingPower: !input 'ichargerpower'
entExternalVoltage: !input 'iexternalvoltage'
entChargerStatus: !input 'ichargerstatus'
valExternalVoltage: '{% if state_attr(entChargerStatus, ''config_phaseMode'') ==
1 %} {{ states(entExternalVoltage)|float / 3 }} {% else %} {{ states(entExternalVoltage)|float
}} {% endif %}'
valCurrentAvailableForCharging: '{% set powerAvailable = (states(entSolarPower)|float
- states(entConsumptionPower)|float + (states(entChargingPower)|float * 1000))|int
%} {% if states(entBatterySOC)|float >= entBatteryMinSoC|float %} {% set powerAvailable
= powerAvailable + entBatteryBoostPower|float %} {% endif %} {% set EaseeAvailableCurrent
= (powerAvailable / valExternalVoltage) | float %} {% if EaseeAvailableCurrent
< 6 %} {% set EaseeAvailableCurrent = 6 %} {% elif EaseeAvailableCurrent > 32
%} {% set EaseeAvailableCurrent = 32 %} {% endif %} {{ EaseeAvailableCurrent|int
}}'
mode: restart
max_exceeded: silent