Step 3: Add Site and Optimization Configurations
Overview
Each site requires two key configurations:
- Site Configuration: Defines the site's electrical topology, necessary for optimization. Without this, the system cannot provide accurate recommendations.
- Optimization Configuration: Determines the optimization goals, such as maximizing PV consumption or reducing costs, along with general optimization settings.
info
For a detailed breakdown of configuration parameters, refer to the configuration documentation.
Request
To configure a site, send a POST request with the following JSON parameters. The example below demonstrates the simplest site configuration with one collector, one device, and expanded optimization features. For more information on each field please have a look at the configuration documentation
- cURL
- Python
- JavaScript
curl -X POST "https://api.pleevi.ai/v1/sites/{site_id}/site-configuration" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
-d '{
"site_configuration": {
"collector_list": [
{
"name": "collector_1",
"children": [],
"line_current": 0,
"line_voltage": 0,
"1P_3P": "3P"
}
],
"device_list": [
{
"name": "device_1",
"type": "charging_pole_3phase",
"collector": "collector_1",
"line_current": 0
}
]
},
"optimization_configuration": {
"peak_minimization": {
"active": true,
"peak_limit": 5000,
"peak_price": 0.10
},
"cost_minimization": {
"active": true,
"fixed_offtake_price": 0.15,
"injection_price": 0.08
},
"day_ahead_price": false
}
}'
import requests
url = "https://api.pleevi.ai/v1/sites/<SITE_ID>/site-configuration"
headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": "Bearer <YOUR_ACCESS_TOKEN>",
}
data = {
"site_configuration": {
"collector_list": [
{
"name": "collector_1",
"children": [],
"line_current": 0,
"line_voltage": 0,
"1P_3P": "1P"
}
],
"device_list": [
{
"name": "device_1",
"type": "charging_pole_3phase",
"collector": "collector_1",
"line_current": 0
}
]
},
"optimization_configuration": {
"peak_minimization": {"active": true, "peak_limit": 5000, "peak_price": 0.10},
"cost_minimization": {
"active": true,
"fixed_offtake_price": 0.15,
"injection_price": 0.08
},
"day_ahead_price": False
}
}
response = requests.put(url, json=data, headers=headers)
if response.status_code == 200:
print("Site configuration added:", response.json())
else:
print("Error:", response.status_code, response.text)
const axios = require("axios");
const url = "https://api.pleevi.ai/v1/sites/<SITE_ID>/site-configuration";
const data = {
site_configuration: {
collector_list: [
{
name: "collector_1",
children: [],
line_current: 0,
line_voltage: 0,
"1P_3P": "1P",
},
],
device_list: [
{
name: "device_1",
type: "charging_pole_3phase",
collector: "collector_1",
line_current: 0,
},
],
},
optimization_configuration: {
peak_minimization: {
active: true,
peak_limit: 5000,
peak_price: 0.1,
},
cost_minimization: {
active: true,
fixed_offtake_price: 0.15,
injection_price: 0.08,
},
day_ahead_price: false,
},
};
axios
.put(url, data, {
headers: {
Accept: "application/json",
"Content-Type": "application/json",
Authorization: "Bearer <YOUR_ACCESS_TOKEN>",
},
})
.then((response) => console.log("Site configuration added:", response.data))
.catch((error) =>
console.error("Error:", error.response?.data || error.message)
);
Need Help?
For any assistance, reach out to our support team at support@pleevi.ai.