Dielee / volvo2mqtt

Home Assistant addon for connecting AAOS Volvos
MIT License
127 stars 25 forks source link

Distance to empy error #127

Closed lumichele closed 7 months ago

lumichele commented 7 months 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 7 months ago

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

lumichele commented 7 months 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 7 months ago

Jep, this is the fix. Nothing special

Dielee commented 7 months ago

Please test v1.8.14 :)

lumichele commented 7 months ago

Perfect, it works Thanks