Skip to content

Cookie preferences

We use cookies for our own analytics, to see how our campaigns perform and, if you allow it, to load content from other services such as the Google site search. We never sell your data. Necessary cookies keep the site working and cannot be switched off. See our Cookie Policy for details and our Privacy Policy for how we handle personal data.

Security, load balancing and remembering your cookie choice.

Show us which pages people read and how they find the site, so we can improve it (Google Analytics).

Show us which of our ad campaigns bring visitors to the site and remember the campaign or partner link you arrived from (Google Ads, partner program). We do not use these cookies to build advertising profiles.

Load the site search from Google when you use it. Google sets its own cookies and shows ads in the search results.

© 2026 The ThingsBoard Authors
Try for free

ThingsBoard Cloud

Choose your data region

Your data stays in the region you choose, for residency and compliance. No credit card required.

Rather run it yourself? Install on your own servers

OCPP

The OCPP Connector acts as a Central System, letting the gateway communicate with OCPP-compliant Charge Points and forward their data to ThingsBoard.

To enable this connector, add it to the connectors list in tb_gateway.json — see the General Configuration reference.

The connector reads its settings from a JSON file. Below is a full example:

{
"centralSystem": {
"name": "Central System",
"host": "127.0.0.1",
"port": 9000,
"connection": {
"type": "insecure"
},
"security": [
{
"type": "token",
"tokens": [
"Bearer ACCESS_TOKEN"
]
},
{
"type": "basic",
"credentials": [
{
"username": "admin",

Configures the gateway as an OCPP Central System — it listens for incoming Charge Point connections on the specified host and port.

Parameter Default Description
name Central System Display name for the Central System
host 127.0.0.1 Hostname or IP address the Central System binds to
port 9000 Port the Central System listens on

Configures the transport security between the Central System and Charge Points.

Plain WebSocket connection with no transport security. Suitable for testing, not recommended for production.

Parameter Default Description
type insecure Connection type
"connection": {
"type": "insecure"
}

Configures how Charge Points authenticate themselves when connecting to the Central System. An empty array disables authentication.

No authentication. Suitable for testing, not recommended for production.

"security": []

An array of Charge Point configurations. Each entry matches incoming connections by idRegexpPattern and defines how to name the corresponding ThingsBoard device and map its data.

Parameter Default Description
idRegexpPattern Regular expression matched against the Charge Point identifier
deviceNameExpression Expression to extract the device name from the BootNotification message
deviceTypeExpression Expression to extract the device type from the BootNotification message
attributes Mappings from OCPP messages to ThingsBoard device attributes
timeseries Mappings from OCPP messages to ThingsBoard time-series telemetry
attributeUpdates Configuration for pushing shared attribute updates to the Charge Point
serverSideRpc Configuration for forwarding ThingsBoard RPC calls to the Charge Point
"chargePoints": [
{
"idRegexpPattern": "charge_points/CP_1",
"deviceNameExpression": "${Vendor} ${Model}",
"deviceTypeExpression": "${Model}",
"attributes": [ ... ],
"timeseries": [ ... ],
"attributeUpdates": [ ... ],
"serverSideRpc": [ ... ]
}
]

Subsections “attributes” and “timeseries”

Section titled “Subsections “attributes” and “timeseries””

Both sections use the same field structure. attributes values are stored as device attributes in ThingsBoard; timeseries values are stored as time-series telemetry.

Parameter Description
messageTypeFilter Comma-separated list of OCPP message types this mapping applies to
key ThingsBoard attribute or telemetry key name
value JSON-path expression to extract the value from the incoming message
"attributes": [
{
"messageTypeFilter": "MeterValues,",
"key": "temp1",
"value": "${meter_value[:].sampled_value[:].value}"
},
{
"messageTypeFilter": "MeterValues,",
"key": "vendorId",
"value": "${connector_id}"
}
],
"timeseries": [
{
"messageTypeFilter": "DataTransfer,",
"key": "temp",
"value": "${data.temp}"
}
]

This configuration section is optional. ThingsBoard allows the provisioning of device attributes and fetches some of them from the device application. You can treat this as a remote configuration for devices, enabling them to request shared attributes from ThingsBoard. See user guide for more details.

The “attributeUpdates” configuration allows you to configure the format of the corresponding attribute data that will be sent to the Charge Point.

Parameter Description
attributeOnThingsBoard Shared attribute name to subscribe to
valueExpression JSON-path expression used to build the message payload sent to the Charge Point
"attributeUpdates": [
{
"attributeOnThingsBoard": "shared",
"valueExpression": "{\"${attributeKey}\":\"${attributeValue}\"}"
}
]

ThingsBoard allows sending RPC commands to the device connected to ThingsBoard directly or via Gateway.

Configuration, provided in this section is used for sending RPC requests from ThingsBoard to Charge Point.

Parameter Default Description
methodRPC Name of the RPC method that clients call to trigger this entry
action Standard OCPP command to send to the Charge Point (e.g. RequestStartTransaction, ClearCache, ChangeAvailability). If omitted, the payload is sent as a generic DataTransfer message instead
withResponse true Send the Charge Point’s response back to ThingsBoard
timeout 5 Seconds to wait for the Charge Point’s response before giving up and logging a timeout warning
valueExpression Template used to build the message payload sent to the Charge Point, filled in from the RPC call’s parameters
"serverSideRpc": [
{
"methodRPC": "startTransaction",
"action": "RequestStartTransaction",
"withResponse": true,
"timeout": 10,
"valueExpression": "{\"id_token\": {\"id_token\": ${params.idTag}, \"type\": \"ISO14443\"}, \"remote_start_id\": ${params.remoteStartId}, \"evse_id\": ${params.evseId}}"
},
{
"methodRPC": "clearCache",
"action": "ClearCache",
"withResponse": true,
"timeout": 5,
"valueExpression": "{}"
},
{
"methodRPC": "changeAvailability",
"action": "ChangeAvailability",
"withResponse": true,
"timeout": 5,
"valueExpression": "{\"operational_status\": ${params.status}, \"evse\": {\"id\": ${params.evseId}}}"
}
]