Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Preview build
|
…s capacity is set MG's API scales the state of charge by a nominal 72.5 kWh pack, and the gateway only replaces that for the BEV series it has a table entry for. A PHEV with a pack of about 23 kWh showed 68.9 of 72.5 kWh at 95%. Only a BEV now falls back to the gateway's capacity; every other car needs HV_BATTERY_CAPACITY_KWH for kWh figures. Refs #571 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ds no range On some plug-in hybrids the Electric Range card never showed (#570). It needs electricRangeKm, which only came from drivetrain/range, and the gateway publishes that topic only when the car's fuelRangeElec holds 1 or more. A car that leaves it at 0 never sends it. The gateway also publishes drivetrain/hybrid_electrical_range, the BMS's own estimate (bmsEstdElecRng, in km). It was skipped as a repeat of the other topic. It now maps to the same column. The gateway sends it with the charge status, before drivetrain/range in the same poll, so both merge into one row and drivetrain/range still wins on a car that sends both. No migration, so it can go out as a preview build. While editing the layout, a card that is shown but has no data now says "Hidden until your car reports this", so it no longer vanishes on Done without a word. The card description no longer claims a range of zero is never reported, since the BMS estimate does send 0. The handler tests share one in-memory setup for the end-to-end MQTT cases. Refs #570 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Charging session card showed "2507.1 kW · 900 min" on a plug-in hybrid charging at about 4 kW with 15 minutes to go (#570). The gateway publishes obc/powerSinglePhase and obc/powerThreePhase in W and drivetrain/remainingChargingTime in seconds (its Home Assistant discovery says so, unchanged since at least 0.9.0). Everything read them as kW and minutes, the Homepage widget docs included. The Worker now stores kW and minutes, which fixes the cards, the level details and the widget at once. The card also always preferred the three-phase figure. Both are worked out from the same charger voltage and current, so one of them is wrong: on a single-phase charger the three-phase figure reads about 58% of the truth. chargerPowerKw picks the one closest to the HV battery's own charging power, and keeps the three-phase figure without it, as before. Refs #570 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A 2026 MG HS plug-in hybrid fills the "mileage of the day" counter with the distance since delivery, so the Dist. today card showed the odometer. The merged latest snapshot now compares the counter with the odometer's gain over the last two days. A counter beyond it is replaced by the odometer's gain since midnight. Two days, so a counter that still holds yesterday's total just after midnight is left alone. Refs #573 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Spanish locale landed on main (#568) without dashboard.cardWithoutData, which broke the type-check and the pr-574 image build. Also follows the reworded electric range description. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
f8715d0 to
f84d271
Compare
Refs #573
Problem
On the reporter's 2026 MG HS PHEV the Dist. today card showed 288.9 mi with the odometer at 289 mi, on a day the car was not driven. The gateway passes
mileageOfDaythrough as is (it only drops a value above the odometer), so this car fills the "day" counter with the distance since delivery.Fix
GetMergedLatestAsync(behind/status, the widget and the SignalR broadcast) now checks the counter against the odometer:The efficiency cards and the electric share use the same value, so they are corrected too.
Contains #574 (and #572)
This branch carries the commits from #574 (which include #572's), so the preview
pr-<this PR>holds every fix for this reporter: #571, #570 and #573.pr-574stays up, so the reporter can switch between the two. When the reporter confirms, merge this PR on its own and close #574 (#572 is already closed). No database changes.Tests
DayDistanceTests: the helper, plus the merged snapshot for a lifetime counter, a fresh install, a sane counter and yesterday's total just after midnight. Full backend suite green (1563 passed, 19 Postgres-only skipped).🤖 Generated with Claude Code