Skip to content

feat(ocpp): simulate Evify's in-stock chargers against the built-in CS - #1203

Merged
frahlg merged 6 commits into
masterfrom
cursor/ocpp-evify-sim-e2e-4cca
Sep 12, 2026
Merged

frahlg merged 6 commits into
masterfrom
cursor/ocpp-evify-sim-e2e-4cca

Conversation

@frahlg

@frahlg frahlg commented Sep 11, 2026

Copy link
Copy Markdown
Member

Add a local OCPP charge-point simulator for the Evify catalogue recorded on 11 September 2026: twelve OCPP models plus a Tesla Wall Connector entry that is skipped because it uses HTTP. It talks to Core's actual OCPP 1.6J and 2.0.1 server, including the modeled Charge Amps, Aura and Zaptec quirks.

The review findings are fixed. The network test now lives in go/test/e2e, gated by FTW_E2E=1, so ordinary unit tests do not start twelve charge points. Each transaction event gets a new sequence number. Accepted profiles preserve configured response lag; zero elapsed time no longer jumps current to its target.

Validation: sequence and lag regression tests fail on the original PR code and pass with the fix. make verify passes. The explicit E2E run passes for all twelve models through boot/adoption, plug-in, 10 A profile and 0 A pause, including Aura's connector retry and Zaptec serial identity. An unadopted charger remains pending. After merging #1199 locally, the generated driver snapshot was synced to its new pin before the final verification. Native bundle integrity passes; worker execution is unavailable on this Mac.

This is simulator and Core integration evidence. It does not qualify the physical charger models, their firmware or their cloud paths. No production control path, hardware, release or install changed.

Run the bounded integration suite with:

cd go
FTW_E2E=1 go test ./test/e2e -run 'Test(EvifyOCPPInventoryE2E|PendingEvifyChargerIsQuarantined)' -count=1 -timeout 120s

Note

Low Risk
New dev binary, example config, and opt-in E2E tests only; no production OCPP control or install path changes.

Overview
Adds sim-ocpp, a local OCPP 1.6J / 2.0.1 charge-point client that dials FTW’s built-in Central System as every Evify in-stock OCPP model (twelve units), with Tesla Wall Connector listed in the catalog but skipped (HTTP-only).

The ocppcp package models boot, transactions, periodic metering, smart-charging profile handling, and simple current/energy physics with configurable lag. Vendor quirks FTW already handles are simulated: Charge Amps remote-stop ACK without stopping, Aura connector-0 profile rejection, absolute profiles without start accepted but ignored, Zaptec identity = serial.

make sim-ocpp runs all models with -all -plug; make build emits bin/sim-ocpp. Local config.local.example.yaml turns OCPP on with credentials aligned to the simulator. Docs describe the workflow and the FTW_E2E=1 integration tests in go/test/e2e (full inventory steer/pause, pending quarantine, Aura retry, Zaptec serial).

Reviewed by Cursor Bugbot for commit 8e7268d. Bugbot is set up for automated code reviews on this repo. Configure here.

Add sim-ocpp so every OCPP charger Evify currently stocks can dial FTW
end-to-end: boot, smart charging, plug, 10 A set, and pause. Tesla Wall
Connector is catalogued and skipped because it has no OCPP. Charge Amps,
Aura and Zaptec quirks match what core already defends against.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@frahlg
frahlg marked this pull request as ready for review September 11, 2026 05:27
@cursor

cursor Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_2c2a245a-ed9f-4c2d-8e77-8460d032da30)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-11T05:31:15.709059Z bd7d76b Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bd7d76be6d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread go/test/e2e/ocpp_evify_test.go
Comment thread go/cmd/sim-ocpp/ocppcp/sim.go Outdated
Comment thread go/cmd/sim-ocpp/ocppcp/sim.go

@miravoss26 miravoss26 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed sim-ocpp — a new OCPP 1.6J/2.0.1 charge-point simulator that dials FTW's built-in Central System as every OCPP model in Evify's current inventory (12 chargers, Tesla correctly excluded since it has no OCPP).

Correctness: self-contained under go/cmd/sim-ocpp/, no production code paths touched, reuses the existing lorenzodonini/ocpp-go dep already used by go/internal/ocpp — no new dependency. The vendor quirks (Charge Amps ack-but-keep-charging on RemoteStop, Aura's connector-0 rejection + retry on connector 1, Zaptec dialing on its serial) match what core already defends against, and TestEvifyOCPPInventoryE2E actually dials all 12 models against a real local CS and exercises plug → steer → pause, not just unit-level mocks.

One non-blocking nit: stopTx()'s 2.0.1 branch always sends TriggerReasonEVCommunicationLost on Unplug() — that reason reads odd for a clean cable-out (StopAuthorized would be closer). Only matters if a future test starts asserting on TransactionEvent trigger reasons.

Security: local-only by default (127.0.0.1 binds, dev-only basic-auth creds), no secrets in the diff, no new external network destinations, no authz surface touched — it's a test double dialing a local dev server, not a production client.

Safe to merge from my read.

…im-e2e-4cca

Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
…im-e2e-4cca

Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@cursor

cursor Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_5d459b32-73c8-44d6-b733-c6a4a14aabf3)

…im-e2e-4cca

Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@cursor

cursor Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_dbc85c86-40a6-475f-ba79-43b5e966a214)

@frahlg
frahlg merged commit 5c7e5c7 into master Sep 12, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants