Cumbers

Breakdown of currentcost xml output

May 7, 2008 · 22 Comments

With all the blogject/tweetject activity going on with James Taylor, Chris Hodgins, Nick O’Leary and of course Andy-SC, and with Nick’s excellent guide to getting the data and creating custom graphs, I thought it would be good to blog about the actual xml data, and in doing so create a reference article for new people joining the currentcost foray! I do not know what all the data stands for, and this article will get updated as and when I am told/I work it out!

Updated: XML notations have been updated in line with comments to blog post. Thank you to everyone for helping with this!

<msg>
  <date>
    <dsb>00030</dsb> // This is the 'days since birth'
    <hr>00</hr><min>20</min><sec>11</sec> // The Time
  </date>
  <src>
    <name>CC02</name> // The name of the device
    <id>00077</id>  // Communication channel for device
    <type>1</type> // Hardware version of the device.
    <sver>1.06</sver> // Software version
  </src>
  <ch1>
    <watts>00168</watts> // Value from the 1st channel clamp
  </ch1>
  <ch2>
    <watts>00000</watts> // Value from the 2nd channel clamp
  </ch2>
  <ch3>
    <watts>00000</watts> // Value from the 3rd channel clamp
  </ch3>
  <tmpr>25.6</tmpr> // Current Temperature as recorded by unit
  <hist>
    <hrs> // Total Kwh used in 2 hour blocks
      <h02>000.3</h02>
      ....
      <h26>003.1</h26>
    </hrs>
    <days> // Total Kwh used per day(s)

      <d01>0014</d01>
      ....
      <d31>0000</d31>
    </days>
    <mths> // Total Kwh used per month(s)

      <m01>0000</m01>
      ....
      <m12>0000</m12>
    </mths>
    <yrs> // Total Kwh used per year(s)

      <y1>0000000</y1>
      ....
      <y4>0000000</y4>
    </yrs>
  </hist>
</msg>

Questions that I would like answered.

  • Is the data stored in persistent memory? Answered by AndySC. Yes it is flash memory :)
  • What does DSB stand for? Answered by Nick in comments below and xml above

Categories: CurrentCost
Tagged: , ,

22 responses so far ↓

  • Nick O'Leary // May 7, 2008 at 8:40 am | Reply

    ‘DSB’ is days since birth – so you know how long the meter has been running and collecting data for.

  • David Illsley // May 7, 2008 at 8:51 am | Reply

    DSB… how many days has your #currentcost has been active? “Days Since Beginning/Birth”?

  • Rich Cumbers // May 7, 2008 at 8:54 am | Reply

    Thanks Nick/David, and thank you Nick for the forwarded email, it turns out that Andy SC had emailed us with this information already. Now it is there for all to digest!

  • jt // May 7, 2008 at 9:28 am | Reply

    Another question…

    Does the CurrentCost serial port accept any input? I suspect not, but it might be handy to set the time and cost per unit using the serial port for example.

  • Andy Piper // May 15, 2008 at 8:01 pm | Reply

    With all of this work going on, it almost feels as though it’s time for some kind of wiki or project to share the information :-)

  • Rich Cumbers // May 15, 2008 at 9:26 pm | Reply

    Andy,

    After our last tweetup we agreed on having an IBM internal TAP Community for the information, along with a project. I’ll send forth the details….

    External pages are under discussion at the moment and may come up at the next meeting.

  • Helen // May 16, 2008 at 3:37 pm | Reply

    The id is the radio channel that the cc meter is using

  • Helen // May 16, 2008 at 3:40 pm | Reply

    Also this is always for a 2 hour period – // Total Kwh used per hour(s)

  • Andy S-C // May 16, 2008 at 3:45 pm | Reply

    Just to clarify a couple of points in the XML and other questions… could you fix up the annotation to make it right, then?

    DSB is days since birth – how many days it has been operational for… as it can’t count when it’s turned off (the clock on the display stops when it’s off, also).

    the “ID” is the radio channel it’s using – by default it’s 77, but if you retune, then it will be something else.

    “type” is the hardware version

    The “hours” are every TWO hours.. current cost used to call this “bi-hourly”, but now appreciate that is ambiguous (!)

    There is (unfortunately) no unique ID in the meter.

    Sometimes (somewhat randomly) the meter may omit to send out the … part of the message. This is if it’s too busy to do the whole thing.

    The history data is stored in flash memory, so is persistent.

    @jtonline no, the serial port is data OUT only.

    :)
    Andy

  • Roo Reynolds // May 17, 2008 at 7:20 pm | Reply

    FYI, the 2400 baud models don’t seem to include the hist section or sver.

  • plus six » Counting the Cost // May 18, 2008 at 1:04 am | Reply

    [...] There are other devices that do similar things, but the CurrentCost has a serial port through which it outputs its readings every 6 seconds or so, which means you can use the data for whatever you like. It’s even in XML. [...]

  • Effing the Ineffable » Interfacing the CurrentCost meter to your PC // June 15, 2008 at 5:51 pm | Reply

    [...] it’s working, you should see a whole bunch of XML data appear every 6 seconds or so – Rich has kindly broken this [...]

  • dale lane » Blog Archive » CurrentCost - getting the history into Windows // June 15, 2008 at 11:00 pm | Reply

    [...] Rich highlighted in his post on the CurrentCost XML output, the CurrentCost meter maintains some running totals in flash memory, and these are included with [...]

  • Dale Lane // June 16, 2008 at 9:20 pm | Reply

    Probably just me being slow, but I found the two-hour totals a bit confusing at first.

    I think I’ve got it sussed now – in case it is helpful for anyone else looking at this for the first time, they seem to be two-hour buckets giving the total since the last “even” hour?

    For example, consider the hourly history data you would get at 7.41pm

    h2 contains total for 18:00 to 20:00
    h4 contains total for 16:00 to 18:00
    h6 contains total for 14:00 to 16:00
    h8 contains total for 12:00 to 14:00
    h10 contains total for 10:00 to 12:00
    h12 contains total for 8:00 to 10:00
    h14 contains total for 6:00 to 8:00
    h16 contains total for 4:00 to 6:00
    h18 contains total for 2:00 to 4:00
    h20 contains total for 0:00 to 2:00
    h22 contains total for 22:00 (yesterday) to 0:00
    h24 contains total for 20:00 (yesterday) to 22:00 (yesterday)
    h26 contains total for 18:00 (yesterday) to 20:00 (yesterday)

    Looking at it like that, it makes sense to me now why there are 13 updates – it means you can get twenty-four hours worth of updates.

  • dale lane » Blog Archive » Our Mashed 08 hack: CurrentCost Live // June 23, 2008 at 10:06 pm | Reply

    [...] Connect a serial cable to the port and you can get the electric meter readings in XML form. [...]

  • Tristan Ferne // July 4, 2008 at 9:44 am | Reply

    Hello,

    I’ve been following your experiments with interest and have bought a Current Cost. Unfortunately I seem to have a 2400 baud device which only spits out the current data, not the history (on an RJ45 though). Any ideas how to get one with history? Can you configure it? Cheers.

  • Andy S-C // July 24, 2008 at 1:44 pm | Reply

    Hi Tristan
    there are two models of currentcost meter in circulation – the slightly older one runs at 2400 baud and doesn’t store history.
    The newer one runs at 9600 baud and does have history.
    The power companies have the older ones in stock at the moment… :(

  • dale lane » Blog Archive » CurrentCost app … take 2! // August 30, 2008 at 11:12 pm | Reply

    [...] clunky, and I’m convinced that I’m not reading the hourly data quite right (the data is received from the CurrentCost meter in a confusingly-labelled way giving relative times, and I think I’m translating it into actual times [...]

  • Dewang Dave // October 2, 2008 at 12:58 pm | Reply

    Hi,
    I am using a current-cost meter that sends the current energy every 6 seconds in watts and I am storing these values in the database i.e. currentEnergy = currentEnergy + liveEnergy and counter = counter + 1 so at the end of the day i m having the total sampled value and total no of sample with sampling rate as 1 sample in every 6 seconds and they are 10097246 Watts & 10976 samples. if i divide the total sampled energy with total no of samples i.e. 10097246/10976 = 919.94 Watts per sample. How do i calculate the kW-hr for that day??

  • Colm O'Gairbhith // November 14, 2008 at 10:34 pm | Reply

    Hi Dewang,

    If your figures show an average value per sample of 919.24 watts, i.e. 0.919kW, then in one hour you would consume, on average 0.919 kWh. Multiply by 24 for the daily average.

    regards / Colm

  • Getting Started with the Current Cost Meter « Andrew Whitehouse’s Weblog // November 28, 2008 at 10:26 pm | Reply

    [...] The unit actually returns the data in XML format, which Rich Cumbers has helpfully detailed. [...]

  • Getting data from the CurrentCost CC128 « dale lane // February 7, 2009 at 11:09 pm | Reply

    [...] history data – how it used to work My old CurrentCost meter outputs a line of XML every six seconds or so. Most of the time it includes history data, but not always. But it was good [...]

Leave a Comment