Skip to content
Open
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: 2 additions & 2 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Add beliefs
run: |
docker exec --env-file .env fm-container flexmeasures \
add beliefs --sensor 1 --source toy-user prices-tomorrow.csv --timezone Europe/Amsterdam
add beliefs --sensor 1 --source toy-user prices-tomorrow.csv --timezone Europe/Amsterdam --unit EUR/MWh
- name: Export TOMORROW
run: echo "TOMORROW=$(date --date="next day" '+%Y-%m-%d')"
>> $GITHUB_ENV
Expand All @@ -70,4 +70,4 @@ jobs:
run: |
docker exec --env-file .env fm-container flexmeasures add schedule --sensor 5 --scheduler ProcessScheduler \
--start ${TOMORROW}T00:00:00+02:00 --duration PT24H --flex-context '{"consumption-price": {"sensor": 1}}' \
--flex-model "{\"duration\": \"PT4H\", \"process-type\": \"BREAKABLE\", \"power\": 0.2, \"time-restrictions\": [{\"start\": \"${TOMORROW}T15:00:00+02:00\", \"duration\": \"PT1H\"}]}"
--flex-model "{\"duration\": \"PT4H\", \"process-type\": \"BREAKABLE\", \"power\": 200, \"time-restrictions\": [{\"start\": \"${TOMORROW}T15:00:00+02:00\", \"duration\": \"PT1H\"}]}"
1 change: 1 addition & 0 deletions documentation/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ New features
* In the UI, asset and sensor lists can be filtered by ID prefix through API-backed search fields [see `PR #2231 <https://www.github.com/FlexMeasures/flexmeasures/pull/2231>`_]
* Floor off-clock API datetimes to a non-instantaneous sensor's resolution by default when ingesting sensor data, uploading sensor data, and handling scheduler flex-model timed events; configurable with the ``floor_datetimes_to_resolution`` sensor attribute [see `PR #2146 <https://www.github.com/FlexMeasures/flexmeasures/pull/2146>`_]
* Sensor references in flex-model and flex-context support various ways of filtering by source [see `PR #2209 <https://www.github.com/FlexMeasures/flexmeasures/pull/2209>`_]
* Create toy tutorial accounts with kW-scale power sensors and ``EUR/kWh`` day-ahead prices [see `PR #2223 <https://www.github.com/FlexMeasures/flexmeasures/pull/2223>`_]
* Let storage scheduling infer missing ``power-capacity`` from directional device capacities before falling back to site capacity, and default the missing opposite capacity to zero when only a non-zero ``consumption-capacity`` or ``production-capacity`` is configured [see `PR #2222 <https://www.github.com/FlexMeasures/flexmeasures/pull/2222>`_]
* CLI support for adding/editing account attributes [see `PR #2242 <https://www.github.com/FlexMeasures/flexmeasures/pull/2242>`_]

Expand Down
6 changes: 3 additions & 3 deletions documentation/dev/docker-compose.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,23 +123,23 @@ The charging/discharging schedule should be there:
.. code-block:: bash

┌────────────────────────────────────────────────────────────┐
│ ▐ ▐▀▀▌ ▛▀▀│ 0.5MW
│ ▐ ▐▀▀▌ ▛▀▀│ 500kW
│ ▞▌ ▌ ▌ ▌ │
│ ▌▌ ▌ ▐ ▗▘ │
│ ▌▌ ▌ ▐ ▐ │
│ ▐ ▐ ▐ ▐ ▐ │
│ ▐ ▐ ▐ ▝▖ ▞ │
│ ▌ ▐ ▐ ▌ ▌ │
│ ▐ ▝▖ ▌ ▌ ▌ │
│▀▘───▀▀▀▀▖─────▌────▀▀▀▀▀▀▀▀▀▌─────▐▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▘───│ 0.0MW
│▀▘───▀▀▀▀▖─────▌────▀▀▀▀▀▀▀▀▀▌─────▐▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▘───│ 0kW
│ ▌ ▐ ▚ ▌ │
│ ▌ ▞ ▐ ▗▘ │
│ ▌ ▌ ▐ ▞ │
│ ▐ ▐ ▝▖ ▌ │
│ ▐ ▐ ▌ ▗▘ │
│ ▐ ▌ ▌ ▐ │
│ ▝▖ ▌ ▌ ▞ │
│ ▙▄▟ ▐▄▄▌ │ -0.5MW
│ ▙▄▟ ▐▄▄▌ │ -500kW
└────────────────────────────────────────────────────────────┘
10 20 30 40
██ discharging
Expand Down
2 changes: 1 addition & 1 deletion documentation/tut/scripts/run-tutorial-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ${TOMORROW}T23:00:00,7" > prices-tomorrow.csv
docker cp prices-tomorrow.csv $CONTAINER_NAME:/app

