> For the complete documentation index, see [llms.txt](https://docs.simplephysx.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.simplephysx.com/communications/ocpp.md).

# OCPP

**YAML key:** `ocpp`

OCPP adapter that can run as a Charge Point (`role: charge_point`) or as a Central System (`role: central_system`).

## Minimal configuration (Charge Point)

Example model (spx-examples): [`library/domains/energy/evse/generic/evse__ocpp.yaml`](https://github.com/HammerHeads-Engineers/spx-examples/blob/develop/library/domains/energy/evse/generic/evse__ocpp.yaml)

```yaml
communication:
  - ocpp:
      role: charge_point
      endpoint: "ws://localhost:9000/ocpp"
      subprotocol: "ocpp1.6"
      charge_point_id: "spx-evse-01"
      bindings:
        boot_notification:
          direction: outbound
          frame_type: call
          action: BootNotification
          payload:
            chargePointVendor: "#attr(cp_vendor)"
            chargePointModel: "#attr(cp_model)"
```

## Minimal configuration (Central System)

Example model (spx-examples): [`library/domains/energy/csms/generic/csms__ocpp.yaml`](https://github.com/HammerHeads-Engineers/spx-examples/blob/develop/library/domains/energy/csms/generic/csms__ocpp.yaml)

```yaml
communication:
  - ocpp:
      role: central_system
      server:
        host: 0.0.0.0
        port: 9000
        path: "/ocpp"
        subprotocol: "ocpp1.6"
      bindings:
        boot_request:
          direction: inbound
          frame_type: call
          action: BootNotification
          payload:
            chargePointVendor: "#attr(last_boot_vendor)"
            chargePointModel: "#attr(last_boot_model)"
```

## Notes

* Dependency: requires the Python `ocpp` package in the SPX Server environment.
* `bindings` can be a mapping (as shown) or a list.
