Skip to content

fix: tolerate transient poll failures before marking vehicle offline - #475

Merged
nanomad merged 2 commits into
developfrom
fix/tolerate-transient-poll-failures
Oct 17, 2026
Merged

nanomad merged 2 commits into
developfrom
fix/tolerate-transient-poll-failures

Conversation

@nanomad

@nanomad nanomad commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

The vehicle available topic went offline on the first failed poll, so every HA entity flipped to unavailable for each "try again later" reply from the SAIC server. The next poll usually succeeds.

The vehicle is now marked offline only after 3 consecutive failed polls. A successful poll resets the count. Vehicles removed from the API list still go offline immediately. Polling backoff and the last-error timestamp are unchanged.

Why 3: I measured failure runs in about 220k logged status API attempts (Mar 2024 – Oct 2026, one vehicle, grouped into 91,918 polls, 3.2% failed). 82% of failure runs are a single failed poll.

Threshold Offline flaps Median delay before offline
1 (before) 995 0
2 175 1 min
3 109 2.5 min
5 85 9.6 min

3 removes 89% of the flaps. Going higher adds little and delays real outages. Caveats: one vehicle, and polls were grouped by a 20 s gap rather than from the gateway's own failure marks.

Closes #313

@nanomad
nanomad merged commit a9374c0 into develop Oct 17, 2026
6 checks passed
@nanomad
nanomad deleted the fix/tolerate-transient-poll-failures branch October 17, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant