sdague/mychevy

wrong 'mileage' result with Volt

mkfink opened this issue · 5 comments

  • mychevy version: 0.1.1
  • Python version: 3.5.3

First, this is awesome, I love it, and it seems to almost completely work with my Volt. The only issue I have is that 'mileage' returns only the electric miles, not total miles. This makes sense given the Bolt has no distinction between electric and gas mileage, so the table on the website is formatted differently for each car. In my case, it looks like total miles is on table row 5 instead of 1 so I just made a small change at https://github.com/sdague/mychevy/blob/master/mychevy/mychevy.py#L113.

Are you interested in expanding this project to work for cars other than the Bolt? I understand if not, but I can offer some help and testing from my end if so.

Sure. I'm actually working on a better way of getting the data which will stop parsing tables and just use the json coming back and be more robust. The 'json' branch on github is that work in progress, and the mychevy-debug cli command should return reasonable data.

Is just getting total mileage good enough? Do you also need electric mileage?

Total mileage is good enough, but if it isn't a ton of trouble, logging everything in this table would be really awesome. As a hybrid I assume this is an edge case with quite a few more stats than a pure ICE or EV would have.
image

Maybe... I get the feeling that they kind of shoe horned the Bolt onto the Volt data stream. This is what I get on the json on the wire for my Bolt with the new code. I'm happy to reflect additional attributes there to the object model.

{"messages":[],"serverErrorMsgs":[],"data":{"dataAsOfDate":1517317946000,"batteryLevel":82,"chargeState":"not_charging","plugState":"unplugged","rateType":"PEAK","voltage":0,"electricRange":155,"totalRange":182,"chargeMode":"DEPARTURE_BASED","electricMiles":1843,"gasMiles":0,"totalMiles":1843,"percentageOnElectric":1,"fuelEconomy":1000,"electricEconomy":44,"combinedEconomy":9,"fuelUsed":182,"electricityUsed":182,"estimatedGallonsFuelSaved":70.45,"estimatedCO2Avoided":1366.73,"estimatedFullChargeBy":"5:00 a.m."}}

This new code also handles issue #1 - so I'm trying to get confirmation that it works with multiple cars before making it the default.

I think this is fixed in 0.3.0, please test with that.