Storage system
In this tutorial, you will learn how to leverage FlatPeak if your system is an energy storage device, and you want to optimise its operations to maximise savings and accelarate the ROI.
Design
Once customer completes the Connect flow, or if you created their tariff via the API:
To optimise the operation of your storage system by energy cost, we need to:
- Charge from the grid when you have a (solar or wind) deficit and the IMPORT tariff is low.
- Supply stored energy to premises when IMPORT tariff is high.
- Export to the grid when the EXPORT tariff is high & you have surplus energy.
To determine the savings provided by your storage system, we need to:
- Log the cost of energy when your device is charging from the grid using the IMPORT tariff.
- Account charging from a local generation source (e.g., solar or wind) as “free” energy.
- Log the cost of energy when it was supplied from your system to your customer’s premises, using the IMPORT tariff at the time of supply.
- Apply a simple math formula to calculate savings (keep reading to learn how).
Implementation
To get your system to charge from the grid at the lowest cost, call the Scheduling API to create an IMPORT schedule that follows a low tariff.
The example below shows that your system will require 5,3kWh between 7 pm and 5 am the following day. The scheduling API will advise you to instruct your system to charge between 1 am and 5 am schedule.start_time
and schedule.end_time
.
curl --request POST \
--url https://api.flatpeak.com/schedules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"location_id": "loc_641b90b758fb8e6293716e40",
"max_power": {
"units": "W",
"value": "4000"
},
"data": [
{
"device_id": "dev_664525107c44d88a37ca1ad7",
"direction": "IMPORT",
"start_time": "2024-08-01T19:00:00Z",
"end_time": "2024-08-02T05:00:00Z",
"max_power": {
"units": "W",
"value": 4000
},
"energy": {
"units": "WH",
"value": 5300
}
}
]
}'
To get your system to supply the energy it previously stored when the grid import tariff is high, call the slots-threshold to obtain a list of high-peak tariff periods. Set relative=0.5
to get slots when the tariff is at the top 50% of the range.
curl --request GET \
--url 'https://api.flatpeak.com/slots/threshold/loc_65e42ce4d3b813479b252160 \
?start_time=2023-06-15T09%3A00%3A00Z \
&end_time=2023-06-16T09%3A00%3A00Z \
&direction=IMPORT \
&segment=HIGH \
&relative=0.5' \
--header 'Authorization: Bearer <token>'
If your customer has an export tariff, use the Scheduling API to create an export plan that sends energy to the grid when export tariff is high. You will need to be able to measure the amount of energy that “moves” out of the property and not just from your system into the property.
To use Scheduling API to create an export plan, you must know how much energy you will have available for export and when.
In the example below, you want to export 10kWh between 6 pm and 6 am the following day. The API suggests that you export between 6 pm and 11 pm exporting 10kWh and earning €9.28:
curl --request POST \
--url https://api.flatpeak.com/schedules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"location_id": "loc_641b90b758fb8e6293716e40",
"data": [
{
"device_id": "dev_65e6d8334c8d715963d99db3",
"direction": "EXPORT",
"start_time": "2024-08-01T18:00:00Z",
"end_time": "2024-08-02T06:00:00Z",
"max_power": {
"units": "W",
"value": 4000
},
"energy": {
"units": "WH",
"value": 10000
}
}
]
}'
To calculate the energy cost savings provided by your system, you need to record the cost of energy stored.
Call Metering API and submit IMPORT metering (at the device level) when your system is importing the energy. Set direction=IMPORT
and tariff_rate=IMPORT
to determine what it did cost.
curl --request POST \
--url https://api.flatpeak.com/meters/interval \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"start_time": "2024-08-02T01:00:00Z",
"end_time": "2024-08-02T02:00:00Z",
"device_id": "dev_65e6d8334c8d715963d99db3",
"location_id": "loc_641b90b758fb8e6293716e40",
"direction": "IMPORT",
"tariff_rate": "IMPORT",
"units": "W",
"value": 2034
}'
tariff_rate
to LOCAL
. If you send LOCAL
and IMPORT
meter readings covering the same period, they will be summarised.When your system supplies your customer’s premises with previously stored energy, log it as if supplied directly from the grid. Call submit-meter-interval setting direction=EXPORT
and tariff_rate=IMPORT
to determine what it could have cost.
curl --request POST \
--url https://api.flatpeak.com/meters/interval \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"start_time": "2024-08-01T08:00:00Z",
"end_time": "2024-08-01T09:00:00Z",
"device_id": "dev_65e6d8334c8d715963d99db3",
"location_id": "loc_641b90b758fb8e6293716e40",
"direction": "EXPORT",
"tariff_rate": "IMPORT",
"units": "W",
"value": 1214
}'
When your system exports energy to the grid, log it using the export tariff. Call submit-meter-interval endpoint setting direction=EXPORT
and tariff_rate=EXPORT
to determine what it earned from the grid.
curl --request POST \
--url https://api.flatpeak.com/meters/interval \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"start_time": "2024-08-01T08:00:00Z",
"end_time": "2024-08-01T09:00:00Z",
"location_id": "loc_641b90b758fb8e6293716e40",
"direction": "EXPORT",
"tariff_rate": "EXPORT",
"units": "W",
"value": 2144
}'
1. To get the cost of imports: Call calculate-energy-cost-by-interval endpoint to request the cost of imported energy (note the direction=IMPORT
) for the period for when you would like to provide the report:
curl --request POST \
--url 'https://api.flatpeak.com/costs/interval/dev_65e6d8334c8d715963d99db3?direction=IMPORT' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"start_time": "2024-08-01T00:00:00Z",
"end_time": "2024-08-01T23:59:59Z"
}'
2. To get the value of energy that your system supplied to premises: Then, call calculate-energy-cost-by-interval again to request what would be the cost of energy if your device did not supply it from storage (note the direction=EXPORT
); for the same period:
curl --request POST \
--url 'https://api.flatpeak.com/costs/interval/dev_65e6d8334c8d715963d99db3?direction=EXPORT' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"start_time": "2024-08-01T00:00:00Z",
"end_time": "2024-08-01T23:59:59Z"
}'
3. To get the value of exports: If your system is exporting energy to the grid, call calculate-energy-cost-by-interval endpoint for the third time to request the value of exported energy (note use of Location ID and direction=EXPORT
):
curl --request POST \
--url 'https://api.flatpeak.com/costs/interval/loc_641b90b758fb8e6293716e40?direction=EXPORT' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z"
}'
aggregation
parameter to get data for a week, month, or year.The difference between the tariff.value
figures in the IMPORT
and EXPORT
responses will be the savings your system has achieved.
The example below covers one day period and works out as follows:
- Imported 24,5KWh of energy at total cost of €0.94; averaging €0.04/KWh.
- Supplied 16.9KWh of energy at total cost of €1.18; averaging €0.69/KWh.
- This makes the tariff rate difference of €0.65/KWh or 178%.
- Calculate savings as
16.9KWh x €0.04/KWh = €0.676
versus16.9KWh x €0.69/KWh = €11.661
for the grand total of €11.59 saved.
Was this page helpful?