Skip to content

Collector: a Volvo without the Energy API fails on energy-state at every poll #433

Closed

Description

@vcanuel

Problem

energy-state (Energy API) is not among the collector's optional endpoints (optional() in internal/collector/collector.go): only brakes, engine and fuel are. A Volvo without the Energy API (a combustion or mild-hybrid car) answers it with a plain 404, which fetchFailed records as the vehicle's latest failure (not_found) at every poll of the endpoint.

Consequences:

  • a call spent at each poll, counted against the Energy API's quota, for an answer that never changes;
  • the vehicle's last_failure is always newer than its read_at, so anything reading the status as "the latest call failed" sees a car that reads fine as failing. The web UI does not (collectionState ignores not_found), but the API's collection.last_failure does tell it.

Proposal

Treat energy-state's plain 404 as a missing endpoint, like the optional ones: left out for a details interval, logged once, not recorded as a failure. The market refusal stays apart: its 404 carries does not belong to allowed markets (marketMessage) and keeps KindMarket.

  • energy-state's 404 (not the market's) goes through the missing-endpoint path
  • a test: a vehicle whose energy-state answers 404 has no failure and is not polled for it at each pass

Activity

  1. added theissue type on Nov 19, 2026
  2. vcanuel commented on Nov 19, 2026

    @vcanuel
    ContributorAuthor

    runsten ff01253: energy-state's plain 404 is left out as a missing endpoint (details interval, logged once, no failure); the market's 404 keeps marking the market; the charging state is cleared while the endpoint is missing. Tests in TestFailures. In review: #434.

  3. vcanuel commented on Nov 19, 2026

    @vcanuel
    ContributorAuthor

    Done in runsten eb97676: merge of #434. A Volvo without the Energy API no longer fails on energy-state at every poll; its plain 404 is left out as a missing endpoint, the market's 404 still marks the market.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    brand:volvo

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions