Fix/storage efficiency validation using consumption/production field#2213
Merged
nhoening merged 10 commits intoJun 1, 2026
Merged
Conversation
…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>
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>
nhoening
approved these changes
Jun 1, 2026
Member
nhoening
left a comment
There was a problem hiding this comment.
HEMS tutorial runs fine again & LGTM
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.
Description
DBStorageFlexModelSchemasupport 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.)documentation/changelog.rstLook & Feel
As of #2190, setting a
storage-efficiencyto a fixed quantity (e.g."99.9%") in the DB flex-model was no longer supported without referencing aconsumptionorproductionsensor in the same flex-model, to infer the resolution of the storage-efficiency. However, theStorageScheduleralso 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 theStorageFlexModelSchema, 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
Further Improvements
...
Related Items
Fixes bug from #2190.