fix(app): show EV charging instead of folding it into the house - #965
Conversation
A charger that is still drawing but cannot take a command was treated as offline for live power. The LAN page still showed the car; the phone app showed 0 W EV and house+car as house, and the battery discharged into the car with cover-EV off. Count watchdog-live EV/V2X telemetry for the app snapshot, load split, and BatteryCoversEV. StatusOffline still drops a stale last-known reading.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 135bcec1e0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| h, ok := s.health[r.Driver] | ||
| if !ok || !h.IsOnline() { | ||
| if !ok || !h.TelemetryLive() { |
There was a problem hiding this comment.
Exclude uncommandable EV draw from the surplus budget
When a DeviceFault charger is still drawing, this now includes its power in every SumOnlineEVW caller, including main.go's SetSiteSurplusForEV calculation -gridW + batW + evW. That formula adds EV draw back because it assumes the controller can reduce or redistribute that draw, but SetDriverOnline separately prevents dispatch to the faulted charger. With a faulted/unmanaged charger drawing alongside a healthy surplus-only loadpoint, the faulted draw is therefore reported as reclaimable PV surplus and the healthy charger can be commanded to import that amount from the grid, breaking the surplus-only guarantee. Keep the telemetry-inclusive sum for display and battery protection, but use a control-online EV sum for this reclaimable-surplus calculation.
Useful? React with 👍 / 👎.
Summary
A charger that is still drawing but cannot take a command was treated as offline for live power. The LAN page still showed the car; the phone app showed 0 W EV and house+car as house, and the battery could discharge into the car with cover-EV off.
The phone UI overlay already shipped in srcfl/ftw-webapp#51 / #52. This is the box-side source of truth.
Test plan
go testoncmd/ftw,internal/telemetry,internal/controlmake verify(pre-commit)