Battery Management - TonyM1958/HA-FoxESS-Modbus GitHub Wiki

This page provides notes on batteries, parameters that control charge and discharge and maintenance.

Battery Rated Capacity

Each battery has a rated capacity, given in the data sheet, also known as Nominal Energy. The product names are an approximation to the actual rated capacity:

  • HV2600 = 2.56 kWh
  • Mira HV25 = 2.45 kWh
  • ECS/EQ2900 = 2.88 kWh
  • ECS/EQ4100 = 4.03 kWh
  • ECS/EQ4300H = 4.14 kWh
  • ECS/EQ4800 = 4.66 kWh
  • CQ6 = 5.99kWh
  • CQ7 = 7.02kWh
  • CQ16 = 16.07kWh

To get higher capacities, a number of batteries are connected in series, so 4 x HV2600 = 4 x 2.56 = 10.24 kWh. This integration calls this the Battery Specification. With older batteries, the maximum number you can stack is between 7 and 9 (depending on battery and inverter battery voltage ratings).

With CQ, you can now stack up to 14 batteries but this requires requires an inverter with a higher maximum battery voltage rating.

This range of batteries are connected in parallel instead of series:

  • EP5 = 5.18 kWh
  • EP6 = 5.76 kWh
  • EP11 = 10.36 kWh
  • EP12 = 11.52 kWh

Up to 4 batteries can be connected in parallel via a junction box. The first battery operates as the Master BMS.

Battery Remaining Capacity

The capacity of a battery reduces with use so the current capacity is always the same or less than the rated capacity. The ratio of remaining or current capacity to rated capacity is called the State of Health (SoH - see below).

Depth of Discharge (DoD)

The minimum amount of charge that should be retained for the health of the batteries. Completely discharging the batteries can lead to damage and render the battery unusable. So, there is a nominal level or minimum state of charge where the batteries stop being used / discharged. Fox batteries have a recommended DoD of 90%, meaning that 90% of the current capacity is available and 10% is reserved.

Some regions (e.g. Australia) have regulations that require batteries to be sold with 100% DoD. In this case, a larger base battery means they still maintain a healthy reserve.

State of Charge (SoC)

SoC shows the amount of energy held in the batteries, calculated as the % of current battery energy divided by the current available capacity.

The BMS monitors the batteries and tracks the maximum and current energy stored in order to calculate SoC. As this calculation depends on both values, the BMS periodically updates it's view of the current energy stored and capacity, a process referred to as recalibration. Normally, this results in small changes, but larger changes can happen, especially if the batteries are subject to temperature swings as well.

Third party web sites (and AI) will often talk about LFP batteries using 'absolute' SoC (ASoC). This isn't the same as the SoC reported by the BMS. The BMS reports 'relative' SoC (RSoC). This includes reserves that protects the battery health and capacity degradation over time (SoH)

SoC

Minimum State of Charge (Min Soc)

Also called 'Backup Min SoC' as this value is only used when you are operating off grid (in EPS Mode). This is normally set to the minimum value of 10% with 90% depth of discharge. If your system is operating normally, setting this higher than 10% is generally not recommended as it means the battery capacity you have paid for will not be available to use.

Once the batteries get to Min Soc, the inverter will stop discharging the batteries and EPS power will not be available.

If your battery is specified with a depth of discharge of 100%, you may decide to set Backup Min SoC to less than 10% but also check 'Float Charge' below for more information

Minimum State of Charge On Grid (Min Soc On Grid)

Also called 'System Min SoC' and normally set to 10% (the same or more than Backup Min SoC).

This is the main setting for the minimum state of charge when grid power is present and you are operating in a basic operating mode. For the most part, this setting determines when the batteries will stop being used.

Setting this higher than Backup Min SoC will reserve battery power for a grid outage. For example, if you set Min Soc On Grid to 20%, the inverter will stop supplying power from the batteries at 20% and the house load will be supplied from the grid. If there is a grid outage, the batteries will be used to supply emergency power (via EPS) until the battery charge drops to 10%. At 10%, the inverter will cut off the EPS power.

If you are using Mode Scheduler, this setting is not used. The Min SoC set within each of your schedule time periods will be used. Read about how setting Min SoC works here.

Float Charge

