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
‘DSB’ is days since birth – so you know how long the meter has been running and collecting data for.
By: Nick O'Leary on May 7, 2008
at 08:40
DSB… how many days has your #currentcost has been active? “Days Since Beginning/Birth”?
By: David Illsley on May 7, 2008
at 08:51
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!
By: Rich Cumbers on May 7, 2008
at 08:54
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.
By: jt on May 7, 2008
at 09:28
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
By: Andy Piper on May 15, 2008
at 20:01
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.
By: Rich Cumbers on May 15, 2008
at 21:26
The id is the radio channel that the cc meter is using
By: Helen on May 16, 2008
at 15:37
Also this is always for a 2 hour period – // Total Kwh used per hour(s)
By: Helen on May 16, 2008
at 15:40
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
By: Andy S-C on May 16, 2008
at 15:45
FYI, the 2400 baud models don’t seem to include the hist section or sver.
By: Roo Reynolds on May 17, 2008
at 19:20
[...] 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. [...]
By: plus six » Counting the Cost on May 18, 2008
at 01:04
[...] it’s working, you should see a whole bunch of XML data appear every 6 seconds or so – Rich has kindly broken this [...]
By: Effing the Ineffable » Interfacing the CurrentCost meter to your PC on June 15, 2008
at 17:51
[...] 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 [...]
By: dale lane » Blog Archive » CurrentCost - getting the history into Windows on June 15, 2008
at 23:00
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.
By: Dale Lane on June 16, 2008
at 21:20
[...] Connect a serial cable to the port and you can get the electric meter readings in XML form. [...]
By: dale lane » Blog Archive » Our Mashed 08 hack: CurrentCost Live on June 23, 2008
at 22:06
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.
By: Tristan Ferne on July 4, 2008
at 09:44
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…
By: Andy S-C on July 24, 2008
at 13:44
[...] 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 [...]
By: dale lane » Blog Archive » CurrentCost app … take 2! on August 30, 2008
at 23:12
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??
By: Dewang Dave on October 2, 2008
at 12:58
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
By: Colm O'Gairbhith on November 14, 2008
at 22:34
[...] The unit actually returns the data in XML format, which Rich Cumbers has helpfully detailed. [...]
By: Getting Started with the Current Cost Meter « Andrew Whitehouse’s Weblog on November 28, 2008
at 22:26
[...] 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 [...]
By: Getting data from the CurrentCost CC128 « dale lane on February 7, 2009
at 23:09
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.
thanks!
By: dave on February 15, 2010
at 14:25
If anyone is interested, I made a small perl script to read CurrentCost XML data and update http://www.pachube.com/ feed with current power readings (in watts). It can work with multiple sensors and multiple channels too.
By: Cougar on March 29, 2010
at 06:00