Adjust the charging rate on a charging event¶
- Config option:
charge_rate_multiplier - Default: 1.1
When Batcontrol reaches the lowest point in the price curve, it determines which future hours exceed a minimum price threshold. For those hours, it retrieves the required Wh from the load profile, and those Wh are then recharged.
charge_rate = required_recharge_energy/remaining_time
charge_rate * charge_rate_multiplier = final_charge_rate
if final_charge_rate < 500W then charge_rate = 500W
Example:
We are currently at a price of €0.30. We plan to recharge for two hours during which the price will exceed €0.35, and we will need 600 Wh and 400 Wh respectively. The battery is empty, so we recharge a total of 1,000 Wh. Because there are conversion losses, we use the charge_rate_multiplier to increase the charging power:
1,000 Wh * 1.1 = 1,100 W
With a multiplier value of 1.0, you may observe that the charging power ramps up over the course of the hour because the setpoints are reached too slowly. At a value of 1.5, the target is reached more quickly and then charging slows steadily as the hour progresses.

Adjust Charging pricepoint¶
- Config options:
soften_price_difference_on_charging; true / false - Enable / Disablesoften_price_difference_on_charging_factor; 5- Default: disabled
By default, Batcontrol checks:
found_lower_price = future_price <= current_price
How the Soften Mechanism Works¶
When you enable soften_price_difference_on_charging (by setting it to True), Batcontrol modifies the current price by a fraction ( soften_price_difference_on_charging_factor ) of min_price_difference:
modified_price = current_price - min_price_difference / self.soften_price_difference_on_charging_factor
found_lower_price = future_price <= modified_price
Example¶
Let's assume:
current_price = 0.30 €/kWhmin_price_difference = 0.02 €/kWhsoften_price_difference_on_charging = Truesoften_price_difference_on_charging_factor = 2.0
Then
modified_price = current_price - min_price_difference / self.soften_price_difference_on_charging_factor
= 0.30 - (0.02 / 2.0)
= 0.30 - 0.01
= 0.29
€0.29/kWh. If the next hour’s price is €0.295/kWh (which is indeed lower than €0.30/kWh), Batcontrol will not count it as cheap enough to interrupt the current evaluation period—because €0.295 is still higher than `€0.29.
Without soften_price_difference_on_charging, Batcontrol would see €0.295 as cheaper than €0.30, so it does not evaluate for chasing a marginally lower price. By introducing this “softening” factor, we allow batcontrol to decide earlier how much energy needs to be charged. This helps in scenarios where the battery can not be charged to maximum within one hour. It ensures Batcontrol waits for a more significant price drop before adjusting its strategy, too.
The downside is, that not each cent of saving is achieved.
Charging window (spread grid charging)¶
- Config option:
spread_grid_charge_over_charge_window; true / false - Default: enabled
- Only effective when
soften_price_difference_on_chargingis enabled
With soften enabled, batcontrol already decides during a cheap block how much energy needs to be
charged. Without a charging window, the charge rate is calculated for the remaining time of the
current slot only. With 15-minute slots this requests very high charge rates (often capped at
max_grid_charge_rate) and the battery is full long before the cheap block ends.
With the charging window enabled, all directly following slots with a price lower than or equal to the current price are treated as one charging opportunity. The window ends at the first more expensive slot (even if it is only marginally more expensive) or at the end of the recharge evaluation window.
charge_rate = recharge_energy / (remaining time of current slot + slots in window * slot length)
Example: at 12:15 the price stays at 0.086 €/kWh until 15:00, 6.86 kWh need to be recharged:
- without charging window: 6.86 kWh / 0.25 h × 1.1 ≈ 30 kW (capped at
max_grid_charge_rate) - with charging window: 6.86 kWh / 2.75 h × 1.1 ≈ 2.7 kW
The charge rate is recalculated on every run. As the window gets shorter, the rate rises, so the
target energy is still reached before the expensive period starts. This leaves room for PV
production during the cheap block. Set spread_grid_charge_over_charge_window: false to restore
the previous behaviour (charge as fast as possible within the current slot).
Granularity in price calculations:¶
- Config option:
round_price_digits - Default: 4
round_price_digits¶
Config option: round_price_digits
Default: 4
This option defines how many decimal places the algorithm uses when comparing electricity prices. By default, Batcontrol rounds prices to 4 decimal places (e.g., 0.30345 becomes 0.3035). Since Batcontrol relies on precise comparisons (e.g., "greater than" or "less than") to determine when to charge or discharge the battery, the number of decimal places can significantly affect how it perceives small price differences.
Why Does It Matter?¶
-
Higher Precision (more decimal places)
If you increaseround_price_digits, Batcontrol will consider smaller price differences. This can lead to more frequent adjustments if tiny price variations cause the algorithm to switch between charging and not charging. -
Lower Precision (fewer decimal places)
If you decreaseround_price_digits, Batcontrol ignores subtle fluctuations below that rounding threshold. As a result, the algorithm behaves more conservatively and won't react to very small price movements.
Example¶
- 4 decimal places (default)
- A price of
0.30345 €/kWhis rounded to0.3035 €/kWh. - A price of
0.30344 €/kWhis rounded to0.3034 €/kWh. -
The difference (
0.3035 - 0.3034) is0.0001 €/kWh. -
2 decimal places
- Both
0.30345 €/kWhand0.30344 €/kWhbecome0.30 €/kWh. - The difference disappears, so Batcontrol sees them as the same price.
By adjusting round_price_digits, you can fine-tune how sensitive Batcontrol is to minor variations in the price curve. If your tariff data is very precise and you want every tiny fluctuation to matter, use more decimal places. If you prefer a more stable, less reactive charging strategy, you can reduce the decimal precision.
Adjust Solar Production Forecast¶
- Config option:
production_offset_percent - Default: 1.0
production_offset_percent (since 0.6.1)¶
Config option: production_offset_percent
Default: 1.0
This option allows you to adjust the solar production forecast by a percentage multiplier. This is particularly useful for scenarios where your actual solar production differs systematically from the forecast—such as during winter months when solar panels may be partially covered with snow, or when dust/dirt affects panel efficiency.
How It Works¶
The production_offset_percent parameter multiplies the entire solar production forecast. For example:
1.0= 100% of the forecast (no adjustment, default behavior)0.8= 80% of the forecast (20% reduction, useful for winter/snow conditions)1.2= 120% of the forecast (20% increase)0.5= 50% of the forecast (50% reduction)
The adjusted forecast is then used throughout Batcontrol's decision-making logic, affecting: - Charging recommendations based on solar production - Battery discharge decisions - Grid charging evaluations
Use Cases¶
Winter Mode (Snow Coverage)
battery_control_expert:
production_offset_percent: 0.7 # Reduce forecast to 70% during winter
0.7 helps Batcontrol make more conservative charging decisions and avoid over-discharging the battery when the predicted solar energy doesn't materialize.
Panel Degradation or Dirt
battery_control_expert:
production_offset_percent: 0.95 # 5% reduction for degraded panels
High-Efficiency Summer
battery_control_expert:
production_offset_percent: 1.05 # 5% increase during peak summer
Example Impact¶
Assume:
- Forecasted solar production: 5,000 W
- production_offset_percent: 0.8 (winter mode)
Then: - Adjusted forecast: 5,000 W × 0.8 = 4,000 W - Batcontrol will base its decisions on 4,000 W instead of 5,000 W
This conservative approach prevents Batcontrol from over-planning battery discharge based on overly optimistic solar forecasts.
Logging¶
When production_offset_percent differs from 1.0, Batcontrol logs the adjustment:
Production forecast adjusted by 80% (factor: 0.8)
This helps you verify that your offset setting is being applied correctly.