SAIC-iSmart-API / saic-python-mqtt-gateway

MIT License
64 stars 20 forks source link

Remaining range shows 0km when car not in motion #218

Closed bjoernkowarsch closed 2 months ago

bjoernkowarsch commented 3 months ago

I installed SAIC MQTT Gateway (Python) HA add-on Version 0.6.0 this morning and did some driving (office and back) today. I noticed the remaining range in my HA dashboard is only displayed when the car is actually moving. If it is parked, the range shows 0km. However, telegram notification which I set up which is giving me a trip summary after each drive is showing me the remaining range correctly.

Anyone else having this problem?

nanomad commented 3 months ago

Hi @bjoernkowarsch what car are you driving?

Can you also show the chart of:

All on the same page, focusing just on the time around the range dropped to 0

The "Range" stats are now pulled straight from the BMS instead of the vehicle stats and indeed it allows a 0 mileage reading, altough I had never seen that.

if it happens consistently we can setup an in-depth diagnosis session

bjoernkowarsch commented 3 months ago

Hi @nanomad ,

I have a MG5 Long Range Luxury.

brand = MG
model = MG5 Electric
year = 2021
series = EP2DP3
color = FLARE RED

Funny thing is, in the moment I was trying to assemble the required info it seems to keep the values on the dashboard: Screenshot 2024-04-16 174307

drivetrain
hvBatteryActive = False
running = False
charging = False
auxiliaryBatteryVoltage = 12.5
mileage = 6746.0
current = 0.0
voltage = 370.0
power = 0.0
socTarget = 100
soc = 63.8
hybrid_electrical_range = 351
mileageOfTheDay = 10.0
mileageSinceLastCharge = 113.0
soc_kwh = 39.02
chargingType = 1
chargerConnected = False
chargingSchedule = { "startTime": "22:00", "endTime": "06:00", "mode": "DISABLED" }
remainingChargingTime = 0
lastChargeEndingPower = 56.8
totalBatteryCapacity = 61.1
range = 213.0
batteryHeating = False
batteryHeatingSchedule = { "mode": "off", "startTime": "00:00" }
currentJourney = { "id": 1059, "distance": 2.0 }
powerUsageOfDay = 206.31
powerUsageSinceLastCharge = 17.87
chargingCableLock = False

So I guess we can close this for now. Maybe its been a browser / website cache thing ...

nanomad commented 3 months ago

@bjoernkowarsch Just to be sure, if you plot the "Range" from the HA page, do you see any "0" values? If so, we may still have a bug lurking around.

bjoernkowarsch commented 3 months ago

This is the plot: Screenshot 2024-04-16 190912 Red arrows mark the time when I was seeing 0km range left (like I said in my initial post, this morning when I installed the latest version), yellow arrows now show the remaining range.

So for some reason it seems to work now. Not sure what caused the zero range value over the course of the day ...

nanomad commented 3 months ago

Thanks, please keep this monitored. If you still see any 0 ranges just tag me and let me know and we can start looking into it.

Il Mar 16 Apr 2024, 19:12 Bjoern Kowarsch @.***> ha scritto:

This is the plot: Screenshot.2024-04-16.190912.png (view on web) https://github.com/SAIC-iSmart-API/saic-python-mqtt-gateway/assets/2862188/3546fcb1-4211-4447-a572-6fe9cc5cfaeb Red arrows mark the time when I was seeing 0km range left (like I said in my initial post, this morning when I installed the latest version), yellow arrows now show the remaining range.

So for some reason it seems to work now. Not sure what caused the zero range value over the course of the day ...

— Reply to this email directly, view it on GitHub https://github.com/SAIC-iSmart-API/saic-python-mqtt-gateway/issues/218#issuecomment-2059563195, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIT3RWE5TP4TFI4A5WRSC3Y5VLY5AVCNFSM6AAAAABGJSVB32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJZGU3DGMJZGU . You are receiving this because you modified the open/close state.Message ID: @.*** .com>

bjoernkowarsch commented 3 months ago

Hi @nanomad , unfortunately it happened again: image

I also noticed that while charging I do not get indications for kW and A any longer (definitely worked with the previous version): Screenshot 2024-04-18 173556

Will check if this is known / reported already - just fyi.

Bjoern

nanomad commented 3 months ago

@bjoernkowarsch can you try with v0.6.1 as soon as it's released?

bjoernkowarsch commented 3 months ago

@nanomad so I installed version 0.6.1 this morning and monitored the drive to my office. So far, it seems to work. However, when I have entered an underground park deck, range again goes to "0". Maybe its because connection is blocked and the gateway does not receive a (final) message that the car is parked and no longer in motion? Not sure how this situation is supposed to be treated..

I have not checked for indications while charging as there hasn't been an opportunity to charge the car. Maybe within the next days ...

bjoernkowarsch commented 3 months ago

What I have forgot to mention (even in earlier posts), many thanks for providing the SAIC gateway! I absolutely appreciate the work and the efforts you are spending on it! Thumbs up!

nanomad commented 3 months ago

Interesting, seems like the MG5 sets this data to 0 while parked. I wonder what else is set to 0 then... Can you please run the troubleshooting steps described here?

https://github.com/SAIC-iSmart-API/saic-python-mqtt-gateway/issues/221#issuecomment-2059866763

(as long as you can trigger this issue reliabily)

I can certainly blacklist 0 as a range value as temporary fix, but I'd rater make a proper one

bjoernkowarsch commented 3 months ago

I don't seem to have that endpoint / Topic: saic/_internal/api/vehicle/charging/mgmtData/response

This is what my MQTT Explorer is showing: image

nanomad commented 3 months ago

@bjoernkowarsch you're looking inside the vehicle tree. It's at the top level under saic

nanomad commented 2 months ago

Fix in 0.6.2-rc8, please try it out @bjoernkowarsch