Control of the battery storage
(for firmware versions from 1.25.2)

The documentation for controlling the battery storage for firmware versions < 1.25.2 can be found here.

Most battery storage systems that are installed in conjunction with solar power systems have an in-built charging rule according to which they attempt to charge before electricity is fed in and attempt to discharge before electricity is drawn from the grid. Industrial storage systems can be controlled according to other criteria, e.g. to limit peak loads or to limit energy consumption during peak load windows according to the grid operator's specifications. Small battery storage systems would undergo deep charging cycles due to the charging of the electric car and would therefore be subject to high wear and tear. It therefore makes sense in many cases to control the storage system using the cFos Charging Manager. To do this, you need a model that is controllable or at least a switching option via a relay.

Storage systems can be controlled as part of SunSpec battery model 124 (e.g. Fronius) or have their own Modbus registers that allow control. Hybrid devices serve as inverters for solar panels and storage systems. Inverters, meters and battery storage are created as meter tiles in the cFos Charging Manager. It is therefore possible to activate battery control in all meters. For SunSpec devices with model 124, the cFos Charging Manager attempts to control the associated storage system. You may need to enable this in the device first. For user-defined meters (Victron, etc.), the cFos Charging Manager attempts to find a user-defined variable called "soc" (in per cent). This may then be displayed in the meter tile.

Under battery storage control, you can first specify the maximum charging and discharging power. -1 means that the Charging Manager should not control the charging or discharging power. You can then define several charging rules that are processed one after the other every few seconds and limit the charging or discharging current. The charging rules work in a similar way to the charging rules for wallboxes. The cFos Charging Manager uses the maximum charging or discharging power as the start value, i.e. the control value, and allows this to be changed by processing the charging rules.

After all charging rules have been processed, there is a current limit (which can also be 0) for the charging or discharging power. The cFos Charging Manager stores these values in the user-defined variables called "charge_power_w", "charge_power_prc" (specified in per cent), "discharg_power_w" and "discharge_power_prc". There is also a user-defined variable called "bat_mode". Here it is recorded whether there is a charge limit or discharge limit (0=no values, 1=charge limit, 2=discharge limit, 3=charge and discharge limit). The limits are converted for SunSpec devices and written to the registers provided for this purpose. For user-defined counters, you can create user-defined outputs that write the values of the above variables to the device. You can find examples of this in the supplied meter definitions for Victron or Kostal Plenticore. If the charge or discharge limit is not controlled, the respective variables do not exist so that they are not written to the memory. With the "Mode" setting of the battery storage control, you determine what should happen if there are positive values for both charging and discharging power. "Neutral" means that the cFos Charging Manager transfers both values to the storage system, which then decides what to do within a certain range. "Prioritise charging" means that the discharging power is set to 0 if the charging power is positive, "Prioritise discharging" means that the (charging) power is set to 0 if the discharging power is positive. This is useful if the storage tank only has one value for charging and discharging power. If the charging or discharging power is less than 0, the user-defined variables are deleted. You should take this into account when creating customised meter definitions. This is the case, for example, if you have specified -1 as the maximum charging or discharging power, or if your charging rules result in negative values. For example, you can create meter definitions that only have a controlling effect on the battery storage if the corresponding variables exist(if exist(charge_power_w)...).

Switching output: Unfortunately, some memories cannot be controlled directly with the above rules. However, in order to at least be able to deactivate the storage tank with the above rules (e.g. when a car is charging), you can try to use a switching contact if the storage tank has a control input. If practicable, you could also disconnect the storage tank electrically from the mains using a contactor (to avoid destroying the storage tank, you must ask the manufacturer or electrician beforehand whether the device is suitable for this). In the "Switching output" field, you can specify the name of a variable that is set to 1 if the charging or discharging power is positive after analysing the charging rules and to 0 if it is not. The cFos Charging Manager provides a counter definition for a Shelly switch box or switch socket. When you set this up, the meter is given a device ID, e.g. M5. You can then specify the Shelly switch box under "Switching output" in the battery storage control unit using: M5.output1. If you prefix the variable name with a minus sign, the switching output is inverted(-M5.output1)