Description
During hardware failures (e.g., Power Loss), EVSEs often report multiple error codes simultaneously (e.g., power_loss + connectors_unexpected_open). Currently, the system may only capture the first event, leading to incomplete telemetry.
Proposed Solution: "Fault Window"
Implement a short buffering period (e.g., 20 seconds) once an initial error is detected.
Collect: Aggregate all error codes received within this window.
Finalize: Get telemetry and save failed session after the window closes.
Technical Changes
- Database: Migrate session.error_code from a single value to a one-to-many relationship (new session_errors table) or a JSONB array.
- API: Update endpoints to accept an array of error objects.
- Logic: Introduce a timer-based aggregator to buffer incoming fault signals.
Description
During hardware failures (e.g., Power Loss), EVSEs often report multiple error codes simultaneously (e.g., power_loss + connectors_unexpected_open). Currently, the system may only capture the first event, leading to incomplete telemetry.
Proposed Solution: "Fault Window"
Implement a short buffering period (e.g., 20 seconds) once an initial error is detected.
Collect: Aggregate all error codes received within this window.
Finalize: Get telemetry and save failed session after the window closes.
Technical Changes