Notifications: group errors from the same device (one device outage creates 40+ entries)
Is your feature request related to a problem? Please describe.
When one device is unreachable for a while, the notification list fills with near-identical entries and pushes out everything else.
How it works today:
- Every WARN/ERROR log line becomes a UI notification (
util/log.go,uiWriter). - The UI merges only messages with exactly the same text and loadpoint (
assets/js/app.ts,raise()), and keeps the last 15.
Why that doesn't group an outage:
- Each failed read has its own text:
charge power,charge currents,charger status,charge total import,heartbeat. - Messages of the form
read tcp 192.168.200.20:60904->192.168.200.172:502: i/o timeoutcontain the client's ephemeral source port, so every attempt is a new text.
Example: a KEBA P30 c-series (keba-modbus) did not answer on port 502 for 34 minutes (evcc 0.318.1):
- 106 WARN/ERROR log lines.
- 43 distinct notification texts. 26 of them are
heartbeatmessages that differ only in the source port. - The UI keeps 15, so this one outage hides every other notification.
- With the source port masked: 14 distinct texts. Grouped per device: 4 devices (95 of the 106 lines are the KEBA).
Describe the solution you'd like
Smallest step first:
- Ignore the client source port when comparing messages (for example, normalize
a.b.c.d:PORT->toa.b.c.d->). In the example this cuts 43 entries to 14. - Group by device: one entry per device with a count and first/last time, for example "Keba P30: 95 errors since 15:11, last: dial tcp 192.168.200.172:502: i/o timeout".
- When the device answers again, mark the entry as recovered.
Describe alternatives you've considered
- Lowering the log level or suppressing single messages hides real problems. A request to suppress one warning in the UI was closed as not planned (#34089). This request keeps every error visible and only changes how they are grouped.
- Related: #32145 asks for device names instead of slot numbers ("consumer 13", "pv 3") in error notifications. Grouped entries would benefit from that too.
Additional context
Excerpt from the notification list during the outage. Each line is a separate entry:
heartbeat: read tcp 192.168.200.20:60904->192.168.200.172:502: i/o timeout
heartbeat: read tcp 192.168.200.20:49160->192.168.200.172:502: i/o timeout
heartbeat: read tcp 192.168.200.20:59134->192.168.200.172:502: i/o timeout
heartbeat: read tcp 192.168.200.20:35334->192.168.200.172:502: i/o timeout
🤖 Generated with Claude Code
Confirmed against the code: raise() in assets/js/app.ts only merges notifications with identical message and lp and keeps the last 15, so the ephemeral source port in read tcp ...:PORT->... errors defeats merging. Step 1 (masking the port when comparing) is a small, low-risk change. Grouping per device (steps 2 and 3) needs a design decision, since log lines carry no structured device identity today (see also #32145), so it needs maintainer input.
Related: #32145 (device names in error notifications), #34089 (suppressing a single warning, closed as not planned).
🤖 Generated with Claude Code
@andig guess this would be addressed by your planned logging restructure. Do you have an issue/backlog item for this?
This is a good request. Lets still please close here and revisit after the logging refactor which will be based on https://github.com/evcc-io/evcc/pull/32018.