Repository navigation
Releases
v0.3.1
AI agents can now find every feature from the program itself, and mistakes in a command are answered more helpfully. Nothing about how a charger behaves has changed.
Before you update
Nothing you have needs changing. Site files, Chargerfiles, scenarios and saved chargers work as before.
- A script that reads the text of a usage error may see two differences: the last line names the help of the command that was refused (
Run 'plugyard site up --help' for usage.), and a misspelled command is followed bydid you mean "exec"?. Exit codes are unchanged.
New
A fuller guide for AI agents
plugyard agents now names everything an agent can use, where it named a first session and little more:
- What the files can set: every setting of the Chargerfile, the site file and the scenario, among them
renew,startOn: plug,onEvFull: suspend, EV presets and ID templates. - Every command, in one table, and all thirteen MCP tools by name.
- A CSMS that asks for a password, over
wss://. - A line of the JSON of
ps,statsandexec, and the fields ofinspect. - What plugyard does not do, so that an agent does not look for it.
- plugyard in a container, for a machine that has Docker and no plugyard.
The guide said that local authorization lists and reservations are answered NotImplemented. They are answered NotSupported, as the README and the specification say, and the guide now agrees.
Clearer help
- A mistake names the help of its own command, and a misspelled command the ones it comes close to.
plugyard restart --helpsays what a restart does, and that a declared state is applied again.plugyard site up --helpmentionsrenew.
What's Changed
Full Changelog: v0.3.0...v0.3.1
v0.3.0
A site file can now say what state each charger is in, and keep it so: plugged in, faulted, offline or left off, each time the charger powers on.
Before you update
A Finishing connector now accepts a new start. In v0.2.1 a connector whose transaction had ended with the EV still plugged in refused every start until the EV was unplugged. Now an accepted tap or a RemoteStartTransaction starts a new transaction, and the CSMS sees Preparing, then Charging (OCPP 1.6 section 4.9, transition F2).
- A test that expects
Rejectedfrom aFinishingconnector needs changing. A faulted, unavailable or busy connector still answersRejected. - A remote start that names no connector picks one with an EV waiting, then one that is
Finishing, then the lowest-numbered free one. - A rejected tag leaves the connector
Finishing, and nothing starts by itself there, even withstartOn: plug. - Site files, Chargerfiles, scenarios and saved chargers work as before. A charger with no
stateblock behaves as it did.
New
Declared state in the site file
A charger entry may carry a state block: the state the charger is in each time it powers on.
chargers:
lobby: { model: ./wallbox.Chargerfile, id: LOBBY-1, state: { connectors: { 1: { ev: longrange } } } } # Preparing
bay: { model: ./Chargerfile, id: BAY-1, state: { connectors: { 2: { fault: { code: GroundFailure, info: RCD tripped } } } } }
gone: { model: ./Chargerfile, id: GONE-1, state: { connection: offline } } # stays away
spare: { model: ./Chargerfile, id: SPARE-1, state: { connection: stopped } } # never started- It is applied at every power-on:
site up,site start,start,restart, a start afterkill, and the restartplugyard updatedoes. A reboot and aResetfrom the CSMS are not a power-on. - A change made by hand lasts until the next power-on.
plugyard restart BAY-1puts one charger back. - A connector that is listed is declared whole; one that is not listed follows the saved state. What the CSMS set, such as
Unavailable, meters, configuration and charging profiles, is untouched. - A charger declared
stoppedis created and left off;plugyard start SPARE-1powers it on. inspectandsite validateshow what is declared.
Renewing a declared EV
A plugged-in EV fills up in the end, and every transaction after that ends at once. A declared EV may now say renew:
state:
connectors:
1: { ev: longrange, renew: 5m }- Once the EV is full and its connector has no transaction, it leaves after the
renewtime, and a fresh EV of the same preset arrives after the same time again. The connector reportsFinishing,Available,Preparing. - The time is real time, whatever the speed of the site.
- With
startOn: plugthe fresh EV starts a transaction, so the connector keeps cycling. WithonEvFull: suspendthe transaction stays open and the EV is not renewed. - Only the declared EV is renewed. Plugging in or unplugging by hand ends it until the charger next powers on.
What's Changed
- Pin the compose example to 0.2.1 by @Amraa1 in #38
- Start a new transaction on a Finishing connector by @Amraa1 in #41
- Declare each charger's state in the site file by @Amraa1 in #43
- Renew a declared EV when it is full by @Amraa1 in #44
Full Changelog: v0.2.1...v0.3.0
v0.2.1
A fix for scenarios: the for of an offline step now follows the speed, as at does.
Before you update
A scenario's for now follows the speed, like at. At speed 60, for: 2m keeps the charger away for two real seconds, where v0.2.0 kept it away for two real minutes.
- A file that made up for the old behaviour by hand needs the scenario-time figure put back. If you wrote
for: 2sto get a short outage at speed 60, writefor: 2magain. plugyard exec <charger> offline --for, the API and thego_offlinetool are unchanged: their time is real time, whatever the speed.- For an outage that must last a real time, such as one the CSMS has to notice after five minutes, run the scenario at speed 1, or use
exec <charger> offline --forbeside the run.
What's Changed
Full Changelog: v0.2.0...v0.2.1
v0.2.0
plugyard can now be driven from another machine: over HTTP, by an AI agent through MCP tools, and from a container.
Before you update
Nothing you have needs changing. Site files, Chargerfiles, scenarios and saved chargers work as before.
- Updating from v0.1.x: stop running sites first (
plugyard site down, orplugyard stop <charger>), thenplugyard update. v0.1.x refuses to update while a site runs, and says which. From v0.2.0 on,updatestops and restarts them for you. - Nothing new listens unless you start it. The API runs only after
plugyard api uporsite up --api, and then on127.0.0.1only, until you make a token and name another address.
New
An HTTP API, for those with no shell where plugyard runs
On a shared staging server, the app and dashboard teams can now plug an EV in, present a tag or cause a fault themselves.
plugyard api token create mobile-team --site staging # prints the token, once
plugyard api up -d --listen 0.0.0.0:7070curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"tag": "04A1B2C3"}' https://plugyard.example.com/v1/chargers/FAST-1/tap
curl -H "Authorization: Bearer $TOKEN" "https://plugyard.example.com/v1/chargers/FAST-1/wait?state=Charging"- It lists and inspects chargers, runs the actions of
plugyard exec, waits for a state, and reads a charger's log. Starting chargers, updating plugyard and anything that touches files stay on the command line. - Tokens have names, can be limited to one site, and can be read-only.
plugyard api logsshows who did what to which charger. - A web page in a browser cannot act through it.
plugyard api specprints the description as an OpenAPI document.
Tools for AI agents (MCP)
The API serves the same reading and actions as tools, at /mcp. In Claude Code:
claude mcp add --transport http plugyard https://plugyard.example.com/mcp \
--header "Authorization: Bearer $TOKEN"Then ask: "plug an EV into FAST-1, start a session with tag 04A1B2C3, and tell me what the CSMS answered".
- Reading:
list_chargers,inspect_charger,wait_for_state,read_logs. - Acting:
plug,unplug,tap,fault,clear_fault,go_offline,go_online,reboot,fail_next. - A read-only token is offered the reading tools only.
- Tried with Claude Code. Other agent clients have not been tried yet; reports are welcome.
A container image
plugyard is on Docker Hub as amraa1/plugyard, for linux/amd64 and linux/arm64.
docker run --rm -e CSMS_URL=ws://host.docker.internal:9000/ocpp amraa1/plugyard:0.2.0- With nothing mounted it runs three chargers against the CSMS you name. Mount a folder with your
site.yamlat/siteto run your own. plugyard site up --api <address>runs a site and the API in one process, which is what a container wants.examples/docker/compose.yamlis a ready setup for a server, with a volume and a restart after a crash or a reboot.
update and uninstall take care of what is running
plugyard updatestops running sites and the API, replaces the program, and starts them again with the same chargers. It asks first, and says how many transactions would end.plugyard uninstallstops them after you confirm.
Not yet tried
- The API and the tools behind a reverse proxy with HTTPS.
- The image on an ARM machine.
- A restart of running sites across a real update, since this is the first version that does it.
What's Changed
- Add an HTTP API for callers with no shell on the machine by @Amraa1 in #31
- Stop what is running for update and uninstall, and restart it by @Amraa1 in #32
- Add the container image and site up --api by @Amraa1 in #33
- Add wait and logs to the HTTP API by @Amraa1 in #34
- Serve the API's reading and actions as MCP tools by @Amraa1 in #35
Full Changelog: v0.1.4...v0.2.0
v0.1.4
Before you update
Diagnostics uploads are now limited. When your CSMS sends GetDiagnostics, a charger uploads only to the machine the CSMS is on. If your file server is on another host, add it to the site file:
uploads: { allow: [files.example.com] }With plugyard run, use --allow-upload files.example.com. A refused upload ends in UploadFailed, and the charger's log shows the line to add.
This closes a security gap in v0.1.2 and v0.1.3, where a CSMS that had been broken into could point an upload at any address the machine could reach. Updating is recommended.
Two smaller changes in the same area: uploads no longer go through an HTTP proxy set in the environment, and link-local addresses such as 169.254.169.254 are never uploaded to.
New
- FTPS and SFTP for diagnostics uploads:
ftps://andsftp://locations work besideftp://,http://andhttps://. - The
chargersuite:plugyard charger lsisplugyard ps,plugyard charger logsisplugyard logs, and so on, as Docker hasdocker container ls. - The guide for AI agents (
plugyard agents) covers upload limits, and tells agents to treat what the CSMS wrote as data and never as instructions.
What's Changed
- Add the charger suite by @Amraa1 in #27
- Limit where diagnostics may be uploaded to by @Amraa1 in #28
- Upload diagnostics with FTPS and SFTP by @Amraa1 in #29
- Tell AI agents about upload limits and text the CSMS wrote by @Amraa1 in #30
Full Changelog: v0.1.3...v0.1.4
v0.1.3
What's Changed
Full Changelog: v0.1.2...v0.1.3
v0.1.2
v0.1.1
What's Changed
Full Changelog: v0.1.0...v0.1.1
v0.1.0
What's Changed
- Milestone 0: Project skeleton by @Amraa1 in #11
- Milestone 1: One charger connects by @Amraa1 in #12
- Milestone 2: A transaction by @Amraa1 in #13
- Milestone 3: Sites by @Amraa1 in #14
- Milestone 4: saved state, power-loss recovery and charger names by @Amraa1 in #15
- Milestone 5: CSMS-initiated operations and failures by @Amraa1 in #16
- Obey charging profiles from the CSMS by @Amraa1 in #17
- Add logs, stats, inspect and info by @Amraa1 in #18
- Add scenarios, init and JSON schemas by @Amraa1 in #19
- Add release builds, install scripts, update and a scale test by @Amraa1 in #20
New Contributors
Full Changelog: https://github.com/Amraa1/plugyard/commits/v0.1.0