Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
43bb171
fix(TUNES): record a leakage behaviour instead of refusing it
Flix6x Nov 5, 2026
30dc81e
chore(types): check every source file, including untyped function bodies
Flix6x Nov 5, 2026
ff1304c
ci: measure the coverage of the S2 tests
Flix6x Nov 5, 2026
372a39a
chore(lint): no print() in the S2 code that runs unattended
Flix6x Nov 5, 2026
9ae5a5c
docs(changelog): FillRateBasedControlTUNES records a leakage behaviour
Flix6x Nov 5, 2026
f791bdb
chore: close the gaps an adversarial review found in the instruments
Flix6x Nov 5, 2026
5ff631d
fix(FRBC): answer by the element that applies, whatever order S2 list…
Flix6x Nov 5, 2026
d0b1c1d
docs(changelog): the element that applies, and what a standby mode st…
Flix6x Nov 5, 2026
b572a86
fix(FRBC): plan with the element where the schedule starts, not the l…
Flix6x Nov 5, 2026
9587c94
fix(TUNES): an operation mode without a label no longer stops planning
Flix6x Nov 5, 2026
4585f2f
fix(client): drop a content-type check that could not fire, nor be pr…
Flix6x Nov 5, 2026
c341c4a
chore(types): type check against what the code imports, S2 messages i…
Flix6x Nov 5, 2026
1928d56
docs(changelog): an unlabelled TUNES mode, and two helpers that never…
Flix6x Nov 5, 2026
2a644e6
fix: correct what this branch claimed, and test what review found unt…
Flix6x Nov 5, 2026
4d5435e
fix(FRBC): every rate per second, as S2 states it, under the instruct…
Flix6x Nov 5, 2026
d0ae8ce
docs(changelog): every rate per second under the instructions
Flix6x Nov 5, 2026
2387288
fix(FRBC): follow each step as a resource manager does, which review …
Flix6x Nov 5, 2026
2f8902c
fix(example): a heat pump with a buffer that is planned for, instruct…
Flix6x Nov 5, 2026
fa3dc59
docs(changelog): the example, and the planning triggers it needed
Flix6x Nov 5, 2026
10f1cc7
fix(FRBC): a state of charge in any supported energy unit reaches Fle…
Flix6x Nov 5, 2026
5ba8ee2
docs(changelog): which energy units a handler takes, and what FlexMea…
Flix6x Nov 5, 2026
324e7f2
fix(FRBC): follow each step exactly, between the moments anything cha…
Flix6x Nov 5, 2026
40479ae
Merge remote-tracking branch 'origin/dev/s2-frbc-complete' into fix/s…
Flix6x Nov 5, 2026
392ba50
fix(example): follow only the latest plan, keep the forecasts current…
Flix6x Nov 5, 2026
e3a5567
fix(example, FRBC): what the second review of the example round found
Flix6x Nov 5, 2026
c7fe0a7
docs(changelog): describe the example round as it now stands
Flix6x Nov 5, 2026
41a8f63
fix(example, FRBC): what the third review of the example round found
Flix6x Nov 5, 2026
bc90b2b
fix(FRBC): plan from the next boundary, not the start of the step und…
Flix6x Nov 5, 2026
a5c0dcb
Merge remote-tracking branch 'origin/fix/s2-example-heat-pump' into f…
Flix6x Nov 5, 2026
9824ea5
style(FRBC): keep the soc-at-start TODO off the line it annotates
Flix6x Nov 5, 2026
93e3ae3
feat(FRBC): a production price of its own, an opt-in relaxed site cap…
Flix6x Nov 5, 2026
506e7ec
Merge remote-tracking branch 'origin/fix/frbc-energy-unit' into feat/…
Flix6x Nov 5, 2026
6408b6f
fix(FRBC): what the review of the energy-unit change found
Flix6x Nov 5, 2026
fd45a98
Merge remote-tracking branch 'origin/dev/s2-frbc-complete' into feat/…
Flix6x Nov 5, 2026
11e9a39
test(FRBC): an overtaken plan sends nothing, whether dropped before o…
Flix6x Nov 5, 2026
7c8ae45
docs(changelog): the handler options, the dropped translation, and as…
Flix6x Nov 5, 2026
47d295d
fix(FRBC): send relax_site_capacity either way, or leave it to FlexMe…
Flix6x Nov 5, 2026
bcdbd79
feat(example): the site's graphs show the buffer, its comfort band, a…
Flix6x Nov 5, 2026
cc54bb6
docs(changelog): the example site's graphs
Flix6x Nov 5, 2026
c466752
fix(example): set the site graphs in the form every FlexMeasures reads
Flix6x Nov 5, 2026
0028494
fix(S2): a lost confirmation does not stall a session, and a closed s…
Flix6x Nov 5, 2026
1cc6261
test(S2): a message without a type activates nothing
Flix6x Nov 5, 2026
9053b86
docs(changelog): implicit activation and session teardown
Flix6x Nov 5, 2026
6b1d3ea
fix(S2): take only the control type being selected as confirmed, and …
Flix6x Nov 5, 2026
69f5dbe
test(S2): a typeless message activates nothing while a selection is p…
Flix6x Nov 5, 2026
80ad945
feat(S2): a clock the CEM and its handlers go by, which a co-simulati…
Flix6x Nov 5, 2026
5b9793e
docs(changelog): the clock and the simulation metadata
Flix6x Nov 5, 2026
47c695a
fix(S2): what the review of the clock found
Flix6x Nov 5, 2026
6a12ea4
feat(S2): a site of its own for each resource manager, and the co-sim…
Flix6x Nov 5, 2026
bffe6c9
docs(changelog): sites per resource manager and the co-simulation stack
Flix6x Nov 5, 2026
65b359f
fix(S2): what the review of the sites per resource manager found
Flix6x Nov 5, 2026
ccab11b
feat(S2): record measured power by when it was measured, in watts, on…
Flix6x Nov 5, 2026
809b136
docs(changelog): the measurement recorder
Flix6x Nov 5, 2026
ab56606
fix(S2): what the review of the measurement recorder found
Flix6x Nov 5, 2026
b8aff1d
fix(examples): the co-simulation stack runs on a current FlexMeasures…
Flix6x Nov 5, 2026
40288e8
docs(changelog): the co-simulation stack on FlexMeasures 1.1
Flix6x Nov 5, 2026
4807388
docs(examples): what the co-simulation stack runs, and how to build i…
Flix6x Nov 5, 2026
f0c4d4e
fix(FRBC): a state of charge is known as of the handler's clock
Flix6x Nov 5, 2026
2b5d481
docs(changelog): the state of charge on the clock
Flix6x Nov 5, 2026
16a0b24
Merge remote-tracking branch 'origin/dev/s2-frbc-complete' into fix/s…
Flix6x Nov 5, 2026
00d3676
feat(FRBC): plan one schedule at a time, for the newest request
Flix6x Nov 5, 2026
77de62c
Merge remote-tracking branch 'origin/dev/s2-frbc-complete' into feat/…
Flix6x Nov 5, 2026
401599b
docs(changelog): one schedule at a time
Flix6x Nov 5, 2026
29845ea
fix(FRBC): a request out of date makes no further attempt, so the new…
Flix6x Nov 5, 2026
5564983
docs(examples): the instance settings a co-simulation needs
Flix6x Nov 5, 2026
ad9a12b
Merge remote-tracking branch 'origin/dev/s2-frbc-complete' into docs/…
Flix6x Nov 5, 2026
309e283
fix(FRBC): the declared fill-level range reaches the server, as a ban…
Flix6x Nov 5, 2026
e8f14bc
Merge remote-tracking branch 'origin/dev/s2-frbc-complete' into fix/s…
Flix6x Nov 5, 2026
c34155a
fix(FRBC): the flex model offers only what the actuator may use, and …
Flix6x Nov 5, 2026
9a1ddf6
fix(FRBC): what the review of the declared band found
Flix6x Nov 5, 2026
fe65dcd
test(FRBC): an empty profile covers no step
Flix6x Nov 5, 2026
f8c46b1
fix(FRBC): a mode for abnormal conditions does not set the charging e…
Flix6x Nov 5, 2026
c96e137
Merge remote-tracking branch 'origin/dev/s2-frbc-complete' into fix/s…
Flix6x Nov 5, 2026
7c45746
feat(client): post_sensor_data(confirm_ingestion=True) raises where i…
Flix6x Nov 5, 2026
f32b44d
fix(FRBC): a failure is answered or said out loud
Flix6x Nov 5, 2026
1eb62eb
fix(FRBC): what the review of "a failure is answered or said out loud…
Flix6x Nov 5, 2026
2557896
fix(S2): housekeeping, and tests that pin what they claim to
Flix6x Nov 5, 2026
9cf4baf
Merge remote-tracking branch 'origin/dev/s2-frbc-complete' into fix/s…
Flix6x Nov 6, 2026
e2d5e8d
fix(FRBC): guard the display-only band posts; say a negative top need…
Flix6x Nov 6, 2026
ab2b0dc
fix(S2): a message set again is the latest; what the review of housek…
Flix6x Nov 6, 2026
f15b9e2
fix(S2): what the sweep of the whole branch found
Flix6x Nov 6, 2026
fa18fdd
docs(changelog): say once what the S2 integration ships since v0.9.0
Flix6x Nov 6, 2026
96c81ce
Merge remote-tracking branch 'origin/dev/s2-frbc-complete' into docs/…
Flix6x Nov 6, 2026
ea0b1d0
fix(FRBC): comments that later changes made false, and the unguarded …
Flix6x Nov 6, 2026
2f89b72
fix(FRBC): warn about transitions only where they rule a switch out
Flix6x Nov 6, 2026
e35ffd3
docs(changelog): say each S2 change plainly
Flix6x Nov 8, 2026
95cda29
docs(changelog): keep what the plain rewrite lost or shifted
Flix6x Nov 8, 2026
00a6136
test(S2): cover what the handler base, the CEM and the example server…
Flix6x Nov 8, 2026
4816024
test(FRBC): time the long-schedule translation in CPU time
Flix6x Nov 8, 2026
e1c9e64
docs(S2): say docstrings and comments plainly
Flix6x Nov 8, 2026
9f03188
docs(S2): keep what the plain rewrite of the comments got wrong
Flix6x Nov 8, 2026
a2fa1b8
Merge remote-tracking branch 'origin/dev/s2-frbc-complete' into docs/…
Flix6x Nov 8, 2026
2e62cf2
Merge origin/main (#278, squash-merged) into dev/s2-frbc-complete
Flix6x Nov 8, 2026
6f0bb1b
feat(FRBC): correct a usage forecast no plan can absorb, instead of c…
Flix6x Nov 8, 2026
2fa2829
fix(FRBC): what the review of the usage correction found
Flix6x Nov 8, 2026
f109c2b
docs(changelog): the usage correction
Flix6x Nov 8, 2026
024008b
fix(FRBC): bound a stored price on a sensor, as a co-simulation steer…
Flix6x Nov 8, 2026
7df9081
fix(FRBC): carry over only the stored fields a commodity entry accepts
Flix6x Nov 8, 2026
4a33140
fix(FRBC): leave the site's breach price out of the correction price
Flix6x Nov 8, 2026
4b7b023
fix(FRBC): state FlexMeasures' default site breach price in a correct…
Flix6x Nov 8, 2026
a31f1cf
fix(FRBC): count the site's stored inflexible devices once in a corre…
Flix6x Nov 9, 2026
905254e
feat(FRBC): record a negative expected usage as stated
Flix6x Nov 9, 2026
ef5739f
fix(FRBC): record an actuator status that arrived before any system d…
Flix6x Nov 9, 2026
d7d9f6c
docs(changelog): link #287
Flix6x Nov 9, 2026
58f9a15
docs(changelog): say that one sensor holds the charging efficiency of…
Flix6x Nov 9, 2026
f9b8d8a
feat(FRBC): plan the declared leakage as part of the usage
Flix6x Nov 9, 2026
6cd7f40
docs(changelog): link #289
Flix6x Nov 9, 2026
ca1bfb7
feat(FRBC): record fill rates, usage and leakage per hour, in kW for kWh
Flix6x Nov 9, 2026
83fbf23
feat(FRBC): take a fill_rate_unit, by default W
Flix6x Nov 9, 2026
8299241
docs(changelog): split the charging efficiency entry into short sente…
Flix6x Nov 9, 2026
197e0ff
test(FRBC): check the value of a posted fill rate, not only its unit
Flix6x Nov 9, 2026
d38f63c
Merge dev/s2-frbc-complete (#287) into docs/s2-changelog-efficiency-s…
Flix6x Nov 9, 2026
3b18345
feat(site): create a site's power sensors in W, like its rate sensors
Flix6x Nov 9, 2026
f2d9cca
feat(site): drop the warning about a kept sensor in another unit
Flix6x Nov 9, 2026
ebdc615
feat(FRBC): record rates of fill level in a fill_rate_unit, by default W
Flix6x Nov 9, 2026
c983c0e
feat(site): create a site's power and rate sensors in W
Flix6x Nov 9, 2026
e102532
docs(changelog): fill_rate_unit and the site sensors' units (#290)
Flix6x Nov 9, 2026
d4a7afb
Merge dev/s2-frbc-complete (#287, #288, #290) into feat/s2-usage-corr…
Flix6x Nov 10, 2026
e1e922d
Merge main (#279) into feat/s2-usage-correction
Flix6x Nov 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions CHANGELOG-S2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ Added
* ``FRBCSimple`` can record what a resource manager declares about its storage, so it can be seen and planned with. Give it any of the new ``soc_minima_sensor_id``, ``soc_maxima_sensor_id``, ``usage_forecast_sensor_id`` and ``leakage_behaviour_sensor_id``; a declaration without a sensor is not recorded.

- A fill-level target profile is recorded on the minima and maxima sensors, if both are given. It is recorded on the handler's ``resolution`` steps, starting from the step its start falls in. It is kept inside the declared fill-level range: a target past either end, such as a night setback below the range, is cut back to the range, and a target band wholly outside the range is recorded at its nearest end, with a warning. If one of the two bounds cannot be recorded, this is logged and the other is still recorded.
- A usage forecast is recorded in ``fill_rate_unit`` (see below). A negative expected usage is recorded as zero, with a warning.
- A leakage behaviour is recorded as a storage efficiency, each time a schedule is requested (see Changed).
- A usage forecast is recorded in ``fill_rate_unit`` (see below). A negative expected usage, which S2 allows, is recorded as stated. Without a usage correction (see below), a schedule request carries the latest forecast without its negative values, since FlexMeasures would plan them as a gain the storage cannot refuse. A FlexMeasures server before v0.23.0 only plans with what is recorded, so there a negative expected usage is recorded as zero, with a warning [`#286 <https://github.com/FlexMeasures/flexmeasures-client/pull/286>`__].
- A leakage behaviour is recorded as the leakage rate it states, in ``fill_rate_unit``, each time a schedule is requested (see Changed) [`#289 <https://github.com/FlexMeasures/flexmeasures-client/pull/289>`__].

[`#244 <https://github.com/FlexMeasures/flexmeasures-client/pull/244>`__, `#259 <https://github.com/FlexMeasures/flexmeasures-client/pull/259>`__, `#271 <https://github.com/FlexMeasures/flexmeasures-client/pull/271>`__, `#274 <https://github.com/FlexMeasures/flexmeasures-client/pull/274>`__]
* ``FRBCSimple`` takes an ``energy_unit`` (default ``kWh``). The state of charge and the fill-level band are recorded in this unit. Allowed units are ``J``, ``kJ``, ``MJ``, ``Wh``, ``kWh`` and ``MWh``; any other unit is refused when the handler is created. In a flex model, the state of charge is stated in ``kWh`` or ``MWh``, converted from the other units, because FlexMeasures accepts no others [`#244 <https://github.com/FlexMeasures/flexmeasures-client/pull/244>`__, `#260 <https://github.com/FlexMeasures/flexmeasures-client/pull/260>`__]
* ``FRBCSimple`` takes a ``fill_rate_unit`` (default ``W``; also ``kW`` or ``MW``). Rates of fill level, which S2 states per second, are recorded in it: the fill rate and the usage forecast. In ``kWh/s``, a heat buffer's rates of some tens of watts would read about 0.00001. Any other unit is refused when the handler is created [`#290 <https://github.com/FlexMeasures/flexmeasures-client/pull/290>`__]
* ``FRBCSimple`` takes a ``fill_level_scale`` (default 1). Every fill level and fill rate sent to FlexMeasures is multiplied by it: the state of charge, the flex model, the fill-level band, the fill rate, the usage forecast and the storage efficiency. Translating a schedule into instructions keeps the resource manager's own units, because it matches fill levels against the operation modes, which are stated in those units. A scale of zero or below is refused. ``FRBCSimple`` also takes a ``power_unit`` (default ``W``), which an actuator's power is converted into and posted in [`#236 <https://github.com/FlexMeasures/flexmeasures-client/pull/236>`__, `#244 <https://github.com/FlexMeasures/flexmeasures-client/pull/244>`__, `#245 <https://github.com/FlexMeasures/flexmeasures-client/pull/245>`__, `#252 <https://github.com/FlexMeasures/flexmeasures-client/pull/252>`__]
* ``FRBCSimple`` takes a ``fill_rate_unit`` (default ``W``; also ``kW`` or ``MW``). Rates of fill level, which S2 states per second, are recorded in it: the fill rate, the usage forecast and the leakage. In ``kWh/s``, a heat buffer's leakage of some tens of watts would read about 0.00001. Any other unit is refused when the handler is created [`#289 <https://github.com/FlexMeasures/flexmeasures-client/pull/289>`__, `#290 <https://github.com/FlexMeasures/flexmeasures-client/pull/290>`__]
* ``FRBCSimple`` takes a ``fill_level_scale`` (default 1). Every fill level and fill rate sent to FlexMeasures is multiplied by it: the state of charge, the flex model, the fill-level band, the fill rate, the usage forecast and the leakage. Translating a schedule into instructions keeps the resource manager's own units, because it matches fill levels against the operation modes, which are stated in those units. A scale of zero or below is refused. ``FRBCSimple`` also takes a ``power_unit`` (default ``W``), which an actuator's power is converted into and posted in [`#236 <https://github.com/FlexMeasures/flexmeasures-client/pull/236>`__, `#244 <https://github.com/FlexMeasures/flexmeasures-client/pull/244>`__, `#245 <https://github.com/FlexMeasures/flexmeasures-client/pull/245>`__, `#252 <https://github.com/FlexMeasures/flexmeasures-client/pull/252>`__]
* ``FRBCSimple`` takes a ``hard_bound_factor`` (default 1.5). It sets how far above the declared fill-level range a schedule's hard upper bound lies. If a schedule starts from a state of charge above that bound, the bound is raised to include it. A factor below 1 is refused: FlexMeasures clips the band to the hard bounds, so a hard upper bound inside the declared range would narrow the band to something the resource manager never asked for [`#245 <https://github.com/FlexMeasures/flexmeasures-client/pull/245>`__]
* ``FRBCSimple`` can take the actuator's charging efficiency into account: how much stored energy the drawn power becomes. For a heat pump, this is its coefficient of performance. Give it the new ``charging_efficiency_sensor_id``. Before each schedule request, it records the efficiency there, over the window of the schedule, and requests the schedule with it as ``charging-efficiency``. Without it, the scheduler assumes power converts into stored energy one to one, and plans to reach fill-level targets at a power the actuator cannot deliver.

Expand All @@ -52,10 +52,19 @@ Added
* ``FRBCSimple`` takes an optional ``fill_rate_sensor_id``, and records the actuator's fill rate there. The fill rate is recorded in ``fill_rate_unit``, not in ``power_unit``: a fill rate is what the actuator delivers into its buffer, which for a heat buffer is not electricity at all [`#236 <https://github.com/FlexMeasures/flexmeasures-client/pull/236>`__, `#244 <https://github.com/FlexMeasures/flexmeasures-client/pull/244>`__]
* ``flexmeasures_client.s2.clock``, with a ``WallClock`` and a ``SimulatedClock``, and ``CEM(clock=...)``. The clock sets the time for the CEM and for every handler it registers. That includes their timers, and the time a recorded state of charge is known from [`#264 <https://github.com/FlexMeasures/flexmeasures-client/pull/264>`__, `#268 <https://github.com/FlexMeasures/flexmeasures-client/pull/268>`__]
* ``CEM(accept_simulation_metadata=True)`` accepts messages from a co-simulation that are wrapped with the simulated time (``S2Wrapper``), and sets the CEM's clock from them. It is off by default, and then a wrapped message is refused as invalid. The example server turns it on with ``S2_ACCEPT_SIMULATION_METADATA`` [`#264 <https://github.com/FlexMeasures/flexmeasures-client/pull/264>`__]
* ``flexmeasures_client.s2.site``, with ``FRBC_SITE_SENSORS``, ``ensure_site`` and ``FRBCSiteConfigurator``. It gives each resource manager its own FlexMeasures site, named after it, with an FRBC handler connected to that site's sensors. The sensors' units suit a residential site and match the handler's defaults: powers and rates of fill level in ``W``, energy and fill levels in ``kWh``, and prices per ``kWh``. For sites at a larger scale, such as charge points, pass ``sensors`` with other units, and the handler's ``power_unit`` and ``fill_rate_unit`` in ``handler_options`` [`#265 <https://github.com/FlexMeasures/flexmeasures-client/pull/265>`__, `#290 <https://github.com/FlexMeasures/flexmeasures-client/pull/290>`__]
* ``flexmeasures_client.s2.site``, with ``FRBC_SITE_SENSORS``, ``ensure_site`` and ``FRBCSiteConfigurator``. It gives each resource manager its own FlexMeasures site, named after it, with an FRBC handler connected to that site's sensors. The sensors' units suit a residential site and match the handler's defaults: powers and rates of fill level in ``W``, energy and fill levels in ``kWh``, and prices per ``kWh``. For sites at a larger scale, such as charge points, pass ``sensors`` with other units, and the handler's ``power_unit`` and ``fill_rate_unit`` in ``handler_options``. [`#265 <https://github.com/FlexMeasures/flexmeasures-client/pull/265>`__, `#289 <https://github.com/FlexMeasures/flexmeasures-client/pull/289>`__, `#290 <https://github.com/FlexMeasures/flexmeasures-client/pull/290>`__]
* ``CEM(site_configurator=...)`` sets up a resource manager's site once its details arrive. Until then, the CEM answers its messages with a temporary error. The example server enables this with ``S2_SITE_PER_RESOURCE_MANAGER`` [`#265 <https://github.com/FlexMeasures/flexmeasures-client/pull/265>`__]
* ``examples/S2-co-simulation``: a FlexMeasures stack with one CEM per simulated home, for co-simulations whose resource managers connect over websockets [`#265 <https://github.com/FlexMeasures/flexmeasures-client/pull/265>`__, `#267 <https://github.com/FlexMeasures/flexmeasures-client/pull/267>`__]
* ``flexmeasures_client.s2.measurements.MeasurementRecorder`` and ``CEM(measurement_recorder=...)`` record a resource manager's measured power. Use one recorder per server, so that a resource manager that reconnects is not recorded twice [`#266 <https://github.com/FlexMeasures/flexmeasures-client/pull/266>`__]
* ``FRBCSimple`` can correct a usage forecast that no plan can absorb, instead of leaving the storage without a plan. Give it the new ``usage_correction_sensor_id``; it needs FlexMeasures v1.1.0 or newer. A forced gain at a full storage, or a draw at an empty one that the actuator cannot keep up with, used to make every plan infeasible.

- The plan may move each step's expected usage towards zero, never past it, and only where nothing physical keeps the storage within its hard bounds. It is recorded on the new sensor.
- A negative expected usage is then planned as stated, instead of as zero.
- The request sets the breach price of the fill-level band relative to the highest market price over the window (``soc_breach_price_factor``, default 10), instead of leaving it to FlexMeasures. The correction is priced above anything else a unit of stock can be worth, including the site's own stored peak and commitment prices, except a breach of the site's capacity. The site's breach prices are kept from the asset, or else set at FlexMeasures' default, which FlexMeasures itself only fills in for a flex context without commodities, so a site keeps to the capacity it is steered with.
- Where a correction cannot be planned, for example without readable prices, the forecast is planned without its negative values, and the log says why.
- ``FRBCSiteConfigurator`` takes ``correct_usage`` to give each site the sensor, and the example server does so with ``S2_CORRECT_USAGE``. Both are off by default.

[`#286 <https://github.com/FlexMeasures/flexmeasures-client/pull/286>`__]

Changed
-------
Expand Down Expand Up @@ -85,7 +94,7 @@ Changed
- The hard bounds ``soc-min`` and ``soc-max`` are now zero and ``hard_bound_factor`` times the top of the range, raised to include a state of charge above it. In v0.9.0, the declared range itself was the hard bound. So a storage that really was outside it, for example floating above the top or left below the bottom, made the problem infeasible: there was no schedule at all, or one from a fallback scheduler. A storage reported below zero is planned from zero, with a warning, because FlexMeasures refuses a negative ``soc-min``.
- FlexMeasures older than v0.26.0 cannot relax the band. Then the band is left out, and this is logged, so the storage is planned anywhere between the wide hard bounds.
- The usage forecast is sent as ``soc-usage`` if its sensor is given and the resource manager provides a forecast (or has sent one anyway).
- The leakage behaviour is recorded as a ``storage-efficiency`` with each schedule request, over the window of the schedule. It uses the leakage at the starting fill level, as a share of that fill level (or of the middle of the range, if the storage starts below that). It is only named in the flex model if FlexMeasures confirmed storing it. FlexMeasures takes a storage efficiency as a share of the stock, whereas S2 states a rate, so the loss is exact only at that one fill level.
- The leakage behaviour is planned as part of the usage: the leakage rate of the fill-level range the storage starts in is added to ``soc-usage`` over the whole window, and sent with the request. S2 states leakage as a rate, so it is not planned as a ``storage-efficiency``, which FlexMeasures takes as a share of the stock, and which would make the storage leak in proportion to how full it is. A flat rate keeps draining an empty storage, as any forced usage does; with a usage correction, the plan can take that away. It needs FlexMeasures v0.23.0 or newer, which takes a usage with the request; an older server is planned without leakage, and this is logged [`#289 <https://github.com/FlexMeasures/flexmeasures-client/pull/289>`__].

[`#244 <https://github.com/FlexMeasures/flexmeasures-client/pull/244>`__, `#245 <https://github.com/FlexMeasures/flexmeasures-client/pull/245>`__, `#259 <https://github.com/FlexMeasures/flexmeasures-client/pull/259>`__, `#271 <https://github.com/FlexMeasures/flexmeasures-client/pull/271>`__, `#273 <https://github.com/FlexMeasures/flexmeasures-client/pull/273>`__]
* ``FRBCSimple`` posts the state of charge in its ``energy_unit`` (``kWh`` by default), and sets the flex model's ``soc-unit`` to match (to ``kWh`` if ``energy_unit`` is neither ``kWh`` nor ``MWh``). In v0.9.0, every state of charge and every schedule's ``soc-unit`` was labelled ``MWh``, whatever unit the resource manager reported in. On the example server's ``kWh`` sensor, a fill level of 10 was recorded as 10,000. A resource manager that reports in megawatt hours now needs ``energy_unit="MWh"`` [`#244 <https://github.com/FlexMeasures/flexmeasures-client/pull/244>`__]
Expand Down
10 changes: 10 additions & 0 deletions examples/S2-co-simulation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ with two switches on:
resource manager retries. Its schedules start from the simulated now and cover
24 hours. The site's prices are for whoever runs the simulation to post.

A third switch is off by default:

- `S2_CORRECT_USAGE`: a usage forecast that no plan can absorb within the storage's
hard bounds is corrected towards zero, instead of leaving the home without a plan.
Each site gets a `usage correction` sensor, which records where the plan corrected
the forecast. A negative expected usage is then planned as the gain it states,
rather than as none. The request also sets the breach prices of the fill-level band
and the site's capacity relative to the market, rather than leaving them to
FlexMeasures' defaults. It needs FlexMeasures v1.1.0 or newer.

FlexMeasures reads three settings a co-simulation needs from its instance config
(`flexmeasures-instance/flexmeasures.cfg` in the flexmeasures checkout), not from the environment:

Expand Down
2 changes: 2 additions & 0 deletions examples/S2-co-simulation/docker-compose.cem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ x-cem: &cem
S2_ACCEPT_SIMULATION_METADATA: "1"
# And each home is a site of its own, rather than all of them sharing one.
S2_SITE_PER_RESOURCE_MANAGER: "1"
# Uncomment to correct a usage forecast that no plan can absorb, instead of leaving the home without a plan (see README.md).
# S2_CORRECT_USAGE: "1"
volumes:
- ../flexmeasures-client:/app/flexmeasures-client:rw
entrypoint: ["/bin/sh", "-c"]
Expand Down
Loading
Loading