OCPP WS IOocpp-ws-io

Introduction

The complete, type-safe OCPP ecosystem for Node.js — RPC, Smart Charging, Protocol Translation, and Simulation.

ocpp-ws-io ecosystem

The complete, type-safe OCPP ecosystem for Node.js.

Historically, building an OCPP-compliant network has been an infrastructure nightmare. ocpp-ws-io ecosystem provides a modular, plug-and-play suite of tools built from the ground up in TypeScript to solve the hardest challenges in EV charging: end-to-end WebSocket RPC, Smart Charging power distribution, legacy-to-modern Protocol Translation, and enterprise-grade Load Testing.

Transparency: This ecosystem is a newer, open-source suite of libraries. It has been tested in controlled environments and small deployments — not yet at the scale of established standalone libraries like ts-ocpp or ocpp-eliftech. We built it to solve specific infrastructure gaps (clustering, smart charging math, proxying) that weren't addressed by existing tools. If you find issues, please report them.


🌍 The Ecosystem

Building a Charge Point Management System (CSMS) or Simulator shouldn't require you to invent everything from scratch. Our modular approach splits the complexities of the protocol into fully tested, interoperable packages.


Architecture Overview

The true power of the ecosystem is how effortlessly the components integrate:


Quick Starts

Choose the package you want to explore first:

Instantiate a strictly-typed WebSocket server with ocpp-ws-io.

npm install ocpp-ws-io
import { OCPPServer } from "ocpp-ws-io";

const server = new OCPPServer({ protocols: ["ocpp1.6", "ocpp2.1"] });

server.on("client", (client) => {
  client.handle("ocpp1.6", "BootNotification", ({ params }) => {
    return { status: "Accepted", currentTime: new Date().toISOString(), interval: 300 };
  });
});

await server.listen(3000);

👉 Read the Core RPC Guide

Distribute 100kW of grid power fairly across multiple cars without tripping the breaker.

npm install ocpp-smart-charge-engine
import { SmartChargingEngine, Strategies } from "ocpp-smart-charge-engine";

const engine = new SmartChargingEngine({
  siteId: "SITE-001",
  maxGridPowerKw: 100,
  algorithm: Strategies.EQUAL_SHARE,
  // Pass the computed charging limits strictly back down
  dispatcher: async ({ clientId, sessionProfile }) => {
    await server.safeSendToClient(clientId, "ocpp1.6", "SetChargingProfile", /*...*/);
  },
});

await engine.dispatch(); 

👉 Read the Smart Charge Guide

Let legacy OCPP 1.6 hardware communicate with a purely OCPP 2.1 backend.

npm install ocpp-protocol-proxy
import { OCPPProtocolProxy, presets } from "ocpp-protocol-proxy";

const proxy = new OCPPProtocolProxy({
  upstreamEndpoint: "wss://modern-csms:9000",
  upstreamProtocol: "ocpp2.1",
});

// Automatically map 1.6 BootNotification to 2.1 BootNotification
proxy.translate(presets.ocpp16_to_ocpp21);

👉 Read the Proxy Guide

On this page