Repository navigation
Conversation
Preview build
|
569fe82 to
4dde0f0
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…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>
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>
920c0da to
56cfa16
Compare
Refs #570 (not
Fixesuntil the reporter confirms on the car). Also carries the commit from #572 (Refs #571), see below.Combined preview build
The reporter of #570 also reported #571, on the same plug-in hybrid, so this branch carries #572's commit as well. Its
pr-<number>image holds the fixes for both issues, and the reporter only needs to switch once.#572 is closed in favour of this PR. #575 builds on this one and adds the fix for #573. When the reporter confirms, merging #575 alone brings in all three fixes, and this PR then closes too. Until then
pr-574stays up so the reporter can switch between the two builds.1. Electric Range card never shows (#570)
The card needs
electricRangeKm, which only came fromdrivetrain/range. The gateway publishes that topic only when the car'sfuelRangeElecholds 1 or more (extract_electric_range), so a car that leaves it at 0 never sends it. Nothing hid the card because of the drivetrain: a PHEV passesmayPlugIn.The gateway also publishes
drivetrain/hybrid_electrical_range, the BMS's own estimate (bmsEstdElecRng, in km, 0 included). #393 skipped it as a repeat of the other topic. It now maps to the sameElectricRangeKmcolumn. The gateway sends it with the charge status, beforedrivetrain/rangein the same poll, so both merge into one telemetry row anddrivetrain/rangestill wins on a car that sends both. That avoids a migration in a preview build.Edge case: when the Worker restarts, the broker replays retained messages in its own order. If the BMS estimate comes in after
drivetrain/range, it shows until the next poll.2. Edit mode explains the missing card (#570)
While editing the layout, a card that is shown but has no data now says "Hidden until your car reports this" under its name. Before, it was a plain placeholder that vanished on Done without a word.
3. Charging session units (#570 screenshot)
The card showed "2507.1 kW · 900 min" on a car charging at about 4 kW with 15 minutes to go.
obc/powerSinglePhaseandobc/powerThreePhaseare in W, anddrivetrain/remainingChargingTimeis in seconds. The gateway's Home Assistant discovery says so, and it has been that way since at least gateway 0.9.0. Everything read them as kW and minutes, WIDGET.md included. The Worker now stores kW and minutes, which fixes the cards, the level details and the Homepage widget at once. Rows stored before the fix keep the old units, but these fields only feed the live status, which the next charge poll overwrites.chargerPowerKwpicks the one closest to the HV battery's own charging power (hvPower). Without that it keeps the three-phase figure, as before.Tests
hybrid_electrical_range(incl. 0), new units for power and remaining time. Handler: BMS estimate then range in one poll keeps the range, estimate alone is kept.chargerPowerKwcases (the [Bug]: Adding Electric Range Card to dashboard does not work #570 numbers, three-phase, no battery power, one figure only). The card's summary uses the matching figure. The dashboard edit hint appears only on cards that are shown but have no data.dotnet test: 1554 passed.dotnet format --verify-no-changesis clean.No migrations.
🤖 Generated with Claude Code