
Design
To create a schedule optimised by energy cost:
Once the customer completes the Connect flow, or if you imported their tariff:- Create a default schedule that provides a fixed number of daily “on” hours when the tariff is low (i.e. 5 hours between 8pm and 6am on the following day).
- Allow the customer to change that schedule by setting a choice of:
- Number of daily “on” hours (add weekday/weekend and so on), or/and
- When the “on” period must end (i.e. complete charging by 6 am) or
- Absolute tariff threshold (i.e. “on” when the tariff is below $0.15/kWh), or
- Relative tariff threshold (i.e. “on” when the tariff is below 40% daily average).
To keep the schedule aligned with tariff changes:
- When an energy user (i.e. an EV) connects to your device or is scheduled daily:
- Pass schedule settings to the API,
- Receive actualised schedule (slots),
- Apply this actualised schedule to your device.
To log the amount of transferred energy:
- During or after the energy transfer, log it to meter records API under the IMPORT tariff.
- Log any energy from local generation (i.e., solar) under the LOCAL tariff.
To display the cost of transferred energy:
- When you want to display the energy cost, call the API to get it in real-time, aggregated by (charging) session or day/month/year.
Consider offering tariff threshold-based (aka price cap) scheduling as a premium feature.
Implementation
Creating and updating schedules
Creating and updating schedules
Once the customer’s tariff is added via Connect or imported via the API, program your device to enable energy delivery when the tariff is lowest:
To create an “on/off” schedule that provides a fixed number of daily “on” hours when the tariff is low, call the slots-time API endpoint and use the We recommend re-running the process every time an energy user (i.e. an EV) connects.
start_time
and end_time
values for the total period of the Response object to create a daily schedule in your device within this period.Metering energy transfers
Metering energy transfers
When you want to calculate the cost of energy that is being transferred (or has been transferred) via your device, submit its meter reading to one of the API endpoints:
If your system logs meter records as intervals, call submit-interval-meter-records API. You can use this endpoint to import historic records too.If your device is an EV charger, we recommend that you log records “tagged” by the charging session ID if you have it. Use the The API response will indicate that the submitted records have been processed successfully. You can submit up to 10,000 records at a time for a device or location.
session_reference_id
parameter in the request. This will make it easy to report the cost per charging session later.Make sure that you use the
units
parameter correctly: W represents the speed of transfer over the accounting period; WH represents the amount of energy transferred over that period.If your system can distinguish between energy sourced from the grid versus from local generation, such as solar, set
"tariff_rate": "LOCAL"
when submitting the records. This will tell Flatpeak to account for this energy as “free” when calculating its cost.Displaying energy cost
Displaying energy cost
When you want to display the cost of energy that has been transferred via your device for a charging session, and you have previously “tagged” your meter records with
session_reference_id
, use calculate-energy-cost-by-session-id API: