You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MG ZS EV: Cable-lock status not reflected, does not change even though successful locking is reported #271
With our MG ZS saic/${user}/vehicles/${vin}/drivetrain/chargingCableLock is always False even when the cable-lock is clearly audible engaged. Toggeling the switch yields the message in the logs, that the cable will be locked/unlocked and Success is reported in saic/${user}/vehicles/${vin}/drivetrain/chargingCableLock/result. Using saic/${user}/vehicles/${vin}/drivetrain/chargingCableLock/set yields the same.
As of now, we were not able to clearly determine if the car reacts to the command and is just not reporting the locking status or if it does not do anything at all. Our ZS is quite slow to react on manual locking/unlocking requests even using the touch interface and likes to lock and unlock on it's own. We'll keep trying to make certain.
So it might be, the ZS does not support reporting the status or it is ignoring the topic completely. Maybe some upstream research in the API is needed to clarify this.
Hi Jon, can you check what the mg app shows when it "scans" the car with
the cable plugged in and locked?
Otherwise I'll need some api dumps (they can be enabled and pushed on mqtt)
with different cable states
Il Mar 22 Ott 2024, 13:35 Jörn Krenzer ***@***.***> ha
scritto:
Hi!
With our MG ZS saic/${user}/vehicles/${vin}/drivetrain/chargingCableLock
is always False even when the cable-lock is clearly audible engaged.
Toggeling the switch yields the message in the logs, that the cable will be
locked/unlocked and Success is reported in
saic/${user}/vehicles/${vin}/drivetrain/chargingCableLock/result. Using
saic/${user}/vehicles/${vin}/drivetrain/chargingCableLock/set yields the
same.
As of now, we were not able to clearly determine if the car reacts to the
command and is just not reporting the locking status or if it does not do
anything at all. Our ZS is quite slow to react on manual locking/unlocking
requests even using the touch interface and likes to lock and unlock on
it's own. We'll keep trying to make certain.
So it might be, the ZS does not support reporting the status or it is
ignoring the topic completely. Maybe some upstream research in the API is
needed to clarify this.
Cheers,
Jörn
—
Reply to this email directly, view it on GitHub
<#271>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIT3RQDNWL2OV5M73KYNMLZ4Y2BPAVCNFSM6AAAAABQMI5FSGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGYYDKMJYGM4DCMA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
Otherwise I'll need some api dumps (they can be enabled and pushed on mqtt) with different cable states
I would prefer using the mqtt-gateway if possible to colleect the dump, as the vehicle and our own app using the mqtt is currently in use. Do you mean MQTT_LOG_LEVEL=DEBUG or something else? A search did not turn up anything akin to "api dump" in the repo.
So, I tried my best to capture all consecutive messages coming when locking is enabled. Hope I caught everything. Some topics have multiple messages, the order of the json objects in this case is descending in time.
Uhm unfortunately @jkrenzer I don't see any value I can use to deduce the lock state... I'll keep this open as a reminder for the future in case we discover something new
Thanks. I am not entirely sure yet, but maybe it is an "optimistic" action (e.g. no state, just triggering) for the ZS, as in the car itself there is also only an unlock button and the lock engages by itself when the cable is plugged into the wallbox/charger. Will try to investigate, when the vehicle is not needed so frequently.
Thanks again for the dumps, they made this clear. The charge management response from the ZS has no ccuEleccLckCtrlDspCmd field. The other models send it, with 1 for locked and 2 for unlocked. Without the field the gateway fell back to "unlocked", so the lock state was always False. The car does not report it, so the gateway cannot read it back.
The topic is no longer published when the car does not report the lock, so Home Assistant shows "unknown" and not a wrong "unlocked".
After a lock or unlock command succeeds, the gateway publishes the commanded state. On your car that is what you will see, not the real state. A manual lock or unlock is not reflected.
An older version already left a retained False on .../drivetrain/chargingCableLock. It stays until your first lock or unlock command. To clear it, publish an empty retained message to that topic.
Activity
nanomad commentedon Oct 22, 2024
jkrenzer commentedon Oct 22, 2024
I would prefer using the mqtt-gateway if possible to colleect the dump, as the vehicle and our own app using the mqtt is currently in use. Do you mean
MQTT_LOG_LEVEL=DEBUGor something else? A search did not turn up anything akin to "api dump" in the repo.nanomad commentedon Dec 5, 2024
You can set
PUBLISH_RAW_API_DATA_ENABLED=True
This will publish API Request/Response to MQTT
jkrenzer commentedon Dec 5, 2024
BTW: Is there an entry in the documentation for this? Very helpful feature, thanks!
For people using the homeassistant addon and finding this issue while searching: You can add
in the yaml config view of the addon.
So, here some of the api-info I could collect.
Request when pressing lock:
{ "path": "/vehicle/charging/control", "query": {}, "body": { "chrgCtrlReq": 0, "tboxEleccLckCtrlReq": 1, "tboxV2XReq": 0, "vin": "REDACTED" }, "headers": { "host": "gateway-mg-eu.soimt.com", "event-id": "1342824349", "content-length": "136", "content-type": "application/json" } }Followed by mutliple errors:
{ "path": "/vehicle/charging/control", "query": {}, "body": { "code": 4, "message": "The remote control instruction failed, please try again later." }, "headers": { "date": "Thu, 05 Dec 2024 19:45:27 GMT", "content-type": "application/json", "content-length": "85", "connection": "keep-alive", "app-content-encrypted": "1", "original-content-type": "application/json", "app-send-date": "1733427927094", "app-verification-string": "REDACTED" } }And then suddenly:
{ "path": "/vehicle/charging/control", "query": {}, "body": { "code": 0, "data": { "chrgCtrlDspCmd": 1, "rvcReqSts": 3, "chrgCtrlResp": 0 }, "message": "success" }, "headers": { "date": "Thu, 05 Dec 2024 19:45:39 GMT", "content-type": "application/json", "content-length": "89", "connection": "keep-alive", "app-content-encrypted": "1", "original-content-type": "application/json", "app-send-date": "1733427939353", "app-verification-string": "REDACTED" } }But the lock status stays false:
nanomad commentedon Dec 5, 2024
Thanks, can you repeat the test this time checking the following topics?
saic/_internal/api/vehicle/charging/mgmtData/response
saic/_internal/api/vehicle/control/response
saic/_internal/api/vehicle/status/response
(Just pick the last value after it settles, the in between errors are supposed to be there since the API requires a few retries by design)
jkrenzer commentedon Dec 5, 2024
Yes, I will have a look next time the vehicle is loading.
jkrenzer commentedon Dec 12, 2024
So, I tried my best to capture all consecutive messages coming when locking is enabled. Hope I caught everything. Some topics have multiple messages, the order of the json objects in this case is descending in time.
saic/_internal/api/vehicle/charging/mgmtData/response:{ "path": "/vehicle/charging/mgmtData", "query": { "vin": [ "REDACTED" ] }, "body": { "code": 0, "data": { "rvsChargeStatus": { "mileageSinceLastCharge": 0, "totalBatteryCapacity": 725, "workingVoltage": 1559, "chargingDuration": 7735, "chargingType": 6, "fuelRangeElec": 2730, "realtimePower": 592, "workingCurrent": 19498, "chargingGunState": 1, "mileageOfDay": 560, "startTime": 1733989813, "endTime": 1733954768, "powerUsageOfDay": 1119, "powerUsageSinceLastCharge": 0, "mileage": 117830 }, "chrgMgmtData": { "clstrElecRngToEPT": 273, "bmsChrgSts": 1, "bmsPackSOCDsp": 817, "bmsPTCHeatReqDspCmd": 2, "bmsPackCrnt": 19498, "bmsChrgCtrlDspCmd": 1, "bmsReserStMintueDspCmd": 0, "bmsOnBdChrgTrgtSOCDspCmd": 6, "bmsEstdElecRng": 304, "bmsReserCtrlDspCmd": 2, "bmsPTCHeatSpRsn": 0, "bmsChrgOtptCrntReq": 155, "bmsReserStHourDspCmd": 22, "bmsPackVol": 1559, "bmsReserSpHourDspCmd": 6, "bmsAdpPubChrgSttnDspCmd": 2, "chrgngRmnngTimeV": 0, "bmsReserSpMintueDspCmd": 0, "bmsAltngChrgCrntDspCmd": 0, "bmsChrgSpRsn": 0, "chrgngRmnngTime": 39 } }, "message": "success" }, "headers": { "date": "Thu, 12 Dec 2024 09:59:09 GMT", "content-type": "application/json", "content-length": "891", "connection": "keep-alive", "app-content-encrypted": "1", "original-content-type": "application/json", "app-send-date": "1733997549510", "app-verification-string": "2638cbf6569227fcd91eb98b9df8c925c1e466da3e91ff828ce5c87536eab93a" } } { "path": "/vehicle/charging/mgmtData", "query": { "vin": [ "REDACTED" ] }, "body": { "code": 0, "message": "success" }, "headers": { "date": "Thu, 12 Dec 2024 09:59:06 GMT", "content-type": "application/json", "content-length": "30", "connection": "keep-alive", "event-id": "955639740", "app-content-encrypted": "1", "original-content-type": "application/json", "app-send-date": "1733997546411", "app-verification-string": "a74890b631c8c5aabd65cc60be4f38f5ff021e012ce089f5d78145673720b45a" } } { "path": "/vehicle/charging/mgmtData", "query": { "vin": [ "REDACTED" ] }, "body": { "code": 0, "data": { "rvsChargeStatus": { "mileageSinceLastCharge": 0, "totalBatteryCapacity": 725, "workingVoltage": 1556, "chargingDuration": 7614, "chargingType": 6, "fuelRangeElec": 2710, "realtimePower": 589, "workingCurrent": 19498, "chargingGunState": 1, "mileageOfDay": 560, "startTime": 1733989813, "endTime": 1733954768, "powerUsageOfDay": 1119, "powerUsageSinceLastCharge": 0, "mileage": 117830 }, "chrgMgmtData": { "clstrElecRngToEPT": 271, "bmsChrgSts": 1, "bmsPackSOCDsp": 812, "bmsPTCHeatReqDspCmd": 2, "bmsPackCrnt": 19498, "bmsChrgCtrlDspCmd": 1, "bmsReserStMintueDspCmd": 0, "bmsOnBdChrgTrgtSOCDspCmd": 6, "bmsEstdElecRng": 304, "bmsReserCtrlDspCmd": 2, "bmsPTCHeatSpRsn": 0, "bmsChrgOtptCrntReq": 156, "bmsReserStHourDspCmd": 22, "bmsPackVol": 1556, "bmsReserSpHourDspCmd": 6, "bmsAdpPubChrgSttnDspCmd": 2, "chrgngRmnngTimeV": 0, "bmsReserSpMintueDspCmd": 0, "bmsAltngChrgCrntDspCmd": 0, "bmsChrgSpRsn": 0, "chrgngRmnngTime": 41 } }, "message": "success" }, "headers": { "date": "Thu, 12 Dec 2024 09:57:08 GMT", "content-type": "application/json", "content-length": "891", "connection": "keep-alive", "app-content-encrypted": "1", "original-content-type": "application/json", "app-send-date": "1733997428846", "app-verification-string": "11e02d9d4396820dc71abb6a255625daca7b17e737cba7925cb7c34d7f9eacfe" } }saic/_internal/api/vehicle/control/response:{ "path": "/vehicle/control", "query": {}, "body": { "code": 0, "data": { "basicVehicleStatus": { "frontRightSeatHeatLevel": 0, "steeringWheelHeatFailureReason": 0, "rearRightDoor": 0, "sideLightStatus": 0, "frontLeftTyrePressure": 67, "driverWindow": 0, "rearRightTyrePressure": 66, "rmtHtdRrWndSt": 0, "canBusActive": 1, "frontRightTyrePressure": 66, "driverDoor": 0, "frontLeftSeatHeatLevel": 0, "lockStatus": 1, "powerMode": 0, "engineStatus": 0, "exteriorTemperature": 0, "fuelRange": 2100, "extendedData2": 0, "currentJourneyId": 1114, "extendedData1": 64, "mileage": 117270, "fuelLevelPrc": 0, "steeringHeatLevel": 0, "interiorTemperature": 10, "batteryVoltage": 132, "passengerDoor": 0, "clstrDspdFuelLvlSgmt": 0, "mainBeamStatus": 0, "remoteClimateStatus": 0, "vehElecRngDsp": 0, "sunroofStatus": 1, "currentJourneyDistance": 120, "timeOfLastCANBUSActivity": 1733961055, "bonnetStatus": 0, "bootStatus": 0, "fuelRangeElec": 2100, "lastKeySeen": 24163, "rearRightWindow": 0, "vehicleAlarmStatus": 2, "wheelTyreMonitorStatus": 0, "rearLeftTyrePressure": 66, "rearLeftDoor": 0, "passengerWindow": 0, "rearLeftWindow": 0, "dippedBeamStatus": 0 }, "gpsPosition": { "timeStamp": 1733961056, "gpsStatus": 2, "wayPoint": { "satellites": 6, "heading": 0, "position": { "altitude": 0, "latitude": 0, "longitude": 0 }, "hdop": 11, "speed": 0 } }, "rvcReqType": "AQ==", "failureType": 0, "rvcReqSts": "Ag==" }, "message": "success" }, "headers": { "date": "Wed, 11 Dec 2024 23:50:59 GMT", "content-type": "application/json", "content-length": "1260", "connection": "keep-alive", "app-content-encrypted": "1", "original-content-type": "application/json", "app-send-date": "1733961059591", "app-verification-string": "42f6bffcfcb56eb9ab02416d149f12989a5cdaa6f554ff34af29e065cb3c4aff" } }saic/_internal/api/vehicle/status/response:{ "path": "/vehicle/status", "query": { "vin": [ "REDACTED" ], "vehStatusReqType": [ "2" ] }, "body": { "code": 0, "data": { "basicVehicleStatus": { "frontRightSeatHeatLevel": 0, "steeringWheelHeatFailureReason": 0, "rearRightDoor": 0, "sideLightStatus": 0, "frontLeftTyrePressure": 68, "driverWindow": 0, "rearRightTyrePressure": 65, "rmtHtdRrWndSt": 0, "canBusActive": 1, "frontRightTyrePressure": 66, "driverDoor": 0, "frontLeftSeatHeatLevel": 0, "lockStatus": 1, "powerMode": 0, "engineStatus": 0, "exteriorTemperature": 0, "fuelRange": 2730, "extendedData2": 1, "currentJourneyId": 1120, "extendedData1": 82, "mileage": 117830, "fuelLevelPrc": 0, "steeringHeatLevel": 0, "interiorTemperature": 10, "batteryVoltage": 148, "passengerDoor": 0, "clstrDspdFuelLvlSgmt": 0, "mainBeamStatus": 0, "remoteClimateStatus": 0, "vehElecRngDsp": 0, "sunroofStatus": 0, "currentJourneyDistance": 0, "bonnetStatus": 0, "handBrake": 0, "bootStatus": 0, "fuelRangeElec": 2730, "lastKeySeen": 24163, "rearRightWindow": 0, "vehicleAlarmStatus": 2, "wheelTyreMonitorStatus": 0, "rearLeftTyrePressure": 66, "rearLeftDoor": 0, "passengerWindow": 0, "rearLeftWindow": 0, "dippedBeamStatus": 0 }, "extendedVehicleStatus": { "alertDataSum": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] }, "gpsPosition": { "timeStamp": 1733997543, "gpsStatus": 2, "wayPoint": { "satellites": 11, "heading": 198, "position": { "altitude": 0, "latitude": 0, "longitude": 0 }, "hdop": 5, "speed": 0 } }, "statusTime": 1733997545 }, "message": "success" }, "headers": { "date": "Thu, 12 Dec 2024 09:59:06 GMT", "content-type": "application/json", "content-length": "1376", "connection": "keep-alive", "event-id": "1865151625", "app-content-encrypted": "1", "original-content-type": "application/json", "app-send-date": "1733997546314", "app-verification-string": "17e7f05466d1fc01688914a6005b359a70f973c71bdb9b5e506cb4f16ad6f92c" } } { "path": "/vehicle/status", "query": { "vin": [ "REDACTED" ], "vehStatusReqType": [ "2" ] }, "body": { "code": 0, "message": "success" }, "headers": { "date": "Thu, 12 Dec 2024 09:59:03 GMT", "content-type": "application/json", "content-length": "30", "connection": "keep-alive", "event-id": "1865151625", "app-content-encrypted": "1", "original-content-type": "application/json", "app-send-date": "1733997543238", "app-verification-string": "ddf199ed5886ae9c0b79b29750edf1161fe1b53fb9415cc4ac3404fa645b8b67" } } { "path": "/vehicle/status", "query": { "vin": [ "REDACTED" ], "vehStatusReqType": [ "2" ] }, "body": { "code": 0, "data": { "basicVehicleStatus": { "frontRightSeatHeatLevel": 0, "steeringWheelHeatFailureReason": 0, "rearRightDoor": 0, "sideLightStatus": 0, "frontLeftTyrePressure": 68, "driverWindow": 0, "rearRightTyrePressure": 65, "rmtHtdRrWndSt": 0, "canBusActive": 1, "frontRightTyrePressure": 66, "driverDoor": 0, "frontLeftSeatHeatLevel": 0, "lockStatus": 1, "powerMode": 0, "engineStatus": 0, "exteriorTemperature": 0, "fuelRange": 2710, "extendedData2": 1, "currentJourneyId": 1120, "extendedData1": 81, "mileage": 117830, "fuelLevelPrc": 0, "steeringHeatLevel": 0, "interiorTemperature": -128, "batteryVoltage": 148, "passengerDoor": 0, "clstrDspdFuelLvlSgmt": 0, "mainBeamStatus": 0, "remoteClimateStatus": 0, "vehElecRngDsp": 0, "sunroofStatus": 1, "currentJourneyDistance": 0, "bonnetStatus": 0, "handBrake": 0, "bootStatus": 0, "fuelRangeElec": 2710, "lastKeySeen": 24163, "rearRightWindow": 0, "vehicleAlarmStatus": 2, "wheelTyreMonitorStatus": 0, "rearLeftTyrePressure": 66, "rearLeftDoor": 0, "passengerWindow": 0, "rearLeftWindow": 0, "dippedBeamStatus": 0 }, "extendedVehicleStatus": { "alertDataSum": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] }, "gpsPosition": { "timeStamp": 1733997419, "gpsStatus": 2, "wayPoint": { "satellites": 11, "heading": 198, "position": { "altitude": 0, "latitude": 0, "longitude": 0 }, "hdop": 5, "speed": 0 } }, "statusTime": 1733997421 }, "message": "success" }, "headers": { "date": "Thu, 12 Dec 2024 09:57:05 GMT", "content-type": "application/json", "content-length": "1378", "connection": "keep-alive", "event-id": "1905558288", "app-content-encrypted": "1", "original-content-type": "application/json", "app-send-date": "1733997425640", "app-verification-string": "fead41d0ce726b5f4dd7db1199cb55c1a2f4e8bb066c6a2e6ef314c741d14da0" } }nanomad commentedon Dec 15, 2024
Uhm unfortunately @jkrenzer I don't see any value I can use to deduce the lock state... I'll keep this open as a reminder for the future in case we discover something new
jkrenzer commentedon Dec 16, 2024
Thanks. I am not entirely sure yet, but maybe it is an "optimistic" action (e.g. no state, just triggering) for the ZS, as in the car itself there is also only an unlock button and the lock engages by itself when the cable is plugged into the wallbox/charger. Will try to investigate, when the vehicle is not needed so frequently.
nanomad commentedon Oct 17, 2026
Thanks again for the dumps, they made this clear. The charge management response from the ZS has no
ccuEleccLckCtrlDspCmdfield. The other models send it, with1for locked and2for unlocked. Without the field the gateway fell back to "unlocked", so the lock state was alwaysFalse. The car does not report it, so the gateway cannot read it back.#477 changes two things:
An older version already left a retained
Falseon.../drivetrain/chargingCableLock. It stays until your first lock or unlock command. To clear it, publish an empty retained message to that topic.