Simulates OCPP 1.6J EV chargers, to develop and test a CSMS without hardware.
580
plugyard simulates EV chargers that speak OCPP 1.6J, so that you can develop and test a CSMS (charging station management system) without hardware. This image is the whole program: one container runs as many chargers as your site file declares.
With your CSMS listening on port 9000 of this machine:
docker run --rm -e CSMS_URL=ws://host.docker.internal:9000/ocpp amraa1/plugyard
Three chargers, CP-1 to CP-3, connect to ws://host.docker.internal:9000/ocpp/<charge point ID>, send BootNotification and print everything they say and hear. Ctrl+C stops them.
--add-host host.docker.internal:host-gateway.wss:// gets it from -e CSMS_PASSWORD=....localhost is the container itself. A CSMS on the same machine is at host.docker.internal.Everything after the image's name goes to plugyard, and docker exec runs a command in a container that is up:
docker run -d --name plugyard -e CSMS_URL=ws://host.docker.internal:9000/ocpp amraa1/plugyard
docker exec plugyard plugyard ps # every charger and its connectors
docker exec plugyard plugyard exec CP-1 plug # plug an EV in
docker exec plugyard plugyard exec CP-1 tap 04A1B2C3 # present an RFID tag
docker exec plugyard plugyard wait CP-1 Charging # returns once it charges
docker exec plugyard plugyard logs CP-1 --tail 20 # the OCPP messages, both ways
A charger can also report a fault, lose its connection, reboot, lose power, and fail a firmware update or a diagnostics upload. docker exec plugyard plugyard exec --help lists the actions.
| In the container | Holds | Give it |
|---|---|---|
/site | site.yaml and its Chargerfiles | Your folder, mounted there. Without one, the three chargers above run |
/data | Saved chargers, logs and API tokens | A volume, or the chargers start with meters at zero in every new container |
Port 7070 | The HTTP API, when it is started | A published port, behind HTTPS |
To get a site file to start from, write the starter files into the current folder:
docker run --rm -v "$PWD:/site" amraa1/plugyard init
The container runs as a user that is not root, so on Linux the folder must be writable by others for this one command. The README says what a site file and a Chargerfile can hold.
Others, and AI agents, can act on the chargers without a shell on the server: over HTTP, and as MCP tools at /mcp. A compose file for that:
services:
plugyard:
image: amraa1/plugyard:0.3.1
command: ["site", "up", "--api", "0.0.0.0:7070"]
environment:
CSMS_URL: ws://host.docker.internal:9000/ocpp
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./:/site:ro
- plugyard-data:/data
ports:
- "7070:7070"
restart: unless-stopped
stop_grace_period: 30s
volumes:
plugyard-data:
docker compose run --rm plugyard api token create mobile-team # prints the token, once
docker compose up -d
docker compose exec plugyard plugyard ps
stop_grace_period gives the chargers time to end their transactions with StopTransaction when the container stops.The same file, with comments, is examples/docker/compose.yaml.
| Tag | Is |
|---|---|
A full version, such as 0.3.0 | One release. Use this: it never changes |
Its first two numbers, such as 0.3 | The newest release of that line |
latest | The newest release |
Every release is listed with what it changes at github.com/Amraa1/plugyard/releases.
Each is built for linux/amd64 and linux/arm64. To update, change the tag and start the container again. A container is replaced by a newer image, not by plugyard update.
distroless/static. docker exec plugyard sh does not work; docker exec plugyard plugyard <command> does.docker stop shuts the chargers down in the orderly way.docker run --rm amraa1/plugyard agents prints a guide written for agents that drive plugyard, matching the version of the image.
Content type
Image
Digest
sha256:78c0e7be8…
Size
7.5 MB
Last updated
3 days ago
docker pull amraa1/plugyard