Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flex context as model fields #1016

Open
nhoening opened this issue Mar 17, 2024 · 1 comment
Open

Flex context as model fields #1016

nhoening opened this issue Mar 17, 2024 · 1 comment

Comments

@nhoening
Copy link
Contributor

nhoening commented Mar 17, 2024

In #990, we discuss adding most fields in flex-model and flex-context to the data model, in order to give users less API dev work and more power to review and change important settings in the FlexMeasures UI.

The first step should be the flex context fields for pricing, because they are straightforward: They already represent a sensor (e.g. a market) and nothing else, and they are one interesting setting for users to switch.

Also, the list of inflexible device sensors is interesting - which sensors within an asset (or outside of it? - I'd favor only suggesting a list of offspring) make sense to take into account?

In essence, these fields should be made into data model fields (or in the case of inflexible-device-sensors, an m:n relationship?):

  • consumption-price-sensor
  • production-price-sensor
  • inflexible-device-sensors

And for each, the scheduling logic should get updates:

  • These fields can be missing from the schema that comes in via the API
  • As fallback, new fields on the model (added here) are allowed.
@nhoening
Copy link
Contributor Author

nhoening commented Mar 18, 2024

Braindump of the steps I think need to be taken:

  1. Add these fields to the asset data model. Inflexible sensors are a backward relationship, as the one-to-many relationship leads to a field on the sensor table!
  2. Add property or function on asset class, which searches upwards on the asset tree for these fields
  3. Adapt scheduling logic (/trigger endpoint and/or _scheduling_job()?) to accept that these fields might not come via API but can be looked up on model
  4. Show fields on asset page
  5. Enable choosing values (sensors) for these fields on the asset page

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

No branches or pull requests

1 participant