Documentation

Charging rules
(for firmware versions from 1.25.2)

The documentation of the charging rules for firmware versions < 1.25.2 can be found here.


                        Screenshot dialogue loading rules

General mode of operation

The charging rules of the cFos Charging Manager work like small programmes. When the cFos Charging Manager processes charging rules, it takes a start value as the "rule value" and then runs through all the charging rules from top to bottom. It checks the condition for each rule and, if it is fulfilled, executes the relevant action. This continues until either the end of the loading rules is reached or the "Finish" option is set for the action if the condition is fulfilled. The rule value determined up to that point is then returned. For wallboxes, the charging rules determine the charging current per phase in mA in this way and for battery storage systems the charging or discharging power in W.

For charging rules for wallboxes, the start value is 0, i.e. if no rule is fulfilled, charging is paused. For battery storage systems, the start value is the maximum charging or discharging power, i.e. if no charging rule is fulfilled, the maximum charging or discharging power is the one set in the battery control options of the cFos Charging Manager.

There is a "PV surplus" option for charging rules for wallboxes. In each cycle, the cFos Charging Manager first checks whether charging rules with the "PV surplus" option are set for wallboxes. All wallboxes whose charging rule(s) with this option provide a value >= 0 are considered first and their charging current is marked as surplus. Then all wallboxes with charging rules without the "PV surplus" option are considered. This means that wallboxes that want to charge PV surplus are prioritised. Note: If the charging rules with the "PV surplus" option return -1 for a wallbox, this wallbox does not participate in the PV surplus. The Charging Manager then applies charging rules for normal charging.

Calculation of the surplus: If the "PV surplus" option is activated, the condition "PV surplus >= expression" considers whether the surplus divided by the predicted charging phases is large enough for the condition to be fulfilled. If the "PV surplus" option is not active, the system checks whether the surplus >= expression on the respective phase. The same applies to the conditions "Grid supply", "Grid feed-in" and "Solar power". Here, if the "PV surplus" option is active, the sum of the currents divided by the predicted number of charging phases is checked against the expression, while if the option is not active, the current of the respective phase is checked. For the actions, if the "PV surplus" option is active, the sum of the currents of all phases divided by the predicted charging phases is delivered as the value for "Deliver surplus", "Deliver solar power", "Deliver grid supply" and "Deliver feed-in", while if the option is not active, the current of the respective phase is delivered. In short: For the usual case of PV surplus charging, we recommend activating the option. If the option is not active, the focus is on load management, i.e. the cFos Charging Manager considers all three phases separately.

Each charge controller has the following general setting options

ID: A freely selectable number. See below for more details.

Rule active: Rules that are not active are ignored.

Weekdays: This allows you to set the days on which the rule should be observed and the days on which it should be ignored

PV surplus: With charging rules for wallboxes, the Charging Manager always checks first whether charging rules for PV surplus are active. These then determine the charging current per phase. All charging rules whose "PV surplus" option is not set are then processed from top to bottom.

Charging or discharging: For charging rules for battery storage systems, the Charging Manager processes all charging rules with the "Charging" option and all charging rules with the "Discharging" option independently of each other and thus determines the current charging or discharging capacity.

Each loading rule has a condition and an action. The action is only executed if the condition is fulfilled. An action can also have the "End" option activated. In this case, processing of the charging rules is ended after the action has been executed and the current rule value is returned. If "Finish" is not set, the Charging Manager continues with the next charging rule. If it reaches the end of the list, it also returns the current rule value.

Conditions

All conditions contain the "Not" option. If this is set, the action is executed if the condition is not fulfilled. Otherwise, the action is executed if the condition is fulfilled.

Some conditions have the option "Continue executing rule without fulfilled condition". You can specify a time in seconds here. If the condition is fulfilled, it may not be fulfilled for x seconds afterwards and the action is still executed. If, for example, the minimum PV surplus is reached, it may then be exceeded for x seconds and the action will still be executed.

Time: The condition is fulfilled within the specified time, but not outside. This allows you to charge at certain times.

PV surplus: The condition is fulfilled if the PV surplus per phase (for charging rules for cars) or the PV surplus across all phases in watts (for battery storage systems) is greater than (or equal to) the specified value or the formula.

Price: The condition is fulfilled if the current purchase price in cent per kWh is less than (or equal to) the specified value or the formula.

Price level: The condition is met if the current price level is less than (or equal to) the specified value or formula.

See also: Cost-conscious charging

SoC: The condition is fulfilled if the state of charge of the car (if the cFos Charging Manager knows this value) or the battery storage is greater than (or equal to) the specified value or the formula.

Number of loading cars: The condition is fulfilled if the number of loading cars is greater than (or equal to) the specified value or the formula.

Grid reference: The condition is fulfilled if the grid reference (for charging rules for cars per phase, for charging rules for battery storage in watts across all phases) is greater than (or equal to) the specified value or the formula.