Damage to LFP battery cells occurs if the battery is fully discharged. The battery looses it's ability to hold charge and may not be able to charge at all. To avoid this, the BMS will monitor the battery and request the inverter to charge from the grid if the SoC falls too low. With current firmware, this happens when the battery SoC falls 4% below the Min SoC setting and requests a 4A charge until Min SoC is restored. This is called a float charge.

The float charge is needed as the BMS runs directly from the battery and, without this, the BMS itself will discharge the battery and damage it. The only time this does not happen is when the battery is turned off.

This leads to an important point about setting Min SoC: if you set your Min SoC too low, the float charge may not kick in and the battery may be damaged as it will discharge below 0%. It is important to maintain some charge in the battery in case there is an inverter fault: in a fault condition, the inverter may not be able to provide a float charge and the battery will discharge completely and be damaged. Keeping some charge in the battery is an important safeguard for the battery health as you may not be aware of an inverter fault for some time This is the main reason why Fox ESS recommends a Min Soc of 10%.

If your inverter gets into a permanent fault condition, you need to turn off the battery to avoid it being damaged until the fault can be rectified.

Grid Charge Times

Battery charge times are available in the Fox Cloud from Quick Settings. The charge times allow you to set up to 2 time periods when the battery will be charged from the grid or where discharge is disabled (Force Charge). These are explained below.

As an alternative, you can use schedules to set up to multiple time periods, including Force Charge and Force Discharge Work modes.

Using schedules will disable any grid charge times you have set.

Enable Charge from Grid

Switching 'Enable Charge from Grid' on in the battery settings causes the inverter to charge the batteries from the grid during the associated time window e.g. Charge from grid 02.00 - 04.55. During the time window, the inverter will not supply the house load, but will instead draw power from the grid to charge the batteries. Once the battery is charged, the inverter will maintain the level of charge and will not supply the house load from the battery until the time window ends. This is useful if, for example, you wish to charge an EV, as the power will come from the grid while the batteries are held at the charge level set by Max SoC.

Battery Hold

If 'Enable Charge from Grid' is off in the battery settings, and you set a time window, the inverter will not charge or discharge the batteries and the house load will be met from the grid. This is useful if, for example, you have a cheap rate tariff that you wish to use to run appliances or charge an EV but do not wish to charge (or discharge) the batteries, such as during summer when all charging might be done during the day from PV.

Force Charge / Force Discharge Work Modes

With newer inverter firmware (H1 v1.70 and later, for example), there are options to schedule work modes that provide another way to charge and discharge your batteries. See Inverter Work Modes for more information.

Maximum State of Charge (Max Soc)

Also called System Max SoC. This setting controls charging from grid when using grid charge times only. If you use Mode Scheduler for charging from the grid, the Max SoC is set within the time period using either Max SoC or Cut off SoC (FC SoC), depending on your inverter model.

On newer gen 2 inverters (KH, H3 Smart), there are now 2 settings in the installer menus - Max SoC and Max SoC On Grid. Some users have reported that System Max SoC controls charging from solar (depending on the firmware you have). If you do reduce use this setting and limit charging from solar, remember that the BMS requires regular charging to 100% SoC to maintain its calibration.

Charge Current

By default, the battery charge current will be set to allow the inverter to deliver it's maximum power output when charging the batteries. For example, with a 6kW inverter and 4 x HV2600 with a nominal battery voltage of 52v, the overall battery voltage is 208v and the charge current is around 28A (208v x 28A = 5.8kW). This means the battery will add around 5.8kWh per hour of charging.

The maximum charge current can be changed via the inverter front panel or Modbus. Reducing this limits the current (and hence power) that the inverter is allowed to use when charging the batteries. Charging the batteries at maximum current may lead to cell imbalance, higher temperatures (which means greater losses) and a reduction in battery capacity and performance. Limiting the battery charge current means the batteries get a more gentle charge (referred to as trickle charging).

The downside to doing this is a longer charge time. Taking the example above and limiting the charge current to 13A, the charge power is 2.7kW and it will only add 2.7kWh per hour of charging.

Limiting the power used for charging can also enhance the amount of power available for export, although this could also lead to clipping if the inverter also has an export limit set.

If you want to charge your battery over a longer period of time, by reducing the maximum charge current, you need to work out the amount of energy you want to add. For example, if you want to add 6kWh to a battery, over 3 hours, you want to limit the charge power to around 2kW or 2,000 watts. If your battery voltage is 210v, the charge current needs to be 9.5A (2000w/210v). Round up to maximum charge current of 10A or 11A to make sure the battery charges in the 3 hour window.

