Skip to content

feat(12v): the 12V battery's resting voltage over time, on the dashboard and in statistics - #846

Merged
joszz merged 2 commits into
mainfrom
feat/12v-history
Dec 1, 2026
Merged

joszz merged 2 commits into
mainfrom
feat/12v-history

Conversation

@joszz

@joszz joszz commented Dec 1, 2026

Copy link
Copy Markdown
Owner

A chart of where the 12V battery rests, which is its health, on the dashboard (from the 12V card) and in Statistics.

Why the lowest parked reading, not every reading

Checked on a production database (read-only), last 60 days:

State Readings Median Range
Engine running 10,384 14.0 V 11.8 to 14.2 V
Engine off 3,094 12.3 V 11.7 to 14.0 V

While driving, the DC-DC converter holds the 12V battery near 14 V whatever state it is in. The daily figure was the average of all readings, so it swung between 12.0 and 13.9 V with how much the car drove, and the 12V trend tile compared two of those days. Parked, the lowest reading of each day (11.7 to 12.2 V on that car) is what shows a weakening battery or a drain.

Backend

  • DailyStat.BatteryVoltage (daily mean) becomes BatteryVoltageLow: the day's lowest reading with the engine off (EngineRunning == false), the same parked rule the low-12V notification uses. Charging and "HV on" readings only raise the voltage, so a minimum leaves them out by itself.
  • TelemetryHistoryPoint carries EngineRunning as a read-along field: every row with a 12V reading carried it (checked on production), so the row filter and the chart index stay as they are.
  • openapi.json is updated (batteryVoltage is now batteryVoltageLow on the daily stats).
  • Demo: the ZS EV's battery holds steady with a tenth off on cold nights; the HS PHEV's (second demo car) sinks for three weeks, down past the warning level, the current status included. Values are to a tenth of a volt, as the gateway reports them.

Frontend

  • Dashboard: the 12V card opens Battery12vHistoryModal: the last month's daily lows against the warning level as a dashed line, then the month's lowest day, the days below the warning level, and "Holding steady", "Dropping" or "Rising" (steady within a tenth of a volt), with a short guide to what the voltages mean. The card turns red below the car's own warning level (useAuxBatteryWarning: the car's setting, else the default 12.0 V; no line while the warning is switched off) rather than a hard-coded 12 V.
  • Statistics: the same chart (battery12vChart in useStatisticsCharts) over the page's period. A week or month point shows its lowest day (bucketLowest). It is added to everyone's charts, visible, as new charts are.
  • 12V trend tile: now compares the average daily low of the period's last week with its first week, instead of two single days a cold night could move.
  • Strings in all five languages; README entries and the trend's explanation updated.
  • New screenshot battery-12v (desktop and phone), in the gallery README and on the site.

Testing

  • Backend: dotnet test passes (2375) and dotnet format is clean. New DailyStatsTests: the lowest reading with the engine off counts, while engine running, unknown engine state and a day driven without a parked reading do not.
  • Frontend: pnpm check passes (2391). New specs for bucketLowest, the trend over a week at each end, the lowest day and days below, the 12V chart (lows, dashed warning line, no line while off, axis), the card (colour by the car's level, opening the dialog) and the dialog (what it asks for, the three rows, steady, warning off, no data).
  • Demo with both cars: ZS EV lowest 12.4 V, 0 days below 12.0 V, holding steady (−0.04 V); HS PHEV lowest 11.7 V, 7 days below, dropping (−0.5 V). The Statistics chart and trend tile agree.

🤖 Generated with Claude Code

joszz and others added 2 commits December 1, 2026 19:42
The daily statistics held the mean of every 12V reading of the day. On a
production database that swung from 12.0 to 13.9 V with how much the car
drove: driving, the DC-DC converter holds the 12V battery near 14 V
(median 14.0 V over 10,384 readings), while parked it rests where its
health is (median 12.2 V, as low as 11.7 V). A day now carries
BatteryVoltageLow, its lowest reading with the engine off, the same
parked rule the low-12V notification uses.

The engine state rides along in TelemetryHistoryPoint without joining
the filter or the chart index: every row with a 12V reading carried it.

The demo's 12V history tells two stories: the ZS EV's battery holds
steady with a tenth off on cold nights, the HS PHEV's sinks for three
weeks, down past the warning level, to the current status too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…stics

- The dashboard's 12V card opens a dialog: where the battery rested each
  day of the last month (its lowest parked reading) against the low-12V
  warning level as a dashed line, then the month's lowest day, the days
  below the warning level, and whether it holds steady or drops. The
  card turns red below the car's own warning level rather than 12 V.
- Statistics gets the same chart over its period; a week or a month
  shows its lowest day (bucketLowest), not an average.
- The 12V trend weighs a week of daily lows at each end of the period
  instead of comparing two single days, which a cold night moved.
- New screenshot battery-12v, in the gallery README and on the site.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joszz
joszz merged commit 67ab25a into main Dec 1, 2026
28 checks passed
@joszz
joszz deleted the feat/12v-history branch December 1, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant