Add Site and Optimization Configurations
Site and optimization configuration is only available via the API or the Portal. If you use MQTT, OCPP Broker, or Eniris for data ingress and schedule egress, you still need the API or Portal for this configuration step. See Integration Options for details.
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 peak minimization or cost minimization, along with general optimization settings.
For a detailed breakdown of configuration parameters, refer to the configuration documentation.
Request
To configure a site, send a PUT request with the following JSON parameters. The example below demonstrates the simplest site configuration with one collector, one device, and optimization features. For more information on each field please have a look at the configuration documentation
- cURL
- Python
- JavaScript
curl -X PUT "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": 63,
"phase_voltage": 230,
"1P_3P": "3P"
}
],
"device_list": [
{
"name": "device_1",
"type": "charging_pole_3phase",
"collector": "collector_1",
"line_current": 32,
"pin_to_phase_mapping": {
"pin_list": ["pin1", "pin2", "pin3"],
"phase_list": ["L1", "L2", "L3"]
}
}
]
},
"optimization_configuration": {
"peak_minimization": {
"active": true,
"peak_limit": 5000
},
"cost_minimization_active": true
}
}'
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": 63,
"phase_voltage": 230,
"1P_3P": "3P"
}
],
"device_list": [
{
"name": "device_1",
"type": "charging_pole_3phase",
"collector": "collector_1",
"line_current": 32,
"pin_to_phase_mapping": {
"pin_list": ["pin1", "pin2", "pin3"],
"phase_list": ["L1", "L2", "L3"]
}
}
]
},
"optimization_configuration": {
"peak_minimization": {"active": True, "peak_limit": 5000},
"cost_minimization_active": True
}
}
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: 63,
phase_voltage: 230,
"1P_3P": "3P",
},
],
device_list: [
{
name: "device_1",
type: "charging_pole_3phase",
collector: "collector_1",
line_current: 32,
pin_to_phase_mapping: {
pin_list: ["pin1", "pin2", "pin3"],
phase_list: ["L1", "L2", "L3"],
},
},
],
},
optimization_configuration: {
peak_minimization: {
active: true,
peak_limit: 5000,
},
cost_minimization_active: true,
},
};
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.