Residual

The BMS tracks the amount of energy in the battery, known as the Residual or Remaining Energy and the Fox app now displays this as part of the battery details. In Home Assistant integrations, this is called 'BMS kWh Remaining'. In Energy Stats, tap the battery SoC % to see the Residual kWh.

What the Home Assistant sensor and API returns depends on the BMS firmware. With older firmware, this value is the Remaining Energy in the battery i.e. the amount of energy stored now. With newer firmware, this value is the Remaining Capacity of the battery i.e. the maximum amount of energy that can be stored. This value is available in the Fox cloud data and via Modbus for some inverter models.

In this integration, there is a setting 'Residual Handling' that sets how Residual should be managed. If the BMS returns Remaining Energy, set this value to 1. If the BMS returns Remaining Capacity, set this value to 2. The integration will then adjust the Battery Capacity and Battery Energy values appropriately.

Battery Life

The BMS keeps track of the amount of charge and discharge energy passing through the batteries and works out:

  • how many battery cycles have been used
  • the total battery energy throughput

The battery energy throughput is the Total Charged Energy + Total Discharged Energy (see battery details in the app). This is used to determine the level of battery wear in the warranty terms and conditions. Some people argue energy throughput should just be the amount charged but this is not correct. For example, if you drove to work each day, a distance of 10 miles, your car mileage goes up by 20 miles a day (not 10 miles). Battery wear occurs because a current is flowing, regardless of the direction.

This integration uses this data to calculate these properties:

  • Battery Life Remaining: this is calculated using the date your system was installed and the BMS cycle count to estimate the number of years of battery life remaining. It looks at the number of cycles used since your system was installed and works out the number of days remaining until your cycle count will reach 6,000. This is displayed as the number of years of battery life remaining.
  • Battery Warranty Remaining: this is calculated using the Energy Throughput to date and the energy allowance given in the Fox ESS Battery Warranty Policy
  • Battery Energy per Cycle:: this is calculated using the total battery charge and discharge energy recorded by the inverter and the number of cycles consumed. The total energy is divided by the number of cycles to give an average battery energy per cycle. This is useful as it allows you to estimate the impact on battery life of recycling energy through your batteries using force charge / discharge.

Battery SoH

Battery SoH or State of Health shows how much the battery capacity degrades over time, referred to as Calendar Ageing. When the battery is new, this value should be 100% but it will reduce with the amount of charge and discharge energy passed through the battery (Energy Throughput).

SoH = Residual Capacity in kWh / Battery Specification in kwH x 100

Fox provides a battery performance warranty. This varies across products but typically the SoH is guaranteed to be 70% or more after 10 years, subject to a maximum Energy Throughput.

Although calendar ageing implies a linear reduction in capacity over time, this is not the case. The capacity of a new battery falls in relation to Energy Throughput. The rate of decline is highest in the first 12 months and tends to flatten after this. The rate of decline is also determined by the size and the way the battery is used. A small battery that is fully charged and discharged every day has a higher relative energy throughput than a larger battery that is only partially charged and discharged every day. The regular use of Force Discharge also accelerates the fall in SoH as it directly adds to the Energy Throughput.

Battery Temperature

Cell temperature is critical to battery performance and capacity. The BMS monitors the temperature of each cell and shows this in the app as an icon that appears on the home page when the battery is cold. The lowest cell temperature is shown under the battery details:

cold battery

When the batteries are very cold, the BMS will try to charge to keep them at an optimal temperature. If the batteries are too warm or too cold, the BMS will also restrict the charge / discharge current to avoid damaging the cells.

When the cell temperature is too high or too low, the BMS will limit the charge rate (current) according to this chart, it seems:

derating

The effect of current limiting on battery charging depends on the inverter power rating and the number of batteries. For example, if you have a 5kW inverter and your battery voltage is around 212v: the normal charge power is 4.85kW and the charge current is 22A (97% of 5kW / 212v). The battery charge rate will be reduced when the lowest cell temperature drops below 21C and the charge power will be reduced to 3.18kW (212 x 15)

If the same inverter has a battery voltage around 108v: the inverter has a 35A current limit, so the 'normal' charge power is 3.78kW (108 x 35). When the lowest cell temperature drops below 21C, the current limit is reduced to 15A and the charge power drops to 1.6kW (108 x 15).

