Skip to content

Fix/storage efficiency validation using consumption/production field#2213

Merged
nhoening merged 10 commits into
mainfrom
fix/storage-efficiency-validation-using-consumption-production
Jun 1, 2026
Merged

Fix/storage efficiency validation using consumption/production field#2213
nhoening merged 10 commits into
mainfrom
fix/storage-efficiency-validation-using-consumption-production

Conversation

@Flix6x
Copy link
Copy Markdown
Member

@Flix6x Flix6x commented Jun 1, 2026

Description

  • Prevent breaking change by letting DBStorageFlexModelSchema support specifying a fixed storage-efficiency without specifying a consumption or production sensor. (This issue came up during testing with the HEMS script in the flexmeasures-client and made us postpone the v0.33.0 release.)
  • Added changelog item in documentation/changelog.rst

Look & Feel

As of #2190, setting a storage-efficiency to a fixed quantity (e.g. "99.9%") in the DB flex-model was no longer supported without referencing a consumption or production sensor in the same flex-model, to infer the resolution of the storage-efficiency. However, the StorageScheduler also accepts a power sensor to infer the resolution (which is currently only possible in the trigger message's flex-model). Since the two flex-models are merged before scheduling, and then checked against the StorageFlexModelSchema, the validation should move to that schema (and also pass if the power sensor is known). That's what this PR does.

How to test

pytest -k test_flex_model_schemas

Further Improvements

...

Related Items

Fixes bug from #2190.

Flix6x added 6 commits June 1, 2026 09:14
…uction which are field descriptors, not data values — causing an AttributeError

Signed-off-by: F.N. Claessen <claessen@seita.nl>
… to StorageFlexModelSchema; for backwards compatibility, we need to keep support for a db flex-model with storage-efficiency as a fixed quantity, without a consumption or production sensor, as the trigger message may still describe a power sensor to be used, from which the resolution can be inferred

Signed-off-by: F.N. Claessen <claessen@seita.nl>
…e previous commit)

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

storage-efficiency cannot be inferred

Signed-off-by: F.N. Claessen <claessen@seita.nl>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
…rageFlexModelSchema

Signed-off-by: F.N. Claessen <claessen@seita.nl>
@Flix6x Flix6x added this to the 0.33.0 milestone Jun 1, 2026
@Flix6x Flix6x self-assigned this Jun 1, 2026
@Flix6x Flix6x added the bug Something isn't working label Jun 1, 2026
Flix6x added 4 commits June 1, 2026 10:10
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
@Flix6x Flix6x requested a review from nhoening June 1, 2026 08:49
Copy link
Copy Markdown
Member

@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.

HEMS tutorial runs fine again & LGTM

@nhoening nhoening merged commit 57b05bc into main Jun 1, 2026
12 checks passed
@nhoening nhoening deleted the fix/storage-efficiency-validation-using-consumption-production branch June 1, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants