
Originally Posted by
tboult
interesting.. what are you using to poll onstar.. I'd be interested in that type of data..
I basically did the same thing Voltstats did initially and reverse engineered the Remotelink app for Android.
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.
Code:
create table voltstats (
id INT AUTO_INCREMENT,
date DATETIME,
odometer DOUBLE,
evodometer DOUBLE,
batterylevel DOUBLE,
fuellevel DOUBLE,
oillife DOUBLE,
lifempg DOUBLE,
electricecon DOUBLE,
evrange DOUBLE,
gasrange DOUBLE,
tirepsiLF DOUBLE,
tirepsiRF DOUBLE,
tirepsiLR DOUBLE,
tirepsiRR DOUBLE,
evplugstate VARCHAR(64),
chargestate VARCHAR(64),
evplugvoltage INT,
lasttripmpg DOUBLE,
lasttripevmiles DOUBLE,
lasttriptotalmiles DOUBLE,
ignitionstatus VARCHAR(64),
direction FLOAT,
PRIMARY KEY(id));
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.)
Not to hijack the thread, but, heres a link to some of the graphs I generate from the data:

http://www.wizkid057.com/volt/
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...
-wk
Bookmarks