Skip to content

Predictive charging — Real-Time Price mode

Activates or deactivates grid charging every controller cycle (event-driven) based on the current electricity price.

Unlike Dynamic Pricing mode, it requires no price forecast and no overnight evaluation. It reacts purely to the live price.

Deadline-based slot selection is intentionally not applied in this mode: a current-price sensor provides no trustworthy future intervals to reserve before a deadline. The energy balance and per-battery target remain predictive, but selecting or promising a future slot would require switching to Dynamic Pricing. Configured charge-permission windows and all physical blockers still apply.

Configuration

Field Description
Electricity price sensor Any HA sensor with the current period price (PVPC, Nordpool, CKW…)
Maximum price threshold (€) (Optional) Price below which grid charging activates
Daily average price sensor (Optional) Dynamic threshold instead of a fixed value
Only discharge when price exceeds threshold (Optional) Price-gated discharge — see below
Solar forecast safety margin (kWh) Extra energy buffer added to the consumption forecast before deciding whether to charge (default 0 kWh)
Predictive grid charge margin (%) Tops up the grid-charge amount to hedge optimistic solar forecasts — e.g. a 2 kWh grid need at 50 % charges 3 kWh. Capped at the gap to max SOC (default 0 %)

Configuration form — Real-Time Price mode

Charging behaviour

Every cycle (event-driven) the controller evaluates whether to start or stop grid charging:

If current_price ≤ threshold:
    And if (battery + solar) < expected_consumption:
        → Activate grid charging
If current_price > threshold:
    → Deactivate grid charging

The energy balance (battery + solar vs. expected consumption) is evaluated before starting charging, the same as in other modes.

Threshold resolution

The threshold is resolved in this priority order:

  1. Daily average price sensor — if configured and available, its value is the dynamic threshold.
  2. Maximum price threshold — static numeric value configured in the setup flow.

If neither is available, the mode does not act.


Price-based discharge control

The "Only discharge when price exceeds threshold" option adds an extra condition to discharge behaviour, independent of charging.

When active, every controller cycle (event-driven) checks whether the current price justifies discharge using the same threshold as for charging:

If current_price > threshold:
    → Discharge allowed (PD controller operates normally)
If current_price ≤ threshold:
    → Discharge BLOCKED (battery holds)

The inverse logic of charging: charge when price is low, discharge when price is high.

Interaction with time slots

If time slots are configured to restrict discharge, both conditions must be met:

Discharge allowed = within_discharge_time_slot AND current_price > threshold

Effect on the PD controller

When discharge is blocked by price, the controller completely freezes its state (power to 0, no derivative term update), the same as during a time slot restriction. The battery resumes smoothly as soon as the price exceeds the threshold.


Differences from Dynamic Pricing

Feature Dynamic Pricing Real-Time Price
Price forecast required ✅ ❌
Overnight evaluation (00:05) ✅ ❌
Reacts to live price ❌ ✅
Optimal hour selection ✅ ❌
Discharge threshold Daily average (calculated at 00:05) Configurable threshold (fixed or dynamic sensor)

Real-Time Price remains reactive: it uses the normalized remaining total for its gate and does not consume the learned temporal curve or create future deadlines. A future anticipatory implementation should enter through the same chronological planner as the other scheduling modes.