[Ovmsdev] [Dev] SoC from logs

Tom Saxton tom at idleloop.com
Tue Apr 29 01:14:18 HKT 2014

Hi Julien,

I'm not sure exactly what you're asking, but there are a number of ways
you can get the SOC from OVMS.

- The STAT text message, as you mentioned.
- Current SOC via the HTTP API.
- If logging is enabled, SOC and start and end of each drive and charge
segment is available via HTTP API.
- Recent SOC history from the server's cache of recent reports from the
car, available via HTTP.
- If you're running your own server, as Nikki described in her blog, you
can get the SOC from the database.

I have a Perl script that demonstrates how to use the HTTP API to get
information from the OVMS server.

At the top of the attached Perl script, fill in your OVMS server username,
password and vehicle identifier string. If you're using a server other
than tmc.openvehicles.com, you'll need to search and replace the API URL
for your server.

When you run the script, it will first dump out the car's current status,
then optionally more information.

To see the server's cached records, run the command:

   ovms-query.pl server

The SOC is in the 'S' record. The script shows how to extract that value.

If you have logging enabled, you can get the charge records with this

   ovms-query.pl charge

And the drive segment records with this command:

   ovms-query.pl drive

I have another script that I run once per day to download all of the
server records and accumulate them into a log file on my machine. I'd be
happy to share that as well.


-----Original Message-----
From: "Julien (JaXX) Banchet" <jaxx at jaxx.org>
Reply-To: OVMS Developers <ovmsdev at lists.teslaclub.hk>
Date: Sunday, April 27, 2014 at 11:17 PM
To: OVMS Developers <ovmsdev at lists.teslaclub.hk>
Subject: [Ovmsdev] [Dev] SoC from logs

>This could be a question for Nikki, as it has been blogged at
>But having kept all of GPS and PWR logs for the last 6/7 months, I would
>love to enrich my database and thingspeak (http://things.tools.jaxx.org/)
>charts with a SoC level field. (my thingspeak is closed off for public,
>don¹t wanna give away my cars¹ availability for robbery ;-) )
>And as silly as it may sound, I can¹t see how to determinate that
>(without issuing a Stats? command by text), it¹s probably right under my
>nose, but heyŠ It¹s like lego parts, you never find the part you look for
>until you've moved on to something else.
>I¹d extrapolate nice efficiency (W/km %/km) graphs
>Can anyone point me in any direction?
>Thanks in advance.
>Julien (JaXX) Banchet
>OvmsDev mailing list
>OvmsDev at lists.teslaclub.hk

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ovms-query.pl
Type: text/x-perl-script
Size: 10472 bytes
Desc: not available
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20140428/4889af0e/attachment-0002.bin>

More information about the OvmsDev mailing list