evcc icon indicating copy to clipboard operation
evcc copied to clipboard

go-e: one-shot HTTP API v2 detection is not retried - a single failed probe at startup permanently degrades the charger to API v1

Open konzty opened this issue 2 weeks ago • 2 comments

Describe the bug

The go-e driver decides once, at charger creation, whether the box speaks HTTP API v1 or v2 (LocalAPI.upgradeV2 probes GET /api/status?filter=alw exactly once). If that single request fails for a transient reason — e.g. the charger or the network is not yet reachable right after a host reboot — the driver permanently falls back to API v1 and never re-evaluates it.

Current go-e firmware (here: go-eCharger V4, firmware 59.4) no longer serves API v1 at all, so from that moment on every status read and every write fails:

[lp-1] ERROR charge power: unexpected status: 404 (Not Found) GET http://192.168.1.202/status
[lp-1] ERROR charge currents: unexpected status: 404 (Not Found) GET http://192.168.1.202/status
[lp-1] ERROR charge voltages: unexpected status: 404 (Not Found) GET http://192.168.1.202/status
[lp-1] ERROR charge total import: unexpected status: 404 (Not Found) GET http://192.168.1.202/status
[lp-1] ERROR charger status: unexpected status: 404 (Not Found) GET http://192.168.1.202/status

Because the control loop reads the charger every interval, this emits 5 error lines every 30 s indefinitely (~6400 lines in 10 h), and charging control is completely broken (no power/currents/status, no phase switching).

Steps to reproduce

  1. Use a go-e charger that only serves HTTP API v2 (/status → 404, /api/status?filter=alw → 200).
  2. Start evcc while the charger is not yet reachable for that first request (here: evcc came up 9 s after a host reboot).
  3. evcc uses v1 from then on; restarting evcc fixes it.

Configuration details

chargers:
  - name: wallbox
    type: go-e-v3
    uri: http://192.168.1.202

The template is irrelevant — type: go-e behaves the same, the detection lives in NewLocal.

Logs

evcc 0.319.0, same charger, same firmware, two consecutive starts:

start charger: line API used
16.11. 12:12:15 power ✓ energy ✓ currents ✓ phases ✓ v2 (correct)
16.11. 22:21:58 power ✓ energy ✓ currents ✓ phases ✗ + WARN db:5: ignoring stored phases 0: charger does not support phase switching v1 (wrong)

Host timeline:

journalctl boot -1:  Nov 16 20:21:31  europa systemd[1]: Shutting down.
journalctl boot  0:  Nov 16 21:21:41  europa kernel: rtc_cmos … setting system clock
evcc:                2026/11/16 22:21:50  evcc 0.319.0

Device checked directly while the errors were ongoing:

$ curl -s -o /dev/null -w '%{http_code}\n' http://192.168.1.202/status
404
$ curl -s -o /dev/null -w '%{http_code}\n' 'http://192.168.1.202/api/status?filter=alw'
200
$ curl -s -o /dev/null -w '%{http_code}\n' 'http://192.168.1.202/api/set?frc=0'
200

After docker compose restart evcc the driver detects v2 again (phases ✓) and the errors stop immediately.

Possible fix

Re-evaluate the API version instead of deciding once, e.g.

  • retry the v2 probe periodically while running in v1 mode, or
  • re-probe when v1 requests fail — a 404 on /status is a strong signal that the box speaks v2 only.

Making the API version configurable (as suggested in #20588) would be a pragmatic escape hatch, but the automatic re-check would fix it for everyone.

Related

  • #20588 — same symptom, closed for lack of logs; the excerpt above is that log.

(Issue drafted with AI assistance — opencode.)

konzty avatar Nov 17 '26 07:11 konzty

The analysis matches the code. In charger/go-e/api.go, NewLocal calls upgradeV2() once. A single failed GET api/status?filter=alw sets v2 = false, and nothing re-probes it. charger/go-e.go also reads IsV2() at construction, for example to register phase switching (line 78). A late re-probe would therefore have to update those capabilities too, not just the URI. That is why this looks like a design change rather than a one-line fix.

Possible directions:

  • Retry the probe at startup with a short backoff, so a charger that isn't reachable yet is not downgraded.
  • Fail charger creation if the probe fails with a network error. Only an actual 404 on api/status would mean v1. evcc's existing device retry would then handle the rest.

The second option looks simplest and keeps the capability detection consistent.

Related: #20588 (same symptom, closed without logs).

cc @premultiply

🤖 Generated with Claude Code

github-actions[bot] avatar Nov 17 '26 07:11 github-actions[bot]

If that single request fails for a transient reason — e.g. the charger or the network is not yet reachable right after a host reboot — the driver permanently falls back to API v1 and never re-evaluates it.

That's the same with every other device.

andig avatar Nov 17 '26 10:11 andig