docker exec -it $CONTAINER_NAME flexmeasures add beliefs \
--sensor 1 --source toy-user /app/prices-tomorrow.csv --timezone Europe/Amsterdam
--sensor 1 --source toy-user /app/prices-tomorrow.csv --timezone Europe/Amsterdam --unit EUR/MWh

echo "[TUTORIAL-RUNNER] creating schedule ..."
docker exec -it $CONTAINER_NAME flexmeasures add schedule \
Expand Down
48 changes: 24 additions & 24 deletions documentation/tut/scripts/run-tutorial2-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,30 @@ echo "[TUTORIAL-RUNNER] loading solar production data..."
TOMORROW=$(date --date="next day" '+%Y-%m-%d')

echo "Hour,Production
${TOMORROW}T00:00:00,0.0
${TOMORROW}T01:00:00,0.0
${TOMORROW}T02:00:00,0.0
${TOMORROW}T03:00:00,0.0
${TOMORROW}T04:00:00,0.01
${TOMORROW}T05:00:00,0.03
${TOMORROW}T06:00:00,0.06
${TOMORROW}T07:00:00,0.1
${TOMORROW}T08:00:00,0.14
${TOMORROW}T09:00:00,0.17
${TOMORROW}T10:00:00,0.19
${TOMORROW}T11:00:00,0.21
${TOMORROW}T12:00:00,0.22
${TOMORROW}T13:00:00,0.21
${TOMORROW}T14:00:00,0.19
${TOMORROW}T15:00:00,0.17
${TOMORROW}T16:00:00,0.14
${TOMORROW}T17:00:00,0.1
${TOMORROW}T18:00:00,0.06
${TOMORROW}T19:00:00,0.03
${TOMORROW}T20:00:00,0.01
${TOMORROW}T21:00:00,0.0
${TOMORROW}T22:00:00,0.0
${TOMORROW}T23:00:00,0.0" > solar-tomorrow.csv
${TOMORROW}T00:00:00,0
${TOMORROW}T01:00:00,0
${TOMORROW}T02:00:00,0
${TOMORROW}T03:00:00,0
${TOMORROW}T04:00:00,10
${TOMORROW}T05:00:00,30
${TOMORROW}T06:00:00,60
${TOMORROW}T07:00:00,100
${TOMORROW}T08:00:00,140
${TOMORROW}T09:00:00,170
${TOMORROW}T10:00:00,190
${TOMORROW}T11:00:00,210
${TOMORROW}T12:00:00,220
${TOMORROW}T13:00:00,210
${TOMORROW}T14:00:00,190
${TOMORROW}T15:00:00,170
${TOMORROW}T16:00:00,140
${TOMORROW}T17:00:00,100
${TOMORROW}T18:00:00,60
${TOMORROW}T19:00:00,30
${TOMORROW}T20:00:00,10
${TOMORROW}T21:00:00,0
${TOMORROW}T22:00:00,0
${TOMORROW}T23:00:00,0" > solar-tomorrow.csv

docker cp solar-tomorrow.csv $CONTAINER_NAME:/app/

Expand Down
8 changes: 4 additions & 4 deletions documentation/tut/scripts/run-tutorial3-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ echo "[TUTORIAL-RUNNER] Computing schedule for PV curtailment (using artificial

