I basically did the same thing Voltstats did initially and reverse engineered the Remotelink app for Android.
Originally Posted by tboult
The code I've done for it is definitely not pretty, but, it seems to work and has for several months now.
My database stores information in the following mySQL table by polling OnStar about every 15 minutes during the day, and every 30 minutes 12AM to 5AM.
From sequential rows of this data I can calculate out a lot of things, including average speed, fuel consumption, battery energy used, etc. My kWh tracking is based on changes in the reported battery level and a pretty straightforward formula to estimate that into kWh to the battery and from the wall, in the case of an increase. I've used the numbers from my Kill-a-Watt (for 120V charging) and my digital meter (on my 240V charger) to get an average of how much energy comes from the wall per battery %. (For me, turns out to be 100%=~12.5 kWh @ 240V and ~13.75kWh @ 120V, for those interested.)
create table voltstats (
id INT AUTO_INCREMENT,
Not to hijack the thread, but, heres a link to some of the graphs I generate from the data:
Perhaps when I get some more time I'll tidy and publish the code, although, I'm not sure how much OnStar would appreciate that...