Releases: townsmcp/mg-saic-ha
Release list
1.2.5-beta4
🔧 Fix: Last Trip sensors staying Unavailable
The Last Trip Distance and Last Trip Efficiency sensors could stay Unavailable even after completing a drive — a trip was never recorded. Trip detection now works reliably: it's driven directly by the car's power mode on each update, so a trip is opened when you start driving and closed when you park (independent of the vehicle-start message timing). This also makes it robust to Home Assistant restarts mid-drive and to installing the feature mid-drive.
Efficiency Since Last Charge was unaffected and continues to work.
1.2.5-beta3
🔧 Efficiency sensor attribute tidy-up
Polish to the trip/efficiency sensors added in this beta line:
- Correct unit casing in the attributes — they now read kWh (e.g. "Energy kWh", "Efficiency km per kWh") instead of "kwh".
- Mile equivalents added —
distance_miandconsumption_kWh_per_100minow sit alongside the km attributes, so imperial users get the full breakdown without converting.
Applies to Last Trip Efficiency and Efficiency Since Last Charge.
⚠️ If you built a template or automation against the beta attribute keys (e.g.energy_kwh), update it to the new casing (energy_kWh,efficiency_km_per_kWh,consumption_kWh_per_100km,fuel_consumption_L_per_100km).
1.2.5-beta2
📊 Trip & efficiency statistics (#301)
New sensors that track how far you drive and how efficiently, built from data the integration already collects — no setup required.
- Efficiency Since Last Charge (BEV/PHEV) — km/kWh since your last charge, straight from the car's own distance/energy figures.
- Last Trip Distance — how far the last drive went.
- Last Trip Efficiency (BEV/PHEV) and Last Trip Fuel Economy (ICE/HEV/PHEV) — each with the full breakdown of the last drive in its attributes (distance, energy/fuel used, SOC used, duration).
A trip is measured from when the car powers on to when it powers off, so the numbers reflect a real drive. Because the end is captured at shutdown, charging or refuelling while parked doesn't skew the figures — and if it happens mid-trip, that trip's figure is flagged and skipped rather than shown wrong. A mg_saic_trip_completed event also fires for each drive, so automations and the logbook can keep a full history.
Choose your units: the efficiency sensors can be switched per entity between km/kWh, mi/kWh and kWh/100km (the same way Mileage switches between km and miles). Fuel economy is shown in L/100km, with UK and US mpg in its attributes.
Fuel economy works out of the box for the MG3 Hybrid+, MG S9 PHEV and MG HS PHEV (tank sizes are built in; HS PHEV defaults to the UK/EU 37 L — Australian "Super Hybrid" owners, please note yours is 55 L and let us know). Other combustion models show fuel % used until a tank size is added.
⚠️ This release raises the minimum Home Assistant version to 2025.2 (required for the switchable efficiency units). Older installs won't be offered the update.
Notes: SOC and fuel level are whole-percent, so very short trips are coarse; trip duration is approximate.
Implements: #301
1.2.5-beta1
🛠️ Clearer setup error when your account has no vehicles
If your login is correct but your MG account doesn't have a vehicle linked yet, setup previously failed with a misleading "Failed to authenticate, please check your credentials." — sending people to re-check credentials that were fine.
Setup now recognises this case and shows a clear message instead:
Login succeeded, but no vehicles are linked to this account. Add your vehicle in the MG iSMART app first, then try again.
This applies across all login methods (email, phone, custom region, MG India) and re-authentication. Genuine credential errors are unchanged. Message added in English, Spanish, French, and Portuguese.
Fixes: #294 · Full changelog: main...beta
1.2.4
What changed
- Added GPS tracking and vehicle speed for India-region vehicles.
- Ignored
NO_SIGNAL,TIME_FIX, and other unusable GPS fixes instead of publishing invalid locations. - Kept missing speed and heading unknown while preserving genuine zero values.
- Updated the India client to
mg-ismart-india-client 0.1.4. - Corrected the displayed battery capacity for confirmed 100 kWh IM6 Platinum/Performance vehicles.
IM6 Premium owners: if a 75 kWh vehicle incorrectly shows 100 kWh, please open an issue with a redacted debug log so the trims can be distinguished.
1.2.4-beta2
This beta adds India GPS tracking and vehicle speed using mg-ismart-india-client 0.1.4.
It ignores coordinates without a valid GPS fix, keeps missing speed and heading unknown, and preserves a genuine zero speed. It also includes the IM6 100 kWh battery-capacity correction from beta1.
Please report any India tracker showing 0,0, or an IM6 Premium incorrectly showing 100 kWh.
1.2.4-beta1
🚗 IM6 (IM by MG Motor) — battery capacity fix
This beta adds a vehicle profile for the IM6 (series S12L) that corrects the reported battery size.
What was wrong
On the IM6 Platinum, the Total Battery Capacity sensor showed 72.5 kWh instead of the real 100 kWh. The SAIC API returns totalBatteryCapacity=725, which decodes to 72.5 kWh — but that value is a known-bogus placeholder (the same 725 appears on the Cyberster and the HS PHEV, and has been reported on an MG4). It isn't the car's actual capacity.
What changed
- Added an
S12Lprofile that overrides the battery capacity to 100 kWh for the IM6. - The profile mirrors the default in every other respect, so nothing else about the car's behaviour changes — and Total Battery Capacity is a display-only sensor, so no controls are affected.
⚠️ IM6 Premium owners — please read
The IM6 ships with two battery sizes: 75 kWh (Premium) and 100 kWh (Platinum & Performance). This fix is confirmed on the 100 kWh cars. It's not yet known whether the 75 kWh Premium reports the same S12L series — if you own a Premium and your battery now shows 100 kWh, please open an issue with a debug log so the trims can be told apart.
Also in this release
- Added regression tests for the battery-capacity overrides.
- Documentation updates (profiled-models table).
Fixes: #53
Full changelog: 1.2.3...beta
1.2.3
v1.2.3
This stable release rolls up the entire 1.2.2 beta series (beta1–beta6) on top of 1.2.1.
⭐ Highlights
- New maintained API client — the global/EU backend now runs on our own
mg-saic-client, replacing the unmaintained upstream. - MG India — tyre pressures corrected, and BEVs now report mileage.
- More reliable sensors — smarter temperature glitch filtering and a fix for mileage freezing.
- MG S5 EV — proper climate handling and battery capacity.
- Holiday mode — update interval fixed.
Under the hood: our own maintained client
The global/EU backend has moved to mg-saic-client 0.9.4, our maintained fork of the upstream saic-ismart-client-ng (unmaintained for ~5 months), giving the project direct control over fixes. It's a drop-in replacement — same functionality, only the packaging changed. This also properly resolves the session-cleanup leak behind occasional "Unclosed client session" warnings on reload/restart (#233), via a public close method instead of an internal workaround.
🇮🇳 MG India
- Tyre pressures corrected (#288, thanks @Dr-Blank): Front Right was permanently
Unknown(a schema field-name mismatch), and the other three read ~3× too high (India's raw unit scaled with the global conversion). All four now report real values. - Wheel Tyre Monitor Status (TPMS) is now populated for India, and goes unavailable when the car reports nothing rather than implying "no fault".
- BEV mileage now works — the Mileage sensor was permanently unavailable on India BEVs because it required charging data those cars don't send; it now reads the odometer from status (e.g. MG Windsor EV / EQ100).
- India backend updated to
mg-ismart-india-client0.1.3: passwords capped to the app's 16-character limit, and definitive login rejections are surfaced without burning retry attempts.
🚗 Vehicle support
- MG S5 EV (MGS5): climate now correctly reports Cool when the AC is cooling (previously mislabelled "Fan only" via a generic fallback), and Total Battery Capacity now shows the confirmed 64 kWh instead of "unknown".
🔧 Fixes
- Temperature sensors: smarter glitch filtering. Transient, physically-impossible spikes (including very rapid ones, e.g. two readings 15 ms apart) are now skipped and the last good reading kept, judged by how fast the value changed rather than just how large the jump was — so the sensor no longer latches onto a bad value. Genuine changes still come through, delayed at most one poll.
- Mileage no longer sticks at 6,553.5 km. The basic-status odometer field is 16-bit and saturates past that point; it now falls back to the car's wider odometer field, so mileage reads correctly on any car over 6,553.5 km.
- A/C switch and Climate Mode select now show "unavailable" when the car is unreachable (matching the climate entity) instead of a misleading "off" or a stale value.
- Holiday mode interval is now honoured in hours instead of minutes (#290, thanks @joaommarques) — a custom interval was previously polling ~60× more often than intended.
🧹 Maintenance
- Added regression tests covering the public API session-close lifecycle and the holiday-interval unit, so both stay fixed.
Dependencies
saic-ismart-client-ng==0.9.3→mg-saic-client==0.9.4mg-ismart-india-client0.1.1 → 0.1.3
Upgrading
No configuration changes are required — existing entities, automations, and settings are unaffected. Please restart Home Assistant after updating so the new dependencies are installed.
Thanks to @Dr-Blank and @joaommarques for fixes in this release, and to @john-lazarus for the India backend and ongoing co-maintenance.
1.2.2-beta6
Holiday mode: interval now honoured in hours
Fixes the holiday-mode update interval being applied in minutes instead of hours (#290 — thanks @joaommarques). A custom holiday interval was polling roughly 60× more often than intended, undermining the whole point of holiday mode. It now behaves as configured.
Maintenance
- Added regression tests covering the public API session close and the holiday interval unit, so both stay fixed.
1.2.2-beta5
MG India: corrected tyre pressure readings
Fixes tyre pressure reporting on MG India vehicles (#288 — thanks @Dr-Blank):
- Front Right tyre pressure was permanently
Unknownbecause that wheel wasn't being decoded (a field-name mismatch in the protocol schema). It now reports correctly. - The other three wheels read roughly 3× too high — e.g. ~98 psi shown for a tyre actually at ~34 psi — because India's raw pressure unit was being scaled with the global/EU conversion. They now report real values.
- Wheel Tyre Monitor Status (TPMS) is now populated for India instead of sitting
Unknown, and correctly goes unavailable when the car reports nothing rather than implying "no fault".
Your chosen pressure unit in Home Assistant is unaffected — the sensor stays region-agnostic. Requires mg-ismart-india-client 0.1.3 (pinned in this release).