Repository navigation
S2: plan the declared leakage as part of the usage - #289
Merged
Merged
Conversation
S2 states leakage as a rate per fill-level range. It was planned as a storage efficiency, which FlexMeasures takes as a share of the stock, so the storage leaked in proportion to how full it was, exact at one fill level only. The leakage rate of the range the storage starts in is now added to the usage, over the whole window, and sent with the schedule request. With a usage correction, the correction covers usage and leakage together, so an empty storage's leakage can be taken away like any other forced usage. The leakage sensor records that rate, in the fill-rate unit, and the site sensor is now called "leakage". It needs FlexMeasures v0.23.0, which takes a usage with the request; an older server is planned without leakage. As asked in the review of #283. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CcpawsJs74cSwFLXkz7ZwW Signed-off-by: F.N. Claessen <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CcpawsJs74cSwFLXkz7ZwW Signed-off-by: F.N. Claessen <[email protected]>
Coverage Report for CI Build 42683851519Warning No base build found for commit Coverage: 96.203%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats
💛 - Coveralls |
Flix6x
commented
Nov 9, 2026
S2 states these rates per second, so in kWh/s a heat buffer's leakage of some tens of watts reads about 0.00001. They are now recorded in the power unit that goes with the energy unit (kW for kWh, W for J and Wh, MW for MJ and MWh), and the site's fill rate, usage forecast and leakage sensors are created in kW. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CcpawsJs74cSwFLXkz7ZwW Signed-off-by: F.N. Claessen <[email protected]>
Like the energy and power units, the unit that rates of fill level are recorded in is the deployment's to set: W (the default), kW or MW. Watts read a residential heat buffer's leakage of some tens of watts as such; the site's fill rate, usage forecast and leakage sensors are created in W. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CcpawsJs74cSwFLXkz7ZwW Signed-off-by: F.N. Claessen <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CcpawsJs74cSwFLXkz7ZwW Signed-off-by: F.N. Claessen <[email protected]>
Every power and rate of fill level the CEM sets up is now in W, the handler's default: power, measured-power and usage correction joined fill rate, usage forecast and leakage. Watts read a residential site's small powers as such; a larger site passes its own sensors. An existing site keeps its sensors, and one in another unit than a new site would get is logged as a warning. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CcpawsJs74cSwFLXkz7ZwW Signed-off-by: F.N. Claessen <[email protected]>
FlexMeasures converts what is posted into a sensor's own unit, so an older site's sensor in kW is a valid choice, not a fault. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CcpawsJs74cSwFLXkz7ZwW Signed-off-by: F.N. Claessen <[email protected]>
This was referenced Nov 9, 2026
Flix6x
added a commit
that referenced
this pull request
Nov 10, 2026
…ection #290 carried #289's unit changes on their own, so its conflicts resolve to this branch's side, which already has them along with the leakage as usage. #287's handling of an early actuator status and #288's changelog wording are kept, and the changelog links #290 next to #289. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CcpawsJs74cSwFLXkz7ZwW Signed-off-by: F.N. Claessen <[email protected]>
Flix6x
added a commit
that referenced
this pull request
Nov 10, 2026
… declared leakage as usage (#286) Includes #289 (leakage planned as usage). The usage correction is opt-in. Signed-off-by: F.N. Claessen <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #286 (base
feat/s2-usage-correction). Merge #286 first.Follows up on a review comment on #283: "If S2 states a rate, shouldn't this then be better modelled as an extra component in the soc-usage list?"
Why
S2 states leakage as a rate per fill-level range, in fill-level units per second.
FRBCSimpleplanned it as astorage-efficiency, which FlexMeasures takes as a share of the stock. So the plan had the storage leak in proportion to how full it was, which was exact at one fill level only, and S2 does not say leakage is proportional.What
soc-usage, constant over the schedule window, and sent with the request. Nostorage-efficiencyis sent any more.leakage(inW) instead ofstorage efficiency(%), inFRBC_SITE_SENSORSand the example server.kWh/sa heat buffer's leakage of some tens of watts reads near 1e-5. So the fill rate, the usage forecast and the leakage are now recorded in a newfill_rate_unit:Wby default, orkWorMW. FlexMeasures converts them into the sensor's own unit.W, energy and fill levels inkWh, prices perkWh. A larger site, such as one with charge points, passes its ownsensorspluspower_unitandfill_rate_unit. Sensors an existing site already has are reused by name and keep their units.Caveats
Evidence
fill_rate_unitand the refusal of a unit that is no power unit, the site sensors' units, scaling byfill_level_scale, recording the rate (and not again for the same window), planning despite a failed recording, an older server, leakage without a usage forecast or its sensor, the correction covering both, clipping both together without a correction, and the correction price's storage term. Each fails when its behaviour is broken.🤖 Generated with Claude Code
https://claude.ai/code/session_01CcpawsJs74cSwFLXkz7ZwW