Skip to content

Conversation

@Flix6x
Copy link
Contributor

@Flix6x Flix6x commented Dec 9, 2025

Description

  • Support setting a resolution when triggering a schedule via the API
  • A similar --resolution option in the CLI for flexmeasures add schedule
  • Fix conversion of the storage efficiency per device (which is defined relative to the resolution of each device's power sensor) to the scheduling resolution (which defaulted to the smallest non-zero resolution amongst the devices)
  • Fix resampling the scheduling results to the resolution of the power sensor of each device
  • Added changelog item in documentation/changelog.rst

Look & Feel

...

How to test

  • Added coverage for sensor API in test_trigger_and_get_schedule
  • Added coverage for asset API in test_asset_trigger_and_get_schedule

Further Improvements

  • Needs to be followed up with a flexmeasures-client PR

Related Items

Closes #1856.

...

Flix6x added 10 commits December 9, 2025 11:05
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
…resolution

Signed-off-by: F.N. Claessen <felix@seita.nl>
…tion

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
…l on the tick

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
@Flix6x Flix6x added this to the 0.31.0 milestone Dec 9, 2025
@Flix6x Flix6x self-assigned this Dec 9, 2025
@Flix6x Flix6x added enhancement New feature or request API Scheduling labels Dec 9, 2025
@read-the-docs-community
Copy link

read-the-docs-community bot commented Dec 9, 2025

Documentation build overview

📚 flexmeasures | 🛠️ Build #30897915 | 📁 Comparing 3225d0b against latest (62b4f20)


🔍 Preview build

Show files changed (4 files in total): 📝 4 modified | ➕ 0 added | ➖ 0 deleted
File Status
changelog.html 📝 modified
_autosummary/flexmeasures.api.v3_0.assets.html 📝 modified
_autosummary/flexmeasures.api.v3_0.sensors.html 📝 modified
api/v3_0.html 📝 modified

Signed-off-by: F.N. Claessen <felix@seita.nl>
Flix6x added 3 commits January 5, 2026 10:41
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Flix6x added 5 commits January 5, 2026 12:05
…g job to sequential scheduling jobs

Signed-off-by: F.N. Claessen <felix@seita.nl>
…lution

Signed-off-by: F.N. Claessen <felix@seita.nl>
…set scheduling

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
@Flix6x Flix6x requested a review from nhoening January 6, 2026 00:15
Signed-off-by: F.N. Claessen <felix@seita.nl>
Flix6x added 2 commits January 6, 2026 10:08
This reverts commit e252d27.

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Copy link
Contributor

@nhoening nhoening left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this in the CLI via the first tutorial and ran into a problem.

I used docker compose and ran the script, only with --resolution PT2H added to the flexmeasures add schedule command.

The function ensure_prices_are_not_empty() complained (see below), I suspect because get_continuous_series_sensor_or_quantity() cannot get the data if the resolution passed to it doesn't match the sensor resolution? I did not pursue that until the end (TimedBelied.search()).

 File "/usr/local/lib/python3.12/dist-packages/flexmeasures/cli/data_add.py", line 1444, in add_schedule
    success = make_schedule(
              ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/flexmeasures/data/services/scheduling.py", line 584, in make_schedule
    consumption_schedule: SchedulerOutputType = scheduler.compute()
                                                ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/flexmeasures/data/models/planning/storage.py", line 1318, in compute
    ) = self._prepare(skip_validation=skip_validation)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/flexmeasures/data/models/planning/storage.py", line 187, in _prepare
    ensure_prices_are_not_empty(up_deviation_prices, consumption_price)
  File "/usr/local/lib/python3.12/dist-packages/flexmeasures/data/models/planning/utils.py", line 96, in ensure_prices_are_not_empty
    raise UnknownPricesException(error_message)
flexmeasures.data.models.planning.exceptions.UnknownPricesException: Prices unknown for planning window. (sensor 1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scheduling with custom resolution

3 participants