Skip to content

Feat/dynamic soc at start#2026

Draft
BelhsanHmida wants to merge 3 commits intomainfrom
feat/dynammic-soc-at-start
Draft

Feat/dynamic soc at start#2026
BelhsanHmida wants to merge 3 commits intomainfrom
feat/dynammic-soc-at-start

Conversation

@BelhsanHmida
Copy link
Contributor

@BelhsanHmida BelhsanHmida commented Mar 16, 2026

Description

  • Use state-of-charge as a fallback source for soc-at-start in storage scheduling
  • Support inferring start SoC from either recent sensor beliefs or a provided SoC time series
  • Raise an error when a configured state-of-charge source is stale or missing near schedule start
  • Keep the existing fallback behavior afterwards and remove the CLI requirement for explicit --soc-at-start
  • Add test coverage
  • Added changelog item in documentation/changelog.rst

Look & Feel

No UI changes.

API / CLI behavior change:

  • Storage scheduling now works without explicit soc-at-start when state-of-charge is configured and has a recent value
  • Storage scheduling now fails fast when state-of-charge is configured but stale / missing around schedule start

How to test

Run:

  • pytest -q flexmeasures/data/models/planning/tests/test_storage.py -k "state_of_charge or soc_at_start"
  • pytest -q flexmeasures/api/v3_0/tests/test_sensor_schedules_fresh_db.py -k "state_of_charge_sensor_for_soc_at_start"
  • pytest -q flexmeasures/cli/tests/test_data_add_fresh_db.py -k "state_of_charge_sensor_for_soc_at_start"

Manual checks:

  • Trigger a storage schedule without soc-at-start but with a recent state-of-charge sensor value and confirm scheduling succeeds
  • Repeat with only a stale SoC value and confirm scheduling errors instead of silently falling back

Related Items

closes #1895

Sign-off

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on code under GPL or other license that is incompatible with FlexMeasures

@read-the-docs-community
Copy link

Documentation build overview

📚 flexmeasures | 🛠️ Build #31821934 | 📁 Comparing 0cfff19 against latest (4c06249)


🔍 Preview build

Show files changed (5 files in total): 📝 5 modified | ➕ 0 added | ➖ 0 deleted
File Status
_autodoc/STATE_OF_CHARGE.html 📝 modified
_autosummary/flexmeasures.data.models.planning.storage.html 📝 modified
api/v3_0.html 📝 modified
features/scheduling.html 📝 modified
tut/forecasting_scheduling.html 📝 modified

@Flix6x Flix6x changed the title Feat/dynammic soc at start Feat/dynamic soc at start Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support dynamic soc-at-start

1 participant