Step 2: Start sending data
Each site configuration is linked to an MQTT topic. This topic is included in the response body when a new site is created, like we did in the previous step.
Lost your MQTT topic? No worries—retrieve the site details via the API. View API Docs.
It's currently not possible to get the credentials to the mqtt cluster through the API. You should have received these from us but if not, you can contact our support
Publishing measurements and transactions to MQTT
To start sending data, configure an MQTT client to publish messages from the charging station. This is typically done within a local PLC, an EMS platform or another device that bridges the Pleevi solution with local infrastructure.
There are two types of messages that should be sent over MQTT:
- Energy Measurements - Provides the latest energy status of a metered device. We require these to be sent at least every 5 minutes but ideally every minute.
- Transactions - Provides details about active charging sessions. These are OCPP-like transactions, enhanced with driver departure time and requested energy. These should be sent on an event-basis.
The topics that each of these need to be send to can be found on the Site payload when retrieving or creating a site. View API Docs
Energy Measurements
These messages provide the latest energy measurement status of a metered device, such as a charging pole, subcollector meter, or any device supplying energy data (metered, estimated, or calculated).
| Fieldname | Description |
|---|---|
assetId | unique id of the asset (a metered device, this should match the name of the device in the site configuration) |
timestamp | timestamp the transaction message was send. |
energyValue | The measured energy value on the electricity meter of the charging station in Wh. |
powerValue | The power that is being charged at this charging station in W. |
currentValue | The current that is being passed through this charging station in amperes. |
pins | The power value, energy value and voltage value for each pin. If you do not have access to this information, you can just provide 0 values. |
JSON Structure:
{
"assetId": "<ASSET_ID>",
"timestamp": "2024-05-28T10:52:00+00:00",
"energyValue": 2371835,
"powerValue": 3463.99,
"pins": {
"p1": {
"currentValue": 4.7,
"powerValue": 1154,
"energyValue": 314,
"voltageValue": 231.81
},
"p2": {
"currentValue": 4.7,
"powerValue": 1154,
"energyValue": 314,
"voltageValue": 241.13
},
"p3": {
"currentValue": 4.7,
"powerValue": 1154,
"energyValue": 314,
"voltageValue": 241.35
}
}
}
for charging stations, energyValue can be both a cummulative counter (absolute value) or a relative counter (value since the start of the session).
Transactions
Transaction messages provide data on active charging sessions. Smart charging decisions and power optimizations are based on these messages.
JSON Structure:
{
"assetId": "6d1e358e-8f8c-488d-b234-9564c3c282be",
"transactionId": "d9108f64-669d-411c-a963-9c365cbc5dcc",
"timestamp": "2023-02-23T09:43:33+00:00",
"transactionState": "Started",
"startTime": "2023-02-23T09:43:33+00:00",
"stopTime": "0000-00-00T00:00:00+00:00",
"noChargingPhases": "3Phase",
"usedChargingPins": ["pin1", "pin2", "pin3"],
"maxPower": 7000.0,
"smartCharging": true,
"requestedMinEnergy": 20000.0,
"requestedMaxEnergy": 24000.0,
"estimatedDepartureTime": "0000-00-00T00:00:00+00:00",
"priority": 0,
"profile_id": "profile-1"
}
| Fieldname | Description |
|---|---|
assetId | unique id of the (virtual) asset |
transactionId | unique id of the transaction |
timestamp | timestamp the transaction message was send. |
transactionState | Started, Updated, SuspendedEV or Ended. |
startTime | datetime of the time the transaction started |
stopTime | datetime filled in after the session stopped |
noChargingPhases | Number of charging phases, 1P (1 phase charging vehicle), 2P (2 phase charging vehicle) or 3P (3 phase charging vehicle) |
usedChargingPins | A list indicating the pins that are used for charging. 1 phase charging transactions should only include one pin ["pin2"] while 3 phase charging transactions should always include all pins ["pin1", "pin2", "pin3"]. The order of these charging pins is not important. The names of these pins should link to the pin_to_phase_mapping found on the linked device on the site_configuration. |
maxPower | float, indicating the maximum power the vehicle is able to charge. This information is required to optimize. If the max power is not available in the "Started" transaction, it's allowed to send this information in a follow-up Update event. |
smartCharging | boolean, false or true to indicate if the transaction should be taken into account in the smart charging optimization. |
requestedMinEnergy | float, the minimum amount of energy to be charged in this session. The value should stay the same through the entire transaction, unless the user has changed the initial requested energy. |
requestedMaxEnergy | float, the maximum amount of energy to be charged in this session. The value should stay the same through the entire transaction, unless the user has changed the initial requested energy. |
estimatedDepartureTime | datetime, the indicated time the car will leave |
priority | integer field to indicate the priority of a charging session/transaction. The higher the value, the higher the priority. Default value is 0, meaning no/lowest priority. |
profile_id | profile_id related to this transaction. This will be used to retrieve the configured default estimatedDepartureTime, requestedMinEnergy and requestedMaxEnergy from the profile. See Profiles |
transactionStates- Started: This transaction should be published as soon as the EV begins charging. Ideally, all required information is already available at this point.
- Updated: If some information was missing during the "Started" transaction, you can publish an "Updated" transaction once the missing data becomes available.
- SuspendedEV: This event is triggered by the EV itself, for example, when the battery is fully charged. The EV stops charging but remains physically connected to the charging station.
- Ended: This event should be published when the charging session finishes, and the EV is physically disconnected from the charging station.
requestedMinEnergy and requestedMaxEnergy- If only one requested energy value exists, set both
requestedMinEnergyandrequestedMaxEnergyto the same value. - If you do not know this information you can rely on default profiles that can be configured via our portal or API See Profiles.
estimatedDepartureTime- The estimated departure time should always be provided. Either immediately on the Started transaction or as a follow-up Updated transaction.
- If you do not know this information you can rely on default profiles that can be configured via our portal or API See Profiles.
Need Help?
If you have any issues, contact our support team at support@pleevi.ai.