Repository navigation
feat(wallbox): Wallbox EV charger cloud component - #5410
Merged
Merged
Conversation
…mponent Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The fixtures follow the Home Assistant wallbox integration's test payload and are to be replaced by captures from a real charger. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…-off Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Also applies the formatter and spell checker fixes to wallbox.py and its tests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…nnot be lost From the whole-branch review: - car order comes from the account's charger list, numeric and append-only, so a failed status read or a charger added later cannot shift which charger is which car - an unexpected error in a queued control no longer wedges the event queue - a pause is recorded before it is sent, and the record survives Updating, Error and Unknown states; only a definite unplug clears it - a control state read that fails at start-up is retried Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ll cycle Matches the other components' harnesses: the run publishes the entities and shows the automatic configuration, then optionally sends one control. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Captured from a Pulsar Plus on firmware 6.7.43, with account identifiers replaced. The normaliser already read it correctly. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…s current state Seen live: a resume sent to a locked charger with no car returns 409. It is now a WallboxStateError with a plain message, and the command line mode prints a failed call instead of a traceback. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…min rights Seen live: a pause sent to a locked charger from an admin account returns 403. The error is now WallboxRefusedError and names both known causes. Refusals of controls the user sent are logged each time with the reason; the plan-led loop still logs once. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Wallbox refuses both while the charger is locked (seen live: 403 for pause, 409 for resume). One gate now covers the manual switch, plan-led control, release and the command line. A charger Predbat paused stays on its release list until it is unlocked. Also adds a read-only --get option to the command line mode for exploring API paths. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Entity ids keep the charger id; the friendly name now reads e.g. 'Wallbox Garage Power', so two chargers can be told apart. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A charger run by an OCPP backend reports operation_mode 'ocpp'. It is published as an attribute and shown in the command line table. The controls are unchanged and still fail on a charger the backend holds locked. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…e and location A charger run by an OCPP backend is skipped by Predbat-led charging, with one warning, and its lock warning now says the backend holds the lock. The status sensor gains timezone, country and zipcode attributes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ate is available Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ings Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved release and persistence failures can strand paused chargers, and individual command failures can block other chargers.
Review effort: Balanced
Findings: 4
Open (6)
Keep uncertain charger records pending until release is confirmed · New Handle per-charger API failures without blocking other chargers · New Persist pause state before requests and handle storage failures · New Prompt for omitted CLI passwords instead of exposing them · New Retry storage loads that return None after read failures · New Retry schedule restoration after a successful charger resume · New
What changed in this PR
Adds a direct Wallbox cloud integration to Predbat’s component system, supporting operation with or without Home Assistant.
Changes:
- Adds charger monitoring, automatic car configuration and manual controls.
- Introduces opt-in plan-led charging with persisted release state.
- Registers configuration options and adds tests, setup guidance and diagnostic tooling.
| File | Description |
|---|---|
| tools/debug-journal.md | Records live Wallbox API findings. |
| docs/superpowers/specs/2026-10-05-wallbox-component-design.md | Documents integration design and constraints. |
| docs/devices.md | Links the direct integration alternative. |
| docs/components.md | Documents setup, entities and controls. |
| docs/car-charging.md | Adds Wallbox charging guidance. |
| docs/apps-yaml.md | Lists Wallbox configuration keys. |
| CLAUDE.md | Updates the documented component inventory. |
| apps/predbat/wallbox.py | Implements transport, monitoring, controls and CLI. |
| apps/predbat/unit_test.py | Registers Wallbox tests. |
| apps/predbat/tests/test_wallbox.py | Covers transport and component behaviour. |
| apps/predbat/config/apps.yaml | Adds a commented configuration example. |
| apps/predbat/config.py | Defines Wallbox configuration validation. |
| apps/predbat/components.py | Registers the component and secret credentials. |
| AGENTS.md | Updates the documented component inventory. |
| .github/copilot-instructions.md | Adds Wallbox to component documentation. |
| .cspell/custom-dictionary-workspace.txt | Adds Eco-Smart terminology. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…tion, CLI password prompt From the Copilot review of #5410: - release keeps a paused charger on its list until a fresh status settles it; a charger that could not be read, or reports Updating, Error, Unknown or locked with a car, stays pending - a refused or failed command on one charger no longer stops the control or release loop for the others; rate limit and sign in errors still reach run() - the paused list is stored before a pause is sent, a failed save is retried, and an empty read from Storage is retried a few times - a schedule restoration that fails after a successful resume is tracked and retried - the command line mode prompts for the password when --password is omitted Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
# Conflicts: # tools/debug-journal.md
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…stored An empty answer from Storage is taken as nothing saved, as myenergi, GivEnergy EVC and Sunsynk do. A read that raises is still retried. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Adds a
wallboxcloud component, so a Wallbox charger works with Predbat directly, with or without Home Assistant. It follows the shape of the myenergi component.car_charging_energy,car_charging_planned,car_charging_power,car_charging_nowandnum_cars.wallbox_control, off by default): pauses and resumes each charger from its car's plan.python3 wallbox.py --username … --password …) that builds the component and runs one full cycle, as the other components do.The API is reimplemented over
aiohttpfrom the Home Assistantwallboxintegration and thewallboxPyPI library. No new dependency.Opened as a draft because of the hardware gaps listed under "Not yet verified".
Configuration
wallbox_username,wallbox_passwordwallbox_automaticTruewallbox_controlFalsewallbox_automaticwallbox_poll_seconds120Design points worth a reviewer's eye
car_order, taken from the account's charger list in numeric id order and append-only while Predbat runs. A failed status read or a charger added later cannot change which charger is which car.wallbox_controlremoved. This is the lesson from the myenergi entry in the debug journal. A pause is recorded before it is sent, and only a definite unplug clears the record.held_by_lock(), covers the manual switch, plan-led control, release and the command line. Predbat never unlocks a charger.operation_modeisocppis run by its backend (for example Octopus, for Intelligent Octopus Go). Plan-led control skips it with one warning, and the mode is published on the status sensor.Testing
apps/predbat/tests/test_wallbox.py: registered aswallbox, covering the transport, normalisation, publishing, events, automatic configuration, plan-led control and release, and error handling. All pass../run_all --quick: all tests pass.Verified on real hardware
One Pulsar Plus, firmware 6.7.43, run by Octopus's OCPP backend:
Not yet verified
The only charger available is held locked by its OCPP backend, so these have not been run on hardware:
Help from anyone with a Wallbox that is not on OCPP would be welcome:
python3 wallbox.py --rawprints what is needed.Known limits
car_charging_socis not set.plannedattribute also contains the first car's windows. That bug is inoutput.pyand is not fixed here.Documentation
docs/components.md: new Wallbox section with setup steps, entities, automatic configuration, Predbat-led charging, command line usage and options.docs/car-charging.md,docs/apps-yaml.md,docs/devices.md: Wallbox added alongside the other charger integrations; the existing "Wallbox Pulsar" section now points to the direct component.tools/debug-journal.md: a Wallbox entry with the live findings.docs/superpowers/: the design spec and implementation plan.🤖 Generated with Claude Code