Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions flexmeasures/api/v3_0/tests/test_sensor_schedules_fresh_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ def test_inflexible_device_sensors_priority(
fresh_db,
add_market_prices_fresh_db,
add_battery_assets_fresh_db,
setup_fresh_test_forecast_data,
battery_soc_sensor_fresh_db,
add_charging_station_assets_fresh_db,
keep_scheduling_queue_empty,
Expand All @@ -341,6 +342,9 @@ def test_inflexible_device_sensors_priority(
"consumption-price": {"sensor": price_sensor_id},
"production-price": {"sensor": price_sensor_id},
"site-power-capacity": "1 TW", # should be big enough to avoid any infeasibilities
"curtailable-device-sensors": [
setup_fresh_test_forecast_data["solar-sensor"].id
],
}
if context_sensor_num:
other_asset = add_battery_assets_fresh_db["Test small battery"]
Expand Down
6 changes: 6 additions & 0 deletions flexmeasures/data/schemas/scheduling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,12 @@ class FlexContextSchema(Schema):
metadata=metadata.INFLEXIBLE_DEVICE_SENSORS.to_dict(),
)

curtailable_device_sensors = fields.List(
SensorIdField(),
data_key="curtailable-device-sensors",
metadata=metadata.CURTAILABLE_DEVICE_SENSORS.to_dict(),
)

def set_default_breach_prices(
self, data: dict, fields: list[str], price: ur.Quantity
):
Expand Down
10 changes: 9 additions & 1 deletion flexmeasures/data/schemas/scheduling/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,19 @@ def to_dict(self):
INFLEXIBLE_DEVICE_SENSORS = MetaData(
description="""Power sensors representing devices that are relevant, but not flexible in the timing of their demand/supply.
For example, a sensor recording rooftop solar power that is connected behind the main meter, and whose production falls under the same contract as the flexible device(s) being scheduled.
Their power demand cannot be adjusted but still matters for finding the best schedule for other devices.
Their power generation (or demand) cannot be adjusted but still matters for finding the best schedule for other devices.
Must be a list of integers.
""",
example=[3, 4],
)
CURTAILABLE_DEVICE_SENSORS = MetaData(
description="""Power sensors representing devices that are curtailable.
For example, a sensor recording rooftop solar power that is connected behind the main meter, and whose production falls under the same contract as the flexible device(s) being scheduled.
Their power generation (or demand) can be reduced.
Must be a list of integers.
""",
example=[5, 6],
)
COMMITMENTS = MetaData(
description="Prior commitments. Support for this field in the UI is still under further development, but you can study the code to learn more.",
example=[],
Expand Down
Loading