Dielee / volvo2mqtt

Home Assistant addon for connecting AAOS Volvos
MIT License
162 stars 38 forks source link

Distance to empy error #127

Closed lumichele closed 1 year ago

lumichele commented 1 year ago

Describe the bug Hi, I'm testing volvo2mqtt on my XC60 2024 PHEV. Integration works correctly except field distance to empy. In volvo2mqtt log there is : INFO : Failed, Distance to Empty is unfortnately not supported by you vehicle. Other fileds (fuel level, eletric range, etc..) are supported (and I receive correct data)

Expected behavior I tested Volvo API https://api.volvocars.com/connected-vehicle/v2/vehicles/VIN/statistics and I receive correct data in field distanceToEmptyTank (that represents distance to empy value) : "distanceToEmptyTank": { "value": 550, "unit": "km",

Version info:
v1.8.13

Dielee commented 1 year ago

Another API change! Thanks for reporting. I will fix this tomorrow.

lumichele commented 1 year ago

Yes, I suppose that fix is in volvo.py

elif sensor_id == "distance_to_empty": if util.keys_exists(data, "distanceToEmpty"):

ID is changed from distanceToEmpty to distanceToEmptyTank

By..

Dielee commented 1 year ago

Jep, this is the fix. Nothing special

Dielee commented 1 year ago

Please test v1.8.14 :)

lumichele commented 1 year ago

Perfect, it works Thanks