sdague / mychevy

Python module to interact with my.chevy website for collecting charge data for chevy bolt
Other
50 stars 8 forks source link

wrong 'mileage' result with Volt #2

Closed mkfink closed 6 years ago

mkfink commented 6 years ago

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.

sdague commented 6 years ago

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?

mkfink commented 6 years ago

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

sdague commented 6 years ago

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."}}
sdague commented 6 years ago

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.

sdague commented 6 years ago

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