Posted by: Rich Cumbers | May 7, 2008

Breakdown of currentcost xml output

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!

    <dsb>00030</dsb> // This is the 'days since birth'
    <hr>00</hr><min>20</min><sec>11</sec> // The Time
    <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
    <watts>00168</watts> // Value from the 1st channel clamp
    <watts>00000</watts> // Value from the 2nd channel clamp
    <watts>00000</watts> // Value from the 3rd channel clamp
  <tmpr>25.6</tmpr> // Current Temperature as recorded by unit
    <hrs> // Total Kwh used in 2 hour blocks
    <days> // Total Kwh used per day(s)

    <mths> // Total Kwh used per month(s)

    <yrs> // Total Kwh used per year(s)


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


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

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

  3. 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!

  4. 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.

  5. 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 πŸ™‚

  6. 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.

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

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

  9. 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.


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

  11. […] 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. […]

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

  13. […] 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 […]

  14. 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.

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

  16. 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.

  17. 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… 😦

  18. […] 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 […]

  19. 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??

  20. 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

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

  22. […] 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 […]

  23. is anyone aware of a home build receiver unit?

    i’m interested in a receiver/logger that can be attached to an always on pc, but without using the currentcost display unit.

    does anyone know what the max. range of the receiver/transmitter combo is. i have read up to 100m, but would like some real world feedback.


  24. If anyone is interested, I made a small perl script to read CurrentCost XML data and update feed with current power readings (in watts). It can work with multiple sensors and multiple channels too.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: