Skip to main content
When you know the amount of energy your device needs, call the schedule-by-amount endpoint. Flatpeak uses the Location’s tariff and, when a PV array is present, a local solar generation forecast to determine the most cost-efficient time slots for energy consumption or export.
curl --request POST \
  --url https://api.flatpeak.com/schedules/amount/loc_641b90b758fb8e6293716e40 \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "max_power": {
    "units": "KW",
    "value": 7000
  },
  "shaving_threshold": {
    "relative": 0.83,
    "absolute": 0.123
  },
  "data": [
    {
      "device_id": "dev_65e6d8334c8d715963d99db3",
      "tariff_direction": "IMPORT",
      "start_time": "2023-06-15T11:00:00Z",
      "end_time": "2023-06-16T11:00:00Z",
      "max_power": {
        "units": "W",
        "value": 7000
      },
      "energy": {
        "units": "KWH",
        "value": 37.2
      }
    }
  ]
}'
This endpoint is designed for both simple and very complex multi-device use cases - please contact support if you need assistance with the design of your implementation.