A shortcut to the good stuff
Arrow keys to explore Enter to go
All engineering notes

EV systems / A DESIGN NOTE BY AADARSH

When a charger disconnects.

A walkthrough of the EV demo: disconnect at 1 kWh, reach 3 locally, then reconcile without adding the cumulative readings together.

A simulation I built for this portfolio, informed by my EV backend work. This is not a Numocity incident report or a description of its billing implementation.

Two counters, one simulated session

I gave the demo a local meter value and a separate value last seen by the platform. After you disconnect, the local meter can advance while the platform counter stays still. That makes the missing information visible instead of treating disconnection as zero consumption.

Continuing to charge while disconnected is an assumption of this demo. Actual behavior depends on the charger and its configuration.

Understand what the meter value represents

The demo starts at zero. Each click advances the cumulative meter by 1 kWh, up to 3 kWh. The readings 1, 2, and 3 therefore mean 3 kWh consumed, not 6.

I kept the baseline fixed so the duplicate-reading case is easy to inspect. This does not implement real meter-register offsets, resets, or different measurands.

Demo local meter:    3 kWh
Platform last seen:  1 kWh
Buffered readings:  2 kWh, 3 kWh
After reconciliation: 3 kWh, not 6 kWh

Reconnect and replay a reading

Disconnect after the first reading, add two more, and reconnect. The platform catches up from 1 to 3 kWh. Replaying the last reading leaves it at 3.

The event journal and the two counters let you check that result directly. This is a deterministic browser model, not a live WebSocket connection or an OCPP compliance test.

Retry the demo invoice

At the fictional rate of INR 12 per kWh, the 3 kWh session produces an INR 36 invoice. Retrying settlement keeps one invoice. No payment provider is called.

The example leaves out taxes, fees, real tariffs, and the operational recovery rules of a charging network. It demonstrates the state transitions, not a production billing guarantee.