The cFos Charging Manager allows the dynamic evaluation of formulas. This functionality is available for a counter of the "Expression" type and for loading rules of the "Formula" type.
So you can set up meters that calculate values from other meters or wall boxes and keep them ready and display them. The charging rules can also dynamically calculate the charging current using formulas and also access meters and wall boxes (including meters of the "Expression" type).
The following operations are possible with the formulas:
+ - * / | Addition, subtraction, multiplication, division |
^ | Power calculation, e.g. 10 ^ 2 = 100 |
min(x,y) | Minimum of x and y, more than 2 arguments possible |
max(x,y) | Maximum of x and y, more than 2 arguments possible |
abs(x) | Absolute amount of x, e.g. abs (-2) = 2 |
sqrt(x) | Square root of x |
The following logical expressions are also possible:==
(equal to) !=
(not equal to), <
(less than), <=
(less than or equal to), >
(greater than), >=
(greater than or equal to) !
(not), ||
(logical or), &&
(logical and) ?
(Conditional operator, x ? y : z
, returns y if x is true, otherwise z)
This allows, for example, switching off the current depending on conditions: M1.current >= 6500 ? M1.current : 0
supplies the current of M1 if it is greater than 6.5A and 0 otherwise, which pauses charging. For such conditions, it is also possible to query inputs (see below)
The following names are possible:
Mx | Counter with device ID x, e.g. M1 |
Ex | EVSE with device ID x, e.g. E1 |
It is also possible to access virtual meters such as solar surplus, purchased electricity or "Power avail. For EVSEs" (power available for wall boxes) by setting up the meter and then using the corresponding device ID in the formula.
Individual values of the devices can then be accessed using a point. These are called as follows:
current_l1 | Phase 1 current in mA |
current_l2 | Phase 2 current in mA |
current_l3 | Phase 3 current in mA |
current | Current of the current phase in mA (with charging rules, the Charging Manager queries all phases one after the other; with meters of the "Expression" type, the respective phase to which the formula refers applies. If you have specified a formula for "Current L1", you can omit the fields for stream L2 and L3. Then the formula for stream L1 is used) |
power_va | Current power in watts/VA (depending on the meter type, apparent power or real power can be supplied here) |
import_wh | Related energy in Wh |
export_wh | Energy fed in in Wh |
dt | The time since the last last update (in seconds) |
inputN | Input number N of the device, 1 = active, 0 = inactive |
soc | SOC, charge level in percent (counter/memory) |
txn_duration | Duration of the current transaction in seconds (wallbox) |
txn_energy | Charged energy of the current transaction in Wh (wallbox) |
M1.current_l1 | Current of meter M1, phase 1 |
E2.import_wh | Used Wh of the EVSE E2 |
E3.power_va | Current charging power of E3 |
If you use the formulas for a counter of the "Expression" type, you can omit the device ID. Then the field names refer to this meter, eg 'power_va' is then the power of this meter in watts/VA. With 'dt' you can implement a few additional functions, for example in a counter of the "Expression" type:
import_wh + M1.power_va * dt / 3600
updates the drawn energy based on the power during the last update time(power_va * (20 - dt) + M1.power_va * dt) / 20
smooths the power over the last 20 seconds.date
date.year | current year |
date.month | month from 0..11 |
date.day | day from 1..31 |
date.weekday | Day of the week Mon=0, Tue=1, ... Sun=6 |
date.yearday | day of the year from 0..366 |
date.hour | hour from 0..23 |
date.minute | minutes from 0..60 |
date.second | second from 0..60 |
date.daysecond | Second of this day from 0..86399 |
date.dayminute | Minute of this day from 0..1439 |
date.dst | 0 = winter time, 1 = summer time |
PB (cFos Power brain only)
PB.input1 | S0 Input 1, 1 = active, 0 = inactive |
PB.input2 | S0 Input 2, 1 = active, 0 = inactive |
CMCharging manager variables
These variables can be set by the admin under "Configuration". For example, if the admin sets the variable 'var_x' to 1.5, CM.var_x returns the value 1.5.
Benutzung der globalen Objekte:
charge 8A starting at 8:00am: date.dayminute >= 480 ? 8000 : 0
charge 16A on Saturday and Sunday: date.weekday == 5 || date.weekday == 6 ? 16000 : 0
charge 6A if input 2 active: PB.input2 ? 6000 : 0
charge 6A if CM variable non-zero: cm.var1 ? 6000 : 0
You would like to additionally limit the charging current with regard to a consumption meter in an apartment. To do this, you can set up 16000 - M1.current
M1 is the meter that measures the consumption of the apartment. The load management of the cFos Charging Manager first tries to provide the wallbox with the maximum current with regard to the house connection capacity, but then limits this to 16A minus the apartment consumption.