If you have the Energy Stats app, you can go to Settings, Battery and tick 'Show battery max charge current' to see the BMS Max Charge Current on your home page.

max charge currebnt

Battery Heating

Some batteries have built-in heaters to enable them to work in lower temperatures. If you have these, you may have a sticker that says WARM on the battery or the battery model may have a suffix of H or (W). The heater settings should appear in the app under Quick Settings. If you don't see an option for battery warm up, you may need to ask your installer to update your inverter and battery firmware.

Enabling the battery heating consists of setting a start and end temperature and optional time to warm from the grid (similar to charging from the grid). If the battery SoC is over 40%, the battery can warm itself but under 40%, it must use the grid or solar.

battery warmup

When the battery is warming using the grid, it works like battery charging but the battery does not charge or discharge. It's important not to set the battery end temperature too high, or the battery won't be available and may never reach the temperature you set. For many people, keeping the battery above 11C will work.

Although the battery warm up will help, on cold days, there is no real substitue for using some insulation boards (e.g. Kinspan) in the Winter to keep the battery temperature up and reduce the time spent with the heaters on.

Cell Imbalance

With a Modbus connection to the inverter, you can see BMS sensors that monitor the battery cell voltages and temperatures. Cell data can also be accessed via Advanced / Remote Settings in Fox App v2.0 and web site via this battey script.

Each cell is approx. 3.3v and there are 16 cells in series per HV2600 battery (16 x 3.3 = 53v per battery). The BMS reports the highest and lowest cell voltages (sensor.bms_cell_mv_high and sensor.bms_cell_mv_low). The values of the cell voltages vary with the level of charge but the difference between the highest and lowest cell voltages indicates how well balanced the cell (and batteries) are. To make it easier to monitor this, I calculate the cell imbalance as a % with this template:

    # calculate cell imbalance as % using the difference between min and max cell voltage
    - name: "Battery Cell Imbalance"
      unique_id: foxess_inv1_battery_cell_imbalance
      unit_of_measurement: "%"
      state: >
        {% set cell_high = states('sensor.bms_cell_mv_high') | float(default=-1) %}
        {% set cell_low = states('sensor.bms_cell_mv_low') | float(default=-1) %}
        {% set imbalance = ((cell_high - cell_low) | abs) / (cell_high + cell_low) * 200 %}
        {% set imbalance = 'Unavailable' if cell_high <= -1 or cell_low <= -1 else imbalance | round(2) %}
        {{ imbalance }}

When there are significant charge or discharge currents through the batteries, the cell imbalance can peak in the region of 2% to 3% for a short time, but then generally settles to around 0.2%.

Battery Diagnostics and Balancing

If you think you have a problem with your batteries, you can do some simple diagnostics if you run this battery script.

You can also use a multimeter if are comfortable working with DC voltages and connecting / disconnecting the battery cables when the system is switched off.

Fox ESS specifies a test as part of the installation of the batteries: measuring the overall battery voltage prior to system switch on. The expected range of the battery voltage is 52v x n +/- 10v. For example, if you have 4 x HV2600, this means a typical battery voltage of 208v with a range between 198v and 218v. If you have 6 x HV2600, the typical battery voltage is 312v with a range of 302v to 322v.

If you need to delve deeper into battery performance and capacity, you can split the stack apart and check / charge specific batteries:

  • To help track your batteries, number the packs starting from the BMS, 1 to 4 going top to bottom and then 5 to 8 going bottom to top, depending how many you have.
  • You can now switch off, break the stack apart and measure the voltage presented by each battery, record it and track it against the level of charge. A fully charged HV2600 battery is expected to present a voltage between 53.1v and 53.4 volts.
  • If you find batteries with a significantly lower voltage, you can manually balance the batteries by connecting them to the BMS (minimum of 2 batteries), setting the DIP switch correctly (n-2) and charging / checking until they show the same voltage as the others.
  • Once the batteries all measure the same voltage, you can rebuild the stack and charge / discharge them together.

Each time you make a change, it may take a while for the BMS SoC to recalibrate as it works out the capacity of the attached batteries. Monitoring the battery current can help you work out when the BMS is charging the batteries.

⚠️ **GitHub.com Fallback** ⚠️