echo '''{
"consumption-price": [
{"start": "'${TOMORROW}'T00:00+01", "duration": "PT24H", "value": "10 EUR/MWh"}
{"start": "'${TOMORROW}'T00:00+01", "duration": "PT24H", "value": "0.010 EUR/kWh"}
],
"production-price": [
{"start": "'${TOMORROW}'T05:00+01", "duration": "PT7H", "value": "4 EUR/MWh"},
{"start": "'${TOMORROW}'T12:00+01", "duration": "PT2H", "value": "-10 EUR/MWh"},
{"start": "'${TOMORROW}'T14:00+01", "duration": "PT7H", "value": "4 EUR/MWh"}
{"start": "'${TOMORROW}'T05:00+01", "duration": "PT7H", "value": "0.004 EUR/kWh"},
{"start": "'${TOMORROW}'T12:00+01", "duration": "PT2H", "value": "-0.010 EUR/kWh"},
{"start": "'${TOMORROW}'T14:00+01", "duration": "PT7H", "value": "0.004 EUR/kWh"}
]
}''' > tutorial3-priceprofile-flex-context.json
docker cp tutorial3-priceprofile-flex-context.json $CONTAINER_NAME:/app/
Expand Down
6 changes: 3 additions & 3 deletions documentation/tut/scripts/run-tutorial4-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ echo "[TUTORIAL-RUNNER] Creating three process schedules ..."
docker exec -it $CONTAINER_NAME flexmeasures add schedule --sensor 4 --scheduler ProcessScheduler \
--start ${TOMORROW}T00:00:00+02:00 --duration PT24H \
--flex-context '{"consumption-price": {"sensor": 1}}' \
--flex-model '{"duration": "PT4H", "process-type": "INFLEXIBLE", "power": 0.2, "time-restrictions": [{"start": "'"${TOMORROW}"'T15:00:00+02:00", "duration": "PT1H"}]}'
--flex-model '{"duration": "PT4H", "process-type": "INFLEXIBLE", "power": 200, "time-restrictions": [{"start": "'"${TOMORROW}"'T15:00:00+02:00", "duration": "PT1H"}]}'

docker exec -it $CONTAINER_NAME flexmeasures add schedule --sensor 5 --scheduler ProcessScheduler \
--start ${TOMORROW}T00:00:00+02:00 --duration PT24H \
--flex-context '{"consumption-price": {"sensor": 1}}' \
--flex-model '{"duration": "PT4H", "process-type": "BREAKABLE", "power": 0.2, "time-restrictions": [{"start": "'"${TOMORROW}"'T15:00:00+02:00", "duration": "PT1H"}]}'
--flex-model '{"duration": "PT4H", "process-type": "BREAKABLE", "power": 200, "time-restrictions": [{"start": "'"${TOMORROW}"'T15:00:00+02:00", "duration": "PT1H"}]}'

docker exec -it $CONTAINER_NAME flexmeasures add schedule --sensor 6 --scheduler ProcessScheduler \
--start ${TOMORROW}T00:00:00+02:00 --duration PT24H \
--flex-context '{"consumption-price": {"sensor": 1}}' \
--flex-model '{"duration": "PT4H", "process-type": "SHIFTABLE", "power": 0.2, "time-restrictions": [{"start": "'"${TOMORROW}"'T15:00:00+02:00", "duration": "PT1H"}]}'
--flex-model '{"duration": "PT4H", "process-type": "SHIFTABLE", "power": 200, "time-restrictions": [{"start": "'"${TOMORROW}"'T15:00:00+02:00", "duration": "PT1H"}]}'

echo "Now visit http://localhost:5000/assets/6/graphs to see all three schedules."
52 changes: 26 additions & 26 deletions documentation/tut/toy-example-expanded.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Toy example II: Adding solar production, and a limit on the grid connection
============================================================================


So far we haven't taken into account any other devices that consume or produce electricity. The battery was free to use all available capacity (which was 500 kVA, both its own maximum charge/discharge rate, and the maximum grid capacity).
So far we haven't taken into account any other devices that consume or produce electricity. The battery was free to use all available capacity (which was 500 kVA, both its own maximum charge/discharge rate, and the maximum grid capacity).

What if other devices will be using some of that capacity? Our schedules need to reflect that, so we stay within given limits.

Expand All @@ -24,36 +24,36 @@ How does it work?
Adding PV production forecasts
------------------------------

First, we'll create a new CSV file with solar forecasts (MW, see the setup for sensor 3 in part I of this tutorial) for tomorrow.
First, we'll create a new CSV file with solar forecasts (kW, see the setup for sensor 3 in part I of this tutorial) for tomorrow.

.. code-block:: bash

