OCPP - SolarNetwork/solarnetwork GitHub Wiki
SolarNetwork provides an OCPP 1.6J service that OCPP compliant chargers can be configured to communicate with. This OCPP integration provides the following features:
- Chargers are associated with SolarNode IDs, which must be owned by your SolarNetwork account. A SolarNode need not be physically deployed to work with OCPP; you can create a certificate-only SolarNode in SolarNetwork and use the ID for OCPP. Any number of chargers can be associated with a single SolarNode.
- The SolarUser OCPP API provides an API so you can manage the credentials and other settings required for chargers to connect to SolarNetwork.
- Charge session (transaction) data is translated into time-series datum streams, using the node ID associated with the charger and a source ID that you configure in your account-wide OCPP settings or charger-specific settings.
Two connection profiles are supported by SolarNetwork:
☝️ Note that HTTP Basic authentication is the preferred connection method.
To connect a charger to SolarNetwork using OCPP with HTTP Basic authentication, the following settings must be used:
Setting | Value | Description |
---|---|---|
URL | wss://in.solarnetwork.net/ocpp/j/v16 | The URL chargers must connect to. Note that chargers must append a /{chargePointId} path segment to the URL, where {chargePointId} is the info.id value specified on a charger entity. |
Auth type | Basic | HTTP Basic authentication is required. |
Username | A username configured on a credentials entity. |
|
Password | The password configured on the credentials entity for username . |
This connection configuration matches the TLS with Basic Authentication Profile - 2 security profile as defined in section 2.4 of the OCPP 1.6 Security specification.
If a user settings hid
value is available, the hid
can be included in the URL in order to have user events generated for connection failures, which can be useful when troubleshooting charger connection problems.
Setting | Value | Description |
---|---|---|
URL | wss://in.solarnetwork.net/ocpp/j/v16h/{hid} | The URL chargers must connect to. Note that chargers must append a /{chargePointId} path segment to the URL, where {chargePointId} is the info.id value specified on a charger entity. |
Auth type | Basic | HTTP Basic authentication is required. |
{hid} |
A user settings hid value from the user settings entity. |
|
Username | A username configured on a credentials entity. |
|
Password | The password configured on the credentials entity for username . |
If a charger is unable to use the HTTP Basic authentication connection method then the charger credentials can be provided in the URL itself, using the following settings:
Setting | Value | Description |
---|---|---|
URL | wss://in.solarnetwork.net/ocpp/j/v16u/{username}/{password} | The URL chargers must connect to. Note that chargers must append a /{chargePointId} path segment to the URL, where {chargePointId} is the info.id value specified on a charger entity. |
{username} |
A username configured on a credentials entity. |
|
{password} |
The password configured on the credentials entity for username . |
The {username}
and {password}
parts of the URL must be replaced by the charger's actual username
and password credentials. For example, if a charger's username is ch1
and password pass123
then
the URL to use would be wss://in.solarnetwork.net/ocpp/j/v16u/ch1/pass123
.
If a user settings hid
value is available, the hid
can be included in the URL in order to have user events generated for connection failures, which can be useful when troubleshooting charger connection problems.
Setting | Value | Description |
---|---|---|
URL | wss://in.solarnetwork.net/ocpp/j/v16hu/{hid}/{username}/{password} | The URL chargers must connect to. Note that chargers must append a /{chargePointId} path segment to the URL, where {chargePointId} is the info.id value specified on a charger entity. |
{hid} |
A user settings hid value from the user settings entity. |
|
{username} |
A username configured on a credentials entity. |
|
{password} |
The password configured on the credentials entity for username . |
🔥 Note the HTTP Basic authentication method is preferred, as URLs will be captured in SolarNetwork log files. The credentials are still encrypted in transit (between the charger and SolarNetwork). The URL path authentication method should only be used if a charger cannot support HTTP Basic authentication. Be sure to use unique credentials that are not shared with other services.
SolarNetwork turns OCPP meter readings associated with charging sessions (transactions) into datum streams. Each datum will contain the following properties:
Datum Property | Classif. | Description |
---|---|---|
nodeId |
The node ID configured on the charger entity. | |
sourceId |
The source ID derived from the charger-specific settings, or if not defined the account-wide settings. | |
created |
The date associated with this measurement, in ISO 8601 timestamp format in the UTC time zone. | |
sessionId |
s |
A unique charge session (transaction) ID. |
duration |
s |
The difference between the created of this datum and the start of the charging session, in seconds. |
endDate |
s |
The end date of the charge session (if ended), in ISO 8601 timestamp format in the UTC time zone. |
endReason |
s |
The session end reason (if ended). |
endToken |
s |
The authorization token used to end the charge session (if ended). |
token |
s |
The authorization token used to start the charge session. |
In addition, the OCPP Measurand values reported by chargers are translated into datum properties and normalized into standard units, as outlined in the following table.
Measurand | Datum Property | Units | Classif. | Description |
---|---|---|---|---|
Current.Export | currentReverse |
A | i |
Instantaneous current flow from EV. |
Current.Import | current |
A | i |
Instantaneous current flow to EV. |
Current.Offered | currentOffered |
A | i |
Maximum current offered to EV. |
Energy.Active.Export.Interval | wattHoursDiffReverse |
Wh | i |
Absolute amount of "active electrical energy" exported to the grid during an associated time "interval", specified by a Metervalues ReadingContext, and applicable interval duration configuration values (in seconds) for "ClockAlignedDataInterval" and "MeterValueSampleInterval". |
Energy.Active.Export.Register | wattHoursReverse |
Wh | a |
Numerical value read from the "active electrical energy" register of the most authoritative electrical meter measuring energy exported to the grid. |
Energy.Active.Import.Interval | wattHoursDiff |
Wh | i |
Absolute amount of "active electrical energy" imported from the grid supply during an associated time "interval", specified by a Metervalues ReadingContext, and applicable interval duration configuration values (in seconds) for "ClockAlignedDataInterval" and "MeterValueSampleInterval". |
Energy.Active.Import.Register | wattHours |
Wh | a |
Numerical value read from the "active electrical energy" register of the most authoritative electrical meter measuring energy imported from the grid supply. |
Energy.Reactive.Export.Interval | reactiveEnergyDiffReverse |
VARh | i |
Absolute amount of "reactive electrical energy" exported to the grid during an associated time "interval", specified by a Metervalues ReadingContext, and applicable interval duration configuration values (in seconds) for "ClockAlignedDataInterval" and "MeterValueSampleInterval". |
Energy.Reactive.Export.Register | reactiveEnergyReverse |
VARh | a |
Numerical value read from the "reactive electrical energy" register of the most authoritative electrical meter measuring energy exported to the grid. |
Energy.Reactive.Import.Interval | reactiveEnergyDiff |
VARh | i |
Absolute amount of "reactive electrical energy" imported from the grid supply during an associated time "interval", specified by a Metervalues ReadingContext, and applicable interval duration configuration values (in seconds) for "ClockAlignedDataInterval" and "MeterValueSampleInterval". |
Energy.Reactive.Import.Register | reactiveEnergy |
VARh | a |
Numerical value read from the "reactive electrical energy" register of the most authoritative electrical meter measuring energy imported from the grid supply. |
Frequency | frequency |
Hz | i |
Instantaneous reading of powerline frequency. NOTE: OCPP 1.6 does not have a UnitOfMeasure for frequency, the UnitOfMeasure for any SampledValue with this measurand is Hertz. |
Power.Active.Export | wattsReverse |
W | i |
Instantaneous active power exported by EV. |
Power.Active.Import | watts |
W | i |
Instantaneous active power imported by EV. |
Power.Factor | powerFactor |
i |
Instantaneous power factor of total energy flow. | |
Power.Offered | wattsOffered |
W | i |
Maximum power offered to EV. |
Power.Reactive.Export | reactivePowerReverse |
VAR | i |
Instantaneous reactive power exported by EV. |
Power.Reactive.Import | reactivePower |
VAR | i |
Instantaneous reactive power imported by EV. |
RPM | rpm |
RPM | i |
Fan speed in RPM. |
SoC | soc |
% | i |
State of charge of charging vehicle in percentage. |
Temperature | temp |
C | i |
Temperature reading inside Charge Point. |
Voltage | voltage |
V | i |
Instantaneous AC RMS supply voltage. |
If the OCPP Measurand values reported by chargers include a Phase property, the datum property names will include a phase suffix according to this table:
OCPP Phase | Datum Property Suffix |
---|---|
N |
_n |
L1 , L1N
|
_a |
L2 , L2N
|
_b |
L2 , L2N
|
_c |
L1L2 |
_ab |
L2L3 |
_bc |
L3L1 |
_ca |
Here are some examples:
Measurand | Phase | Datum Property |
---|---|---|
Current.Import | L3 | current_c |
Energy.Active.Import.Register | L1 | wattHours_a |
Voltage | L1N | voltage_a |
Voltage | L1L2 | voltage_ab |
SolarNetwork turns OCPP charger connector status updates into datum streams. Each datum will contain the following properties:
Datum Property | Classif. | Description |
---|---|---|
nodeId |
The node ID configured on the charger entity. | |
sourceId |
The source ID derived from the charger-specific settings, or if not defined the account-wide settings, with /status appended. |
|
created |
The date associated with the status update, in ISO 8601 timestamp format in the UTC time zone. | |
errorCode |
s |
The connector error code (if not NoError ). |
info |
s |
Optional free format information related to the status. |
sessionId |
s |
A unique charge session (transaction) ID for an active session, if there is one. |
status |
s |
The connector status. |
vendorErrorCode |
s |
A charger vendor-specific error code. |
vendorId |
s |
A charger vendor-specific identifier. |
location
parameter for this datum stream. Any resulting empty path
segments will be removed from the resolved source ID value. For example, given the default source ID
template /ocpp/cp/{chargerIdentifier}/{connectorId}/{location}
, a chargerIdentifier
of CP001
,
and a connectorId
of 1
the resolved source ID would be /ocpp/cp/CP001/1/status
.
An example connector status datum looks like this:
{
"nodeId": 1,
"sourceId": "/ocpp/cp/CP001/1/status",
"created": "2020-04-01T12:00:00.000Z",
"status": "Charging",
"sessionId": "17a8cc98-43fa-4233-ac1e-037f6667c163"
}