Skip to content

Add GoodWe Wallbox (Gen2) charger#29822

Draft
andig wants to merge 5 commits into
masterfrom
feat/charger-goodwe-wallbox
Draft

Add GoodWe Wallbox (Gen2) charger#29822
andig wants to merge 5 commits into
masterfrom
feat/charger-goodwe-wallbox

Conversation

@andig
Copy link
Copy Markdown
Member

@andig andig commented May 11, 2026

Summary

Draft charger driver for the GoodWe AC EV Charger Gen2 (e.g. GW11K-HCA) via Modbus TCP, requested in discussion #13970.

Implements the full api.Charger surface plus optional capabilities:

  • Status, Enable/Enabled, MaxCurrent/MaxCurrentMillis (current → power conversion, clamped to hardware max)
  • Meter / MeterEnergy
  • PhaseCurrents, PhaseVoltages
  • PhaseSwitcher / PhaseGetterdynamically registered at startup if register 10023 (phase-switch enabled) = 1
  • Identifier (16-byte ASCII serial)

The constructor reads hardware capabilities from three registers before registering capabilities:

  • 10058 (goodweRegPowerSpec): hardware power class (0=7 kW, 1=11 kW, 2=22 kW) — used to clamp the power setpoint
  • 10059 (goodweRegPhaseSpec): hardware phase count (0=1-phase, 1=3-phase) — initialises phases
  • 10023 (goodweRegPhaseSwEnabled): whether 1p/3p switching is available on this unit — PhaseSwitcher/PhaseGetter are only registered via implement.Caps when this is 1

The constructor also forces charging_mode = fast (register 10032 = 0) so evcc fully owns the PV-surplus logic — the discussion notes that the wallbox's internal PV mode still draws from the grid when insufficient PV is available.

Protocol source

Register map and write semantics were derived from the Home Assistant integration on the gen2-modbus branch (wallbox_modbus.py), which documents itself as "AC EV Charger 2nd Gen Modbus Protocol v1.0.15".

⚠️ Not vendor-verified

This implementation has not been validated on physical hardware. Marked as draft pending a hardware test by someone with the device. The discussion author may be willing to test.

Connection prerequisites (also captured in the template description):

  • Modbus TCP enabled in SolarGo (Communication → Wallbox)
  • Default device ID 247 (0xF7), port 502
  • The wallbox only accepts 2 concurrent TCP sessions (1 cloud, 1 client) — if SEMS cloud is active, evcc may compete for the second slot

Test plan

  • go build ./...
  • go test ./charger/
  • go vet ./charger/
  • gofmt -l charger/goodwe.go
  • Live test against GW11K-HCA hardware

Adds a Modbus TCP charger driver for the GoodWe AC EV Charger Gen2,
including the GW11K-HCA model. Implements Status, Enable, MaxCurrent
(power-mapped), MaxCurrentMillis, Meter, ChargeRater, MeterEnergy,
PhaseCurrents, PhaseVoltages, PhaseSwitcher, and Identifier.

Protocol details derived from the Home Assistant integration
(gen2-modbus branch); the implementation has not been validated on
physical hardware. Default device ID 247 (0xF7), port 502.

Refs #13970

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@andig
Copy link
Copy Markdown
Member Author

andig commented May 11, 2026

@premultiply is this usable?

@andig andig added the devices Specific device support label May 11, 2026
Comment thread charger/goodwe.go Outdated
Co-authored-by: premultiply <4681172+premultiply@users.noreply.github.com>
Comment thread charger/goodwe.go
if enable {
v = goodweChargeStart
}
_, err := wb.conn.WriteSingleRegister(goodweRegChargeCommand, v)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unsure if that creates/terminates a session.

Try maxcurrent-zero stragegy?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Any change you're happy with. Needs testing anyway.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's try it first this way

Comment thread charger/goodwe.go Outdated
Co-authored-by: premultiply <4681172+premultiply@users.noreply.github.com>
Comment thread charger/goodwe.go Outdated
@premultiply
Copy link
Copy Markdown
Member

Will fix it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devices Specific device support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants