Repository navigation
feat(12v): the 12V battery's resting voltage over time, on the dashboard and in statistics - #846
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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) becomesBatteryVoltageLow: 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.TelemetryHistoryPointcarriesEngineRunningas 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.jsonis updated (batteryVoltageis nowbatteryVoltageLowon the daily stats).Frontend
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.battery12vChartinuseStatisticsCharts) 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.battery-12v(desktop and phone), in the gallery README and on the site.Testing
dotnet testpasses (2375) anddotnet formatis clean. NewDailyStatsTests: the lowest reading with the engine off counts, while engine running, unknown engine state and a day driven without a parked reading do not.pnpm checkpasses (2391). New specs forbucketLowest, 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).🤖 Generated with Claude Code