Battery Forecast#

The central module of GbbOptimizer. It analyzes SOC of the battery for the next 24 hours (or more) based on PV charging, grid charging, discharging, and home consumption. It includes an optimizer that automatically selects charging and discharging parameters.

In this module you can:

  • Analyze the battery SOC forecast for the next 24 hours
  • See when SOC exceeds minimum or maximum values
  • Optimize charging and discharging plans
  • View purchase and sale prices and profits

Forecast Table Columns#

The table shows data for the next 24 hours. Abbreviations: DC = direct current, AC = alternating current.

Battery#

ColumnDescription
DayDay
HourHour of the given day
Start battery % (kWh) AC/DCBattery SOC and kWh at the start of the hour (in AC and DC)
PV Forecast (kWh AC)PV production forecast for this hour
PV Forecast % (kWh DC)How many kWh from PV go to the battery (after DC conversion), after subtracting home consumption
Consumption +Extra (kWh AC)Home consumption forecast (including Extra Consumption)
Consumption +Extra % (kWh DC)How many kWh drawn from the battery to cover consumption minus PV
Grid charging (kWh AC)How much drawn from the grid to charge the battery
Grid charging % (kWh DC)Same as above, after DC conversion
DischargingDischarge Plan status for this hour
Discharging (kWh AC)How much sent from the battery to the grid (in AC)
Discharging % (kWh DC)How much sent from the battery to the grid (in DC)
End battery (kWh AC)kWh in the battery at the end of the hour. = Start AC + PV AC - Consumption AC + Charging AC - Discharging AC
End battery % (kWh DC)SOC and kWh at the end of the hour. = Start DC + PV DC - Consumption DC + Charging DC - Discharging DC
Below Min“Yes” = end battery may drop below MinSOC
Above Max“Yes” = end battery may exceed MaxSOC

Profit#

ColumnDescription
Profit amount= Consumption amount - (Purchase amount - Battery value change) + Sale amount - Battery cost amount
Unpaid energy amount= Sale amount - (Purchase amount - Battery value change) - Battery cost amount
Battery cost amount“Battery usage cost per kWh” × “Battery charging kWh” — battery depreciation
From grid (kWh)How much drawn from the grid in this hour
Purchase priceEnergy purchase price
Purchase amountFrom grid × Purchase price
To grid (kWh)How much sent to the grid
Sale priceEnergy sale price
Sale amountTo grid × Sale price
Consumption (kWh)Home consumption
Consumption pricePrice of energy consumed by the home
Consumption amountConsumption × Consumption price

Battery Energy Value#

ColumnDescription
Battery charging (kWh)>0 charging, <0 discharging — how much energy went to/from the battery
Grid charging (kWh)How much energy sent to the battery comes from the grid
Discharging (kWh)How much energy drawn from the battery
Start kWh in batteryEnergy in battery at the start of the hour (above MinSOC%)
Start valueValue of energy in the battery at the start of the hour
End kWh in batteryEnergy in battery at the end of the hour (above MinSOC%)
End valueValue of energy in the battery at the end of the hour
Value change= End value - Start value. Discharging: Discharging kWh × Average price from previous hour. Charging: Grid charging kWh × Purchase price
Average end priceEnd value / End kWh in battery

Optimizer#

After clicking Run Optimizer now, the program can change:

  • SOCLimit in the Charging module (and even block charging)
  • MinSOC in the Discharging Plan
  • Disable DDBD (Dynamic Battery Discharge Blocking)

Optimizer 1: SOC-based#

“Charging/Discharging is optimized based on SOC (with additional optimizers)”

This optimizer tries to:

  • Reach 100% (or MaxSOC) at some point (but not for too long)
  • Keep the battery above MinSOC — which is more important
  • Uses the set charging and discharging times (these must be manually configured beforehand)
  • Can be combined with Dynamic Discharge and Dynamic Charge
  • Can charge the battery at night (cheap tariff) to leave room for PV during the day
  • Can discharge the battery at high prices so that PV charges it to MaxSOC
  • If the purchase price < 0, charging during those hours is set to MaxSOC

Optimizer 2: Price-based recommended #

“Charging/Discharging is optimized based on purchase and sale prices (to increase Profit)”

Tries to maximize the sum in the “Profit amount” column — finds the best combination of charging/discharging for each hour.

After optimization, the new settings are not automatically sent to the installation. Check the results, then press Send new SOCLimit from Charging to Installation.

  • Should be run every hour
  • Requires the import in the Gains module to run every hour
  • Charging when energy is never consumed (because the forecast runs for 24h) is “free” — at the end of the period, excess charging often appears. Wait a few hours for a better forecast
  • Each additional enabled option reduces profits!

Price-based Optimizer Parameters#

SOC#

ParameterDescription
I prefer to have more in the battery than lessStrategy for situations where different charge levels give the same profit: Level 0 — prefer not to charge. Level 1 — prefer to charge more. Level 2 — prefer to charge more + prefer charging over not charging (for G12w tariff)
Maximum battery SOC (%)The optimizer tries not to exceed this value
Minimum battery SOC (%)The optimizer tries not to go below this value
Increase Min/Max SOC by X if PV Forecast < YIncrease battery reserve when PV forecast is low
Force MaxSOC (100%) daily — UPSOnce a day for 2–3h the battery is charged to 100%
… only during optimization from midnight to sunriseForcing calculated only at night — if the weather forecast drops, the program does not try to reach 100% during the day
… replace sunset with a fixed hourE.g. the end hour of cheap tariff instead of sunset

Battery Balancing#

ParameterDescription
Minimum SOC to consider as balancingSOC from which the program considers balancing to be in progress. If SOC drops slightly — enter a lower value
Must last at least (hours)Duration of balancing
List of days in month for 3h×100%Force balancing on these days of the month (comma-separated)
How many days back to check 3h×100%Prevents too-frequent balancing
After how many days to hold 3h×100% againAlternative forcing: every X days from the previous one
Manually force 3h×100% todayOne-time forcing, disables itself after balancing
3h×100% if price < … for at least … hoursForce balancing when purchase price is low

Charging and Discharging#

ParameterDescription
Battery charging from gridAllows disabling grid charging
Battery discharging to gridAllows disabling discharging (or keeping the Discharge Plan settings)
Min price difference for grid dischargingMinimum difference between battery energy price and sale price. Value 0 = the program does not discharge at a loss
Do not discharge when sale price < XBlocks discharging at low sale price
Do not discharge when purchase price < XBlocks discharging — idea: in cheap tariff draw from grid, charge battery from PV, discharge at expensive tariff
Do not charge from grid when purchase price > XBlocks charging at too high a price

Grid Import / Export#

ParameterDescription
Try not to import from gridThe optimizer avoids drawing from the grid (but it may happen). To completely block — check “Locked” in the Charging module
Try not to export to gridThe optimizer avoids export (from PV and battery)
Do not sell more than the non-adjusted 24h PV forecast(Option for PL) Blocks selling more from the battery than was produced from PV. Computation cost: O(n)
Try not to export when sale price < 0Avoid export at negative prices

Other Parameters#

ParameterDescription
Block entry above MaxSOCForces discharging to MaxSOC
Block drop below MinSOCForces charging to MinSOC
Do not charge from grid when EV will be chargingDuring EV charging — no battery charging from grid
Do not discharge when EV will be chargingDuring EV charging — no battery discharging
Test EV charging every 5 minAuto-detection of EV charging and disabling battery charging/discharging. No need to enter in advance
Try to forecast > 24hThe optimizer considers more hours (until the end of known prices). May disable itself if it takes too long
Do not revert to “do nothing” forecastDisables checking whether the devised forecast is worse than “do nothing”
Calculate energy cost at the time of chargingNormally the cost is settled at the time of consumption. This option settles at the time of purchase
Min/Max SOC at the end of forecastForcing SOC level at the end of the forecast
Battery usage cost per kWh= Battery purchase cost / (number of cycles × capacity kWh). We recommend leaving it empty

Run Schedule#

Time intervalsOptimizerExport to inverter
24 (60 min)after x:00after x:00 (retry on error)
48 (30 min)after x:00 and x:30after x:00 and x:30 (retry on error)
96 (15 min)after x:00 and x:30after x:00, x:15, x:30, x:45

Testing Scenarios#

To test different scenarios:

  • Create more than one Consumption Profile
  • Create more than one Discharge Plan
  • Temporarily disable the PV forecast (worst case scenario)
  • In the Charging module, set “New Start”, “New Duration”, and “New SOCLimit” without sending to the installation

In the Filters section, select the current Consumption Profile, Discharge Plan, and optionally disable the PV forecast.

Hourly Tasks#

When manual optimization works correctly — set the hours for automatic execution.

Best time (for the SOC optimizer): initial hours of active charging. If you use a Discharge Plan — best to run every hour.

To run:

  1. Check Automatically press: “Fetch all data” and “Run Optimizer”
  2. Check … and “Send new SOCLimit to Installation”
  3. Add one or more hours

Additional Options#

OptionDescription
Also run at half-past the hourFor 24 intervals (60 min): additional run at x:30. Not recommended
Send data to inverter earlierFirst send settings (calculated an hour earlier), then run the optimizer, then send new settings. Useful when the optimizer takes 4–5 min. For 96 intervals: always enabled
Fetch PV Forecast only during Hourly TasksPV forecast imported only during hourly tasks (not during “Fetch all data”). Allows you to see the last forecast used in optimization