Grid feed-in: The condition is fulfilled if the grid feed-in (for charging rules for cars per phase, for charging rules for battery storage in watts across all phases) is greater than (or equal to) the specified value or the formula.

Solar power: The condition is fulfilled if the generated current per phase (for charging rules for cars) or the generated power across all phases (for battery storage) is greater than (or equal to) the specified value or the formula.

Input active: The condition is fulfilled if the input with the specified number of the device with the specified device ID (E1, E2, ... for wallboxes, M1, M2, ... for meters) is active. Numbers count from 0. In this way, you can use charging rules in conjunction with switching inputs. The cFos Power Brain Wallbox, for example, has 2 S0 inputs. To use these, you can set up a cFos Power Brain S0 meter as a device with the "Display" role in the cFos Charging Manager. Assuming this meter has the device ID M1, you can address the S0-1 input using device ID M1 and input number 0. You can find information on wiring the S0 inputs on the cFos Power Brain on our page about S0 inputs / S0 counters and Modbus counters. If, for example, you want to control the charging current using an external switch or use a ripple control receiver that switches a relay in accordance with the energy supplier's specifications, you can use charging rules with input. In this way, you can also activate a charging controller for PV surplus via input.

Environmentally friendly: Here you can specify the maximum desired delay of the charging process and the expected charging time. The condition is considered fulfilled (and remains fulfilled) as soon as the cFos Charging Manager has calculated a start time that is as environmentally friendly and grid-friendly as possible and this has been reached. See Environmentally friendly charging.

Formula: The condition is fulfilled if the value of the formula is > 0 (floating point values). See formulas.

Always: The condition is always fulfilled.

Actions

Actions are executed if the condition of the loading rule is fulfilled (or the "Not" option is set and the condition is not fulfilled).

Set to value/formula: The current rule value is set to the specified value or formula.

Supply PV surplus / Supply solar power / Supply grid supply / Supply feed-in: The current control value is set to the corresponding value. For charging rules for storage systems, the power in watts across all phases. For charging rules for wallboxes, this is the current per phase in normal charging, for surplus charging ("PV surplus" option is set) the sum of the currents across all phases, divided by the number of phases (predicted or actual) used for charging. The value can also be multiplied by a factor, which is 1 by default. This can be used, for example, to control a battery storage system to avoid grid consumption or feed-in. The charging level of the battery storage system would charge the storage system with the grid supply. However, as there are measurement inaccuracies when determining the grid reference, the grid reference multiplied by a factor close to 1 is used as the charging rule for the storage system.

Set variable: The specified variable is set to a value or formula. You can specify Charging Manager variables or user-defined device variables as names. Charging Manager variables start with "CM.", device variables have a device ID and the name of the variable (e.g. E1.x).

The following variables are also available:

_rule_valThe current rule value. You can also query this in formulas.
_rule_idThe current rule ID. The rule ID is set to the ID of the first unignored rule and displayed in the device tile. You can also use "_rule_id" to set this value per rule, e.g. to visualise which important rule has been processed.
_rule_minThis value is normally set for switching from single-phase/three-phase charging, for example if you specify conditions with a current limit. Here you can set this value yourself. The system switches from single-phase charging to three-phase charging if the current limit has been greater than (or equal to) the "_rule_min" for a period of time.
_undercutSet undershoot to active if value is greater than zero (see below for explanation).

And: Link the rule to the next rule. The condition of the next rule is not considered to be fulfilled if the condition of the current rule is not fulfilled (regardless of whether the condition of the next rule is actually fulfilled).

Or: Link the rule to the next rule. The condition of the next rule is considered to be fulfilled if the condition of the current rule is fulfilled (regardless of whether the condition of the next rule is actually fulfilled).

Go to: The cFos Charging Manager searches (from top to bottom) for the first charging rule whose ID is the same as the specified ID and continues processing the charging rules with this one. If it does not find one, it continues processing with the next charging rule. Caution: Avoid endless loops! Although the Charging Manager cancels the processing of the charging rules after a while, it may waste unnecessary (calculation) time. In combination with the conditions of the charging rules, you can use this action to create small rule programmes.

Undercutting

For some conditions, you can set a time in seconds for which the rule should continue to be executed even if the condition is not met. For example, you can define a rule that is executed when a switching input is set. If you then set a time, this rule will continue to be executed for N seconds even though the input is no longer set. In the case of PV surplus charging, you can use this time to prevent charging from being interrupted by brief clouds.

The Charging Manager remembers in a flag called "_undercut" whether this "undercut" is active for at least one rule. If the charging rules for wallboxes result in a value below the minimum charging current set in the wallbox and the "_undercut" flag is set, the cFos Charging Manager returns the minimum charging current as the rule value so that the car continues to be charged. However, you can also set or delete the "_undercut" flag yourself using the charging rule (see above).