$ TOMORROW=$(date --date="next day" '+%Y-%m-%d')
$ echo "Hour,Price
$ ${TOMORROW}T00:00:00,0.0
$ ${TOMORROW}T01:00:00,0.0
$ ${TOMORROW}T02:00:00,0.0
$ ${TOMORROW}T03:00:00,0.0
$ ${TOMORROW}T04:00:00,0.01
$ ${TOMORROW}T05:00:00,0.03
$ ${TOMORROW}T06:00:00,0.06
$ ${TOMORROW}T07:00:00,0.1
$ ${TOMORROW}T08:00:00,0.14
$ ${TOMORROW}T09:00:00,0.17
$ ${TOMORROW}T10:00:00,0.19
$ ${TOMORROW}T11:00:00,0.21
$ ${TOMORROW}T12:00:00,0.22
$ ${TOMORROW}T13:00:00,0.21
$ ${TOMORROW}T14:00:00,0.19
$ ${TOMORROW}T15:00:00,0.17
$ ${TOMORROW}T16:00:00,0.14
$ ${TOMORROW}T17:00:00,0.1
$ ${TOMORROW}T18:00:00,0.06
$ ${TOMORROW}T19:00:00,0.03
$ ${TOMORROW}T20:00:00,0.01
$ ${TOMORROW}T21:00:00,0.0
$ ${TOMORROW}T22:00:00,0.0
$ ${TOMORROW}T23:00:00,0.0" > solar-tomorrow.csv
$ ${TOMORROW}T00:00:00,0
$ ${TOMORROW}T01:00:00,0
$ ${TOMORROW}T02:00:00,0
$ ${TOMORROW}T03:00:00,0
$ ${TOMORROW}T04:00:00,10
$ ${TOMORROW}T05:00:00,30
$ ${TOMORROW}T06:00:00,60
$ ${TOMORROW}T07:00:00,100
$ ${TOMORROW}T08:00:00,140
$ ${TOMORROW}T09:00:00,170
$ ${TOMORROW}T10:00:00,190
$ ${TOMORROW}T11:00:00,210
$ ${TOMORROW}T12:00:00,220
$ ${TOMORROW}T13:00:00,210
$ ${TOMORROW}T14:00:00,190
$ ${TOMORROW}T15:00:00,170
$ ${TOMORROW}T16:00:00,140
$ ${TOMORROW}T17:00:00,100
$ ${TOMORROW}T18:00:00,60
$ ${TOMORROW}T19:00:00,30
$ ${TOMORROW}T20:00:00,10
$ ${TOMORROW}T21:00:00,0
$ ${TOMORROW}T22:00:00,0
$ ${TOMORROW}T23:00:00,0" > solar-tomorrow.csv

Then, we read in the created CSV file as beliefs data.
This time, different to above, we want to use a new data source (not the user) ― it represents whoever is making these solar production forecasts.
Expand Down
6 changes: 3 additions & 3 deletions documentation/tut/toy-example-from-scratch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,23 +139,23 @@ Great. Let's see what we made:
Data spans 12 hours and starts at 2025-11-29 07:00:00+01:00.
The time resolution (x-axis) is 15 minutes.
┌────────────────────────────────────────────────────────────┐
│ ▛▀▜ ▞▀▀▌ ▐▀▀▚ │ 0.5MW
│ ▛▀▜ ▞▀▀▌ ▐▀▀▚ │ 500kW
│ ▌ ▌ ▌ ▌ ▐ ▐ │
│ ▗▘ ▌ ▌ ▌ ▐ ▐ │
│ ▐ ▌ ▌ ▐ ▌ ▐ │
│ ▐ ▐ ▌ ▐ ▌ ▌│
│▌ ▐ ▐ ▐ ▐ ▌ ▌│
│▐ ▌ ▐ ▐ ▌ ▐ ▌│
│ ▌ ▌ ▌ ▐ ▌ ▐ ▐│
│─▚▄▄▌────▀▙▄▄▄▖────▐────▀▚▄▄▄▄▄▄▄▄▖─────▗▄▄▄▄▄▄▄▄▄▄▄▄▄▟────▝│ 0.0MW
│─▚▄▄▌────▀▙▄▄▄▖────▐────▀▚▄▄▄▄▄▄▄▄▖─────▗▄▄▄▄▄▄▄▄▄▄▄▄▄▟────▝│ 0kW
│ ▌ ▞ ▐ ▌ │
│ ▚ ▌ ▐ ▗▘ │
│ ▐ ▌ ▐ ▞ │
│ ▐ ▗▘ ▝▖ ▌ │
│ ▝▖ ▐ ▌ ▗▘ │
│ ▌ ▞ ▌ ▐ │
│ ▌ ▌ ▚ ▞ │
│ ▙▄▄▘ ▐▄▄▌ │ -0.5MW
│ ▙▄▄▘ ▐▄▄▌ │ -500kW
└────────────────────────────────────────────────────────────┘
06:00 09:00 12:00 15:00
██ discharging (toy-battery)
Expand Down
Loading
Loading