From 8539edccba357bebac460b2b94de7d020d09813a Mon Sep 17 00:00:00 2001 From: Fredrik Ahlgren Date: Wed, 21 Oct 2026 17:46:30 +0200 Subject: [PATCH] fix(loadpoint): Charge now keeps charging across a charger reconnect A dropped charger socket, or a hardware identity that is missing for a while, is not an unplug. Charge now keeps its power, and the binding keeps the last proven charger. When the charger proves itself again, the same hardware keeps Charge now; another serial or session ID pauses it and asks for Start, as before. An observed unplug, Stop, a car that stops asking and a config change still end it. The site rig's s13 ("Charge now goes on after the charger returns") passes now, so its known line goes. Decision: srcfl/ftw#1788. Co-Authored-By: Claude Opus 5.5 --- .changeset/charge-now-survives-reconnect.md | 5 + go/cmd/ftw/ev_ocpp_blip_test.go | 168 ++++++++++++++++++ go/cmd/ftw/ev_ocpp_reconnect_test.go | 20 ++- .../loadpoint/controller_hold_restore.go | 43 ++++- .../loadpoint/manual_hold_state_test.go | 132 +++++++++----- go/internal/loadpoint/session_state.go | 5 +- go/test/site/README.md | 2 +- go/test/site/scenarios_test.go | 3 +- 8 files changed, 316 insertions(+), 62 deletions(-) create mode 100644 .changeset/charge-now-survives-reconnect.md create mode 100644 go/cmd/ftw/ev_ocpp_blip_test.go diff --git a/.changeset/charge-now-survives-reconnect.md b/.changeset/charge-now-survives-reconnect.md new file mode 100644 index 000000000..f86f32786 --- /dev/null +++ b/.changeset/charge-now-survives-reconnect.md @@ -0,0 +1,5 @@ +--- +"ftw": patch +--- + +Charge now keeps charging when a charger's connection drops and the same charger comes back without an unplug, for example after a Wi-Fi drop. Before, FTW paused it until someone pressed Start again. Another charger or session on the same loadpoint still pauses it and asks for Start. diff --git a/go/cmd/ftw/ev_ocpp_blip_test.go b/go/cmd/ftw/ev_ocpp_blip_test.go new file mode 100644 index 000000000..9653a614b --- /dev/null +++ b/go/cmd/ftw/ev_ocpp_blip_test.go @@ -0,0 +1,168 @@ +package main + +import ( + "context" + "encoding/json" + "fmt" + "net" + "testing" + "time" + + ocpp16 "github.com/lorenzodonini/ocpp-go/ocpp1.6" + "github.com/lorenzodonini/ocpp-go/ocpp1.6/core" + "github.com/srcfl/ftw/go/internal/events" + "github.com/srcfl/ftw/go/internal/loadpoint" + "github.com/srcfl/ftw/go/internal/ocpp" + "github.com/srcfl/ftw/go/internal/ocpp/chargersocket" + "github.com/srcfl/ftw/go/internal/telemetry" +) + +// A Wi-Fi blip drops the charger's socket while Charge now runs. The same +// charger comes back still plugged in, and no unplug was seen. +func TestChargeNowSurvivesOCPPSocketBlip(t *testing.T) { + for _, tc := range []struct { + name string + serial string + seeUnknown bool // a control tick runs while the socket is down + unplugAfter bool // the charger reports Available after it returns + wantW float64 + }{ + {name: "same charger", serial: "A", seeUnknown: true, wantW: 11040}, + {name: "same charger, blip between ticks", serial: "A", wantW: 11040}, + {name: "other charger", serial: "B", seeUnknown: true, wantW: 0}, + {name: "unplug reported after return", serial: "A", seeUnknown: true, unplugAfter: true, wantW: 0}, + } { + t.Run(tc.name, func(t *testing.T) { + listener, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + t.Fatal(err) + } + port := listener.Addr().(*net.TCPAddr).Port + listener.Close() + tel := telemetry.NewStore() + srv, err := ocpp.Start(context.Background(), &ocpp.Config{Enabled: true, Bind: "127.0.0.1", Port: port, ApprovedIDs: []string{"garage"}}, tel) + if err != nil { + t.Fatal(err) + } + defer srv.Stop() + await := func(fn func() bool) { + t.Helper() + deadline := time.Now().Add(2 * time.Second) + for !fn() { + if time.Now().After(deadline) { + t.Fatal("OCPP state did not settle") + } + time.Sleep(time.Millisecond) + } + } + addr := fmt.Sprintf("127.0.0.1:%d", port) + await(func() bool { + c, e := net.DialTimeout("tcp", addr, 10*time.Millisecond) + if e != nil { + return false + } + c.Close() + return true + }) + connect := func(serial string) ocpp16.ChargePoint { + t.Helper() + cp := chargersocket.ChargePoint16("garage", nil) + if e := cp.Start("ws://" + addr); e != nil { + t.Fatal(e) + } + if _, e := cp.BootNotification("Home", "Easee", func(r *core.BootNotificationRequest) { r.ChargePointSerialNumber = serial }); e != nil { + t.Fatal(e) + } + return cp + } + status := func(cp ocpp16.ChargePoint, s core.ChargePointStatus) { + t.Helper() + if _, e := cp.StatusNotification(1, core.NoError, s); e != nil { + t.Fatal(e) + } + } + cp := connect("A") + status(cp, core.ChargePointStatusCharging) + manager := loadpoint.NewManager() + manager.Load([]loadpoint.Config{{ID: "garage", DriverName: "garage", MinChargeW: 1380, MaxChargeW: 11040, VehicleCapacityWh: 60000}}) + now := time.Now() + manager.SetNowFn(func() time.Time { return now }) + bus := events.NewBus() + manager.SetBus(bus) + plugEdges := 0 + bus.Subscribe(events.KindChargingConnected, func(events.Event) { plugEdges++ }) + var commands []float64 + ctrl := loadpoint.NewController(manager, func(time.Time) (loadpoint.Directive, bool) { return loadpoint.Directive{}, false }, func(name string) (loadpoint.EVSample, bool) { + return currentEVSample(tel.Get(name, telemetry.DerEV), tel.DriverHealth(name), time.Minute, time.Now(), srv.Handler().IsOnline(name), currentOCPPDeviceID(srv.Handler(), name)) + }, func(_ context.Context, _ string, p []byte) error { + var d struct { + Power float64 `json:"power_w"` + Action string `json:"action"` + } + if e := json.Unmarshal(p, &d); e != nil { + return e + } + if d.Action == "ev_set_current" { + commands = append(commands, d.Power) + } + return nil + }) + ctrl.SetSiteFuse(loadpoint.SiteFuse{MaxAmps: 25, Voltage: 230, PhaseCnt: 3}) + tick := func() { ctrl.Tick(context.Background(), now); now = now.Add(3 * time.Second) } + tick() + ctrl.SetManualHold("garage", loadpoint.ManualHold{Persistent: true, PowerW: 11040}) + tick() + if len(commands) == 0 || commands[len(commands)-1] != 11040 { + t.Fatalf("Charge now did not start: %v", commands) + } + sent := len(commands) + + cp.Stop() + await(func() bool { return !srv.Handler().IsOnline("garage") }) + if tc.seeUnknown { + tick() + } + cp = connect(tc.serial) + defer cp.Stop() + status(cp, core.ChargePointStatusCharging) + if tc.unplugAfter { + tick() + status(cp, core.ChargePointStatusAvailable) + } + tick() + tick() + + after := commands[sent:] + hold, held := ctrl.GetManualHold("garage", now) + st, _ := manager.State("garage") + t.Logf("after the blip: commands=%v hold=%+v held=%v unconfirmed=%v plugged=%v", after, hold, held, st.ManualRestoreUnconfirmed, st.PluggedIn) + if !tc.unplugAfter && (!st.PluggedIn || plugEdges != 0) { + t.Fatalf("the blip looked like an unplug: plugged=%v plug edges=%d", st.PluggedIn, plugEdges) + } + if tc.wantW > 0 { + if len(after) == 0 { + t.Fatal("no command after the blip") + } + for _, w := range after { + if w != tc.wantW { + t.Fatalf("the blip changed Charge now: commands after it %v, want only %v", after, tc.wantW) + } + } + if !held || hold.PowerW != tc.wantW || st.ManualRestoreUnconfirmed { + t.Fatalf("Charge now did not survive: hold=%+v held=%v unconfirmed=%v", hold, held, st.ManualRestoreUnconfirmed) + } + return + } + if tc.unplugAfter { + // An unplug ends Charge now; an empty charger gets no command. + if held || st.PluggedIn { + t.Fatalf("unplug did not end Charge now: hold=%+v held=%v plugged=%v", hold, held, st.PluggedIn) + } + return + } + if !held || hold.PowerW != 0 || !st.ManualRestoreUnconfirmed || len(after) == 0 || after[len(after)-1] != 0 { + t.Fatalf("old Charge now followed %s: commands=%v hold=%+v unconfirmed=%v", tc.name, after, hold, st.ManualRestoreUnconfirmed) + } + }) + } +} diff --git a/go/cmd/ftw/ev_ocpp_reconnect_test.go b/go/cmd/ftw/ev_ocpp_reconnect_test.go index 37c227040..bb0d7a91d 100644 --- a/go/cmd/ftw/ev_ocpp_reconnect_test.go +++ b/go/cmd/ftw/ev_ocpp_reconnect_test.go @@ -20,7 +20,9 @@ import ( "github.com/srcfl/ftw/go/internal/telemetry" ) -func TestOCPPReconnectDoesNotUnplugOrResumeOldStart(t *testing.T) { +// A reconnect is not an unplug. The same charger keeps its Start; another +// serial on the same charge point name pauses it and asks for Start. +func TestOCPPReconnectIsNotAnUnplug(t *testing.T) { for _, power := range []float64{0, 4140} { for _, skipUnknown := range []bool{false, true} { t.Run(fmt.Sprintf("power=%v/fast=%v", power, skipUnknown), func(t *testing.T) { @@ -131,8 +133,8 @@ func TestOCPPReconnectDoesNotUnplugOrResumeOldStart(t *testing.T) { tick() st, _ := manager.State("garage") hold, ok := ctrl.GetManualHold("garage", now) - if !ok || hold.PowerW != 0 || !st.PluggedIn || st.ManualRestoreUnconfirmed != (power > 0) { - t.Fatalf("unknown socket lost safety: hold=%+v state=%+v", hold, st) + if !ok || hold.PowerW != power || !st.PluggedIn || st.ManualRestoreUnconfirmed { + t.Fatalf("the outage changed the hold: hold=%+v state=%+v", hold, st) } if sendCount != commandCount { t.Fatal("unknown cable dispatched a command") @@ -171,12 +173,16 @@ func TestOCPPReconnectDoesNotUnplugOrResumeOldStart(t *testing.T) { } status(cp, true) tick() + want, unconfirmed := power, false + if serial != "A" { + want, unconfirmed = 0, power > 0 + } hold, ok := ctrl.GetManualHold("garage", now) - if !ok || hold.PowerW != 0 || commands[len(commands)-1] != 0 { - t.Fatalf("status revived an old Start: %+v %v", hold, commands) + if !ok || hold.PowerW != want || commands[len(commands)-1] != want { + t.Fatalf("serial %s after reconnect: hold=%+v commands=%v, want %v W", serial, hold, commands, want) } - if st, _ := manager.State("garage"); st.ManualRestoreUnconfirmed != (power > 0) { - t.Fatal("status changed required confirmation") + if st, _ := manager.State("garage"); st.ManualRestoreUnconfirmed != unconfirmed { + t.Fatalf("serial %s after reconnect: unconfirmed=%v, want %v", serial, st.ManualRestoreUnconfirmed, unconfirmed) } if connectedEvents != 0 { t.Fatalf("socket reconnect invented %d plug notifications", connectedEvents) diff --git a/go/internal/loadpoint/controller_hold_restore.go b/go/internal/loadpoint/controller_hold_restore.go index 45299c329..80bff11be 100644 --- a/go/internal/loadpoint/controller_hold_restore.go +++ b/go/internal/loadpoint/controller_hold_restore.go @@ -5,13 +5,21 @@ type manualSessionBinding struct { generation uint64 configuration uint64 connectionGeneration uint64 + // proofLost keeps the last proven hardware while the charger cannot + // prove it, so the next proof is compared with it, not with nothing. + proofLost bool +} + +func otherSession(previous, current manualSessionBinding) bool { + return previous.sessionID != "" && current.sessionID != "" && previous.sessionID != current.sessionID } func (m *Manager) manualSessionBinding(id string) manualSessionBinding { m.mu.RLock() defer m.mu.RUnlock() if lp := m.byID[id]; lp != nil { - return manualSessionBinding{lp.sessionDeviceID, lp.sessionID, lp.sessionGeneration, lp.configGeneration, lp.connectionGeneration} + return manualSessionBinding{deviceID: lp.sessionDeviceID, sessionID: lp.sessionID, generation: lp.sessionGeneration, + configuration: lp.configGeneration, connectionGeneration: lp.connectionGeneration} } return manualSessionBinding{} } @@ -50,14 +58,33 @@ func (c *Controller) restoreManualHoldForSession(id string) { c.manualBindings = map[string]manualSessionBinding{} } previous, bound := c.manualBindings[id] - changed := bound && (previous.configuration != current.configuration || - (previous.connectionGeneration != 0 && current.connectionGeneration != 0 && previous.connectionGeneration != current.connectionGeneration)) + changed := bound && previous.configuration != current.configuration + // A dropped socket or a lost hardware proof is not an unplug. Keep the + // last proof until the charger proves itself again: the same charger + // keeps Charge now, other hardware or another session does not. + reconnected := bound && (previous.proofLost || (previous.connectionGeneration != 0 && + current.connectionGeneration != 0 && previous.connectionGeneration != current.connectionGeneration)) if bound && previous.deviceID != "" { - changed = changed || previous.deviceID != current.deviceID - // ObserveSession preserves the generation for a valid first proof. - // A changed generation therefore means a new connection or a counter - // reset, even when the earlier session ID was still unknown. - changed = changed || previous.generation != current.generation + switch { + case current.deviceID == "": + if !changed { + current = previous + current.proofLost = true + } + case reconnected: + changed = changed || previous.deviceID != current.deviceID || otherSession(previous, current) + if !changed && current.sessionID == "" { + // A driver can report the session after the hardware. Check + // the next session against the last proven one. + current.sessionID = previous.sessionID + } + default: + changed = changed || previous.deviceID != current.deviceID || otherSession(previous, current) + // ObserveSession preserves the generation for a valid first proof. + // A changed generation therefore means a counter reset or a new + // session, even when the earlier session ID was still unknown. + changed = changed || previous.generation != current.generation + } } // A Start before the first hardware reading binds here. Once bound, a // different hardware/session/config generation must not inherit its power. diff --git a/go/internal/loadpoint/manual_hold_state_test.go b/go/internal/loadpoint/manual_hold_state_test.go index f042bc0f8..eee3ba9b0 100644 --- a/go/internal/loadpoint/manual_hold_state_test.go +++ b/go/internal/loadpoint/manual_hold_state_test.go @@ -6,7 +6,9 @@ import ( "time" ) -func TestLostHardwareProofPausesOldStartButAllowsANewExplicitStart(t *testing.T) { +// A lost hardware proof is not an unplug. Start keeps its power until the +// charger proves itself again; another session or other hardware pauses it. +func TestLostHardwareProofKeepsStartUntilAnotherSessionProvesItself(t *testing.T) { cfg := holdLoadpoint() sender := &fakeSender{} sample := EVSample{Connected: true, RequestActive: true, DeviceID: "easee:A", SessionID: "session-1"} @@ -14,37 +16,86 @@ func TestLostHardwareProofPausesOldStartButAllowsANewExplicitStart(t *testing.T) c := newTestController(t, []Config{cfg}, nil, samples, sender) c.SetSiteFuse(SiteFuse{MaxAmps: 16, Voltage: 230, PhaseCnt: 3}) now := time.Now() - tick := func(want float64) { + tick := func(device, session string, want float64, unconfirmed bool) { t.Helper() + sample.DeviceID, sample.SessionID = device, session + samples[cfg.DriverName] = sample c.Tick(context.Background(), now) now = now.Add(time.Second) if last, ok := lastSetCurrent(sender.calls); !ok || last.power != want { - t.Fatalf("commands=%+v, want latest power %v", sender.calls, want) + t.Fatalf("%q/%q: commands=%+v, want latest power %v", device, session, sender.calls, want) + } + if state, _ := c.manager.State(cfg.ID); state.ManualRestoreUnconfirmed != unconfirmed { + t.Fatalf("%q/%q: unconfirmed=%v, want %v", device, session, state.ManualRestoreUnconfirmed, unconfirmed) } } - tick(0) + tick("easee:A", "session-1", 0, false) c.SetManualHold(cfg.ID, ManualHold{PowerW: 4140, Persistent: true}) - tick(4140) - sample.DeviceID, sample.SessionID = "", "" - samples[cfg.DriverName] = sample - tick(0) - if state, _ := c.manager.State(cfg.ID); !state.ManualRestoreUnconfirmed { - t.Fatal("lost proof did not explain the pause") - } - tick(0) - if state, _ := c.manager.State(cfg.ID); !state.ManualRestoreUnconfirmed { - t.Fatal("a later unknown sample cleared the confirmation requirement") - } - // This request belongs to the currently unknown socket, not the older - // device. It works now and may acquire its first fresh hardware identity. + tick("easee:A", "session-1", 4140, false) + tick("", "", 4140, false) + tick("", "", 4140, false) + tick("easee:A", "session-1", 4140, false) + tick("", "", 4140, false) + tick("easee:A", "session-2", 0, true) + // A new Start belongs to the session now on the charger. c.SetManualHold(cfg.ID, ManualHold{PowerW: 4140, Persistent: true}) - tick(4140) - sample.DeviceID, sample.SessionID = "easee:B", "session-2" - samples[cfg.DriverName] = sample - tick(4140) - if state, _ := c.manager.State(cfg.ID); state.ManualRestoreUnconfirmed { - t.Fatal("new explicit Start still asks for confirmation") + tick("easee:A", "session-2", 4140, false) + tick("", "", 4140, false) + tick("easee:B", "session-3", 0, true) +} + +// A driver that reports its session late can come back with the hardware +// but no session yet. The next session it reports must not inherit Start. +func TestLostProofCannotHandStartToALateNewSession(t *testing.T) { + cfg := holdLoadpoint() + sender := &fakeSender{} + sample := EVSample{Connected: true, RequestActive: true, DeviceID: "easee:A", SessionID: "session-1"} + samples := map[string]EVSample{cfg.DriverName: sample} + c := newTestController(t, []Config{cfg}, nil, samples, sender) + c.SetSiteFuse(SiteFuse{MaxAmps: 16, Voltage: 230, PhaseCnt: 3}) + now := time.Now() + tick := func(device, session string, want float64, unconfirmed bool) { + t.Helper() + sample.DeviceID, sample.SessionID = device, session + samples[cfg.DriverName] = sample + c.Tick(context.Background(), now) + now = now.Add(time.Second) + if last, ok := lastSetCurrent(sender.calls); !ok || last.power != want { + t.Fatalf("%q/%q: commands=%+v, want latest power %v", device, session, sender.calls, want) + } + if state, _ := c.manager.State(cfg.ID); state.ManualRestoreUnconfirmed != unconfirmed { + t.Fatalf("%q/%q: unconfirmed=%v, want %v", device, session, state.ManualRestoreUnconfirmed, unconfirmed) + } } + tick("easee:A", "session-1", 0, false) + c.SetManualHold(cfg.ID, ManualHold{PowerW: 4140, Persistent: true}) + tick("easee:A", "session-1", 4140, false) + tick("", "", 4140, false) + tick("easee:A", "", 4140, false) + tick("easee:A", "session-1", 4140, false) + tick("", "", 4140, false) + tick("easee:A", "", 4140, false) + tick("easee:A", "session-2", 0, true) +} + +// A kept Charge now leaves the saved record as it was, so a restart after a +// socket drop restores it too. +func TestChargeNowKeptAcrossReconnectSurvivesARestart(t *testing.T) { + store := &sessionMemory{data: map[string]string{}} + charging := EVSample{Connected: true, RequestActive: true, ConnectionGeneration: 1, DeviceID: "ocpp:A"} + samples := map[string]EVSample{"easee": charging} + c, sender := bootController(t, store, samples) + now := time.Now() + c.SetManualHold("garage", ManualHold{PowerW: 4140, Persistent: true}) + tickWants(t, c, sender, now, 4140, false) + samples["easee"] = EVSample{ConnectionUnknown: true, ConnectionGeneration: 1} + tickWants(t, c, sender, now.Add(time.Second), 4140, false) + charging.ConnectionGeneration = 2 + samples["easee"] = charging + tickWants(t, c, sender, now.Add(2*time.Second), 4140, false) + + c, sender = bootController(t, store, samples) + tickWants(t, c, sender, now.Add(30*time.Second), 4140, false) } func TestLostHardwareProofKeepsExplicitPauseConfirmed(t *testing.T) { @@ -350,7 +401,9 @@ func TestConcurrentSetAndClearPersistInControllerOrder(t *testing.T) { } } -func TestManualStartWithoutHardwareCannotFollowAnotherSocket(t *testing.T) { +// A Start before the first hardware proof binds to the first proof, across a +// reconnect too. Other hardware after a later reconnect pauses it. +func TestManualStartBeforeHardwareProofSurvivesAReconnect(t *testing.T) { cfg := holdLoadpoint() sender := &fakeSender{} sample := EVSample{Connected: true, RequestActive: true, ConnectionGeneration: 1} @@ -358,29 +411,24 @@ func TestManualStartWithoutHardwareCannotFollowAnotherSocket(t *testing.T) { c := newTestController(t, []Config{cfg}, nil, samples, sender) c.SetSiteFuse(SiteFuse{MaxAmps: 16, Voltage: 230, PhaseCnt: 3}) now := time.Now() - tick := func(want float64) { + tick := func(generation uint64, device string, want float64, unconfirmed bool) { t.Helper() + sample.ConnectionGeneration, sample.DeviceID = generation, device + samples[cfg.DriverName] = sample c.Tick(context.Background(), now) now = now.Add(time.Second) if last, ok := lastSetCurrent(sender.calls); !ok || last.power != want { - t.Fatalf("commands=%+v, want %v", sender.calls, want) + t.Fatalf("socket %d %q: commands=%+v, want %v", generation, device, sender.calls, want) + } + if st, _ := c.manager.State(cfg.ID); st.ManualRestoreUnconfirmed != unconfirmed { + t.Fatalf("socket %d %q: unconfirmed=%v, want %v", generation, device, st.ManualRestoreUnconfirmed, unconfirmed) } } - tick(0) - c.SetManualHold(cfg.ID, ManualHold{PowerW: 4140, Persistent: true}) - tick(4140) - sample.ConnectionGeneration = 2 - samples[cfg.DriverName] = sample - tick(0) - if st, _ := c.manager.State(cfg.ID); !st.ManualRestoreUnconfirmed { - t.Fatal("new socket inherited unknown hardware Start") - } + tick(1, "", 0, false) c.SetManualHold(cfg.ID, ManualHold{PowerW: 4140, Persistent: true}) - tick(4140) - sample.DeviceID = "easee:A" - samples[cfg.DriverName] = sample - tick(4140) - if st, _ := c.manager.State(cfg.ID); st.ManualRestoreUnconfirmed { - t.Fatal("first proof on same socket invalidated explicit Start") - } + tick(1, "", 4140, false) + tick(2, "", 4140, false) + tick(2, "easee:A", 4140, false) + tick(3, "easee:A", 4140, false) + tick(4, "easee:B", 0, true) } diff --git a/go/internal/loadpoint/session_state.go b/go/internal/loadpoint/session_state.go index ae921a36d..af65f6133 100644 --- a/go/internal/loadpoint/session_state.go +++ b/go/internal/loadpoint/session_state.go @@ -300,8 +300,9 @@ func (m *Manager) persistSession(id string) { } // observeConnectionProof handles a lost socket without inventing a cable -// edge or refreshing the last physical observation. A fresh Boot alone must -// not let an older manual Start follow an unidentified connection. +// edge or refreshing the last physical observation. A fresh Boot alone does +// not prove the same car. Charge now keeps its power and checks the next +// hardware proof (restoreManualHoldForSession). func (m *Manager) observeConnectionProof(id string, generation uint64, unknown bool) { m.sessionMu.Lock() defer m.sessionMu.Unlock() diff --git a/go/test/site/README.md b/go/test/site/README.md index c223df240..1290d9f48 100644 --- a/go/test/site/README.md +++ b/go/test/site/README.md @@ -94,7 +94,7 @@ tick as 2 s more. | `s10-25` Two chargers | `carport` 60 s late; cut 6 A and raise 16 A together | fuse holds; over the limit at most 3 s after the step | | | `s11-25` Pause, then restart | a charger applying 5 s late; Charge now 16 A, 0 W for 25 s, then 6 A | an offer within 60 s of the restart; over the limit at most 3 s; fuse holds | | | `s12-20` One-phase night | 3 × 20 A, house 1.6/1.7/2.3 A, a charger applying 40 s late, the field's step table on `auto`, a plan for 6.6 kWh by the first quarter hour 40 min out | fuse holds; planned charging never orders one phase; no order cut while every phase has room, unless the plan paused; 90 % of the plan by the ready time | | -| `s13-25` Socket reconnect | Charge now 16 A, the charger's connection gone for 10 s | Charge now goes on after the charger returns (**known**: #1788); no unplug seen | | +| `s13-25` Socket reconnect | Charge now 16 A, the charger's connection gone for 10 s | Charge now goes on after the charger returns; no unplug seen | | | `s15-25` One-phase charger, Charge now | 25 A, 3 A per phase, an Easee wired on L1 (6-16 A, steps to 3 680 W, no phase mode); Charge now on the phases `/api/loadpoints` reports, as the app sends it, 180 s | 16 A on L1 within 60 s; held 95 %; fuse holds; no `fuse_limit` | yes | | `s15b-25`, `s15c-25` | as s15, phase mode `1p` and `auto` | as s15 | | | `s15bat-16` One-phase charger, battery rising | 16 A, 3 A per phase, the s15 charger, battery at 50 % following its EMS 8 s late; PV 2.1 kW rising every 30 s (+2.5 kW, then 1.5 kW) so Core charges the battery in steps; Charge now 6 s after the second step, while the raise is on its way | the battery order rose over 1 150 W in the 20 s before (setup check); car charging within 10 s; fuse holds; over the limit at most 3 s | | diff --git a/go/test/site/scenarios_test.go b/go/test/site/scenarios_test.go index 1c1caafc7..1d9d9a17d 100644 --- a/go/test/site/scenarios_test.go +++ b/go/test/site/scenarios_test.go @@ -81,8 +81,7 @@ var scenarios = []scenario{ {name: "s12-20", dir: "s12-one-phase-night-20A", minutes: 57, run: func(c *runCtx) (map[string]any, error) { return s12(c, 20) }, judge: judgeS12}, {name: "s13-25", dir: "s13-socket-reconnect-25A", minutes: 6, - run: func(c *runCtx) (map[string]any, error) { return s13(c, 25) }, judge: judgeS13, - known: map[string]string{"Charge now goes on after the charger returns": "a socket reconnect turns Charge now into a 0 W pause; srcfl/ftw#1788"}}, + run: func(c *runCtx) (map[string]any, error) { return s13(c, 25) }, judge: judgeS13}, {name: "s15-25", dir: "s15-one-phase-charger-chargenow-25A", minutes: 4.6, short: true, run: func(c *runCtx) (map[string]any, error) { return s15(c, 25) }, judge: judgeS15}, {name: "s15b-25", dir: "s15b-one-phase-charger-1p-25A", minutes: 4.6,