Start listening to the advices (MQTT)
This guide covers receiving schedules via MQTT. If you use the Smart OCPP Broker, schedules are sent directly to the charging stations via OCPP. With Eniris Smart Grid One, schedules are delivered directly to the Eniris controller. See Integration Options for a full comparison.
Activate Your Site
Once a site has been created, and measurements and transactions are being sent (via MQTT), you must ensure that there are no validation errors. Once validated, the site can be activated for optimization.
To activate your site, update its configuration as follows:
- cURL
- Python
- JavaScript
curl -X POST "https://api.pleevi.ai/v1/sites/<SITE_ID>/activate" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"
import requests
url = "https://api.pleevi.ai/v1/sites/<SITE_ID>/activate"
headers = {
"accept": "application/json",
"Content-Type": "application/json",
"Authorization": "Bearer <YOUR_ACCESS_TOKEN>"
}
response = requests.post(url, headers=headers)
print(response.json())
fetch("https://api.pleevi.ai/v1/sites/<SITE_ID>/activate", {
method: "POST",
headers: {
Accept: "application/json",
"Content-Type": "application/json",
Authorization: "Bearer <YOUR_ACCESS_TOKEN>",
},
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
Subscribing to MQTT topics
The optimized charging schedules will be send via MQTT. So setup a MQTT client that listens to the dedicated MQTT topic. Optimized charging schedules are delivered via MQTT.
You can find the MQTT topics on the payload of the Site. View API Docs.
Subscribe to MQTT topic
Every 15 minutes the optimized charging schema's are send via MQTT. The only thing you need to do is rely on an MQTT client for your language of choice and subscribe to the dedicated topic of that site.
Here is an example of the messages you'll be receiving in this case:
{
"assetId": "CHARGING_STATION_34",
"timestamp": "2023-02-23T09:59:06+00:00",
"adviceId": "advice_2023-02-23T10:00:00+00:00",
"status": "OptimizationFound",
"profile": [
{
"timestamp": "2023-02-23T10:00:00+00:00",
"powerValue": 5644
},
{
"timestamp": "2023-02-23T10:15:00+00:00",
"powerValue": 5644
},
{
"timestamp": "2023-02-23T10:30:00+00:00",
"powerValue": 5644
},
{
"timestamp": "2023-02-23T10:45:00+00:00",
"powerValue": 5644
},
{
"timestamp": "2023-02-23T11:00:00+00:00",
"powerValue": 0
},
{
"timestamp": "2023-02-23T11:15:00+00:00",
"powerValue": 0
},
{
"timestamp": "2023-02-23T11:30:00+00:00",
"powerValue": 3500
},
{
"timestamp": "2023-02-23T11:45:00+00:00",
"powerValue": 3500
}
...
]
}
Done!
Congratulations! Your charging station is now being optimized!
Take into account that it takes some time for our models to be fully optimized. Depending on your configuration we will be tracking the uncontrollable load and PV efficiency. Nonetheless, from the moment the configuration is done you should already see significant improvements.