autimit/ocpp-zig-poc
CSMS simulator for electric vehicle charging sessions using mocked JSON data inspired by the OCPP 1.6 protocol. Includes power, energy, and cost calcu...
Autimit Charge is a lightweight simulator build in Zig to model EV charging session, const computation, and host profit sharing. It uses mocked session data based on typical smart charger behavior and OCPP-inspired events.
The project uses a JSON file to simulate a charging session. This mock file represents a 2.5-hour charging event with the following properties:
{
"sessionId": "sess-001",
"startedAt": "2025-05-31T14:00:00Z",
"endedAt": "2025-05-31T16:30:00Z",
"voltage": 220.0,
"current": 16.0,
"pricePerKwh": 1.25,
"hostCommission": 0.3,
"energyDelivered": 5.28
}
sessionId: Unique identifier for the session.
startedAt / endedAt: Timestamps defining the session duration.
voltage: Voltage (V) supplied during charging.
current: Current (A) drawn by the vehicle.
pricePerKwh: Price charged per kilowatt-hour.
hostCommission: Percentage of the revenue that goes to the charging station host.
energyDelivered: Total energy delivered in kWh (used for reporting).
Make sure you have Zig installed (version 0.14.1 or later).
https://github.com/hirowf/ocpp-zig-poc
cd ocpp-zig-poc
zig build
./zig-out/bin/autimit_ocpp