Current Cost Charting fun

Meter with Current Cost clamp fitted Current Cost display

Nick has already written a nice introduction to using the Google Chart API for drawing charts of household power consumption over time. I’ve been playing with some other parts of the API as part of setting up a web-based dashboard so Rachel and I can keep an eye on our house’s power (as monitored by the Current Cost meter) from the living room computer and our own laptops.

First, I also started playing with what Google describes as Google-o-meters. For example, a basic dial can be created like this

http://chart.apis.google.com/chart?chs=200x120
&cht=gom
&chd=t:50
&chl=label

For power readings, I’d prefer to have the colours go from green through yellow to red, and since the colour argument takes an optional 4th component for opacity (00-ff), let’s try making it semitransparent too.

http://chart.apis.google.com/chart
?chs=200x120
&cht=gom
&chco=00ff0099,ffff0099,ff000099
&chd=t:62
&chl=1.24%20KW

For temperatures, something like this might be quite nice.

http://chart.apis.google.com/chart
?chs=200x120
&cht=gom
&chco=0000ff99,ffffff99,ff000099
&chd=t:75
&chl=22%C2%B0C

I’ve been spending some time thinking about alternatives to line graphs (or sparklines) for plotting daily power consumption. I’m really liking the radar chart option. These look a bit like this.

http://chart.apis.google.com/chart
?cht=r
&chs=200x200
&chd=t:20,40,80,40,20,30
&chco=FF0000
&chxt=x
&chxl=0:|0|1|2|3|4
&chm=B,FF000040,0,1,0

(using cht=r for straight lines, and again with the same data but using curved lines, thanks to cht=rs)

It seems quite well suited to rendering 24 hours of power consumption. Like so.

http://chart.apis.google.com/chart
?cht=r (and rs for splines)
&chs=300x300
&chd=s:QKKHHHHIG9JwpHIXddcbUMRUQ (using simple encoding)
&chco=FF0000
&chxt=x
&chxl=0:|0|1|2|3|4|5|6|7|8|9|10|11|12|[etc...] (labels)
&chm=B,FF000040,0,1,0|h,00004444,0,0.5,1|h,00004444,0,1,1 (rings at 50 and 100%)

That was a Saturday. Can you tel when we got up and switched on the (power-hungry) electric shower? On a weekday, that initial spike comes a bit earlier.

Even better, I can overlay the daily plots from a whole week in one chart. Using semi-transparent shading helps create a sort of heat-map thingy, thusly.

http://chart.apis.google.com/chart
?cht=rs
&chs=300x300
&chd=s:CBBBBBBBBDXcCBCCXQFFFGEDC,CCBBBBCbTZMCECCCTORRFFFCB, [...] (one per series)
&chxt=x
&chxl=0:|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23
&chm=B,FF000066,0,1,0|B,FF000066,1,2,0|[etc, shading for each series]|h,00004444,0,0.5,1|h,00004444,0,1,1

It looks as though most of our power is spent in the mornings, largely due to the electric shower.

Update: Nick’s done some great work which goes way beyond this…

17 Comments

RSS feed for comments on this post.

  1. With a standard line chart I can compare by eye the area under the line to compare the kWh used by a given spike.

    I don’t think I can do this on a radar chart as the area under the line is not proportional to use, so tall spikes cover a disproportionally large area.

    So for displaying information to people, given that many people will naturally read a chart by comparing the area under the line, I’m a little worried that they de-emphasise the cost of long running low level use.

    That said, I do think that this chart would be really good for recognising patterns as it creates recognisable shapes and can represents time as the continuum it is, rather than something that starts and stops at 00:00.

    Comment by David Illsley — May 12, 2008 #

  2. Hi David

    Do you find the disproportionatly large area (or is it indirectly proportional?) under a spike offputting? Would it be less misleading if the chart wasn’t shaded?

    I think the trend of the line is valuable, even if the area underneath it isn’t as meaningful as it would be on an x/y plot. I should have pointed out that the readings are being summed (or could be averaged, but summed it nice), at one hour intervals. If it was plotting one reading per minute, the area under the line would probably more relevant. With that coarse-grained data you’re not seeing comparisons between short-and-fat or tall-and-skinny spikes anyway, the data is already trended into hourly readings. (And I were taking the area seriously I should be using straight lines rather than spline curve smoothing too).

    I think these graphs are a reasonable way to show a pattern of usage. At least, their clock-ness makes it very easy to use them to spot temporal patterns. Even better than overlaying a week’s worth of data onto one chart seems to be laying seven of them side by side in a row. Once I have a grid of a few weeks, I expect to be able to see patterns in the columns. We always get up later on Saturday, for one thing. Perhaps seeing the overlaid total for a week (at the end of each row) and same day-of-the-week across many weeks (at the bottom of each column) will be interesting. Lots to play with, anyway.

    Comment by Roo — May 12, 2008 #

  3. Hey Roo, I’m in absolute agreement that it’s a good way to show patterns and do comparisons between 24 hour periods – the interesting shapes and the pseudo clock form see to it. I’m intrigued how many types of days exist and can be identified (weekday/weekend/WAH day…) and how early in the day it can be done and I think these style of charts could help with that.

    When I was first looking at the 24hr chart above, I wasn’t comparing across days, but between the hours, and it was only a while later that I realised that I hadn’t correctly understood the relationship between the power used for the shower vs the power used overnight.

    Given that you were summing not averaging and the resultant sample rate is 1/hr, I still wasn’t understanding it correctly ;-) and area really isn’t relevant – it’s all about the distance along each hourly axis.

    To your questions: Now that I understand that area is meaningless because of the data point being plotted, it’s not as offputting. While the shading may have helped my confusion, I think it helps when doing the overlays of multiple days – colour mixing comes to mind as a something to investigate.

    Lots of things to play with indeed!

    Comment by David Illsley — May 12, 2008 #

  4. [...] Turning the data into graphs and charts: Nick, Roo [...]

    Pingback by dale lane » Blog Archive » CurrentCost - first impressions — May 15, 2008 #

  5. Following on from David’s interesting observation, why not plot the square root of the power consumption on the radial axis?

    The spikes would be less exaggerated, but you would still have the “clockiness” and the area would be proportional to the energy consumption.

    Comment by joe chacko — May 17, 2008 #

  6. And this is the reason I blog. Cleverer people than me read it and take the time to make suggestions I’d never have thought of on my own.

    Thanks Joe (and David). I’ll try that.

    Comment by Roo — May 17, 2008 #

  7. [...] know the device spits out an XML packet every six seconds, and people have been grabbing that and feeding it into Google Charts or homebrew solutions. The Current Cost website gives a demo of an interesting-looking app which is [...]

    Pingback by COPE: James Wallis levels with you » Current fun — May 21, 2008 #

  8. [...] are lots of interesting things to do with the data, which I’ll start to play with once I have a meaningful volume of it. One [...]

    Pingback by CurrentCost « log.illsley.org — May 26, 2008 #

  9. [...] want to start with something a bit different to graphs, because there’s already been a lot of cool work done in different graphing [...]

    Pingback by dale lane » Blog Archive » A daily CurrentCost “bill” — May 28, 2008 #

  10. [...] My long awaited current cost meter arrived this week . I have been looking forward to this arriving for the last month, especially after reading the blogs written by Dale Lane, Andy Piper, Roo Reynolds. [...]

    Pingback by Setting up my Current Cost Meter | Chris Dalby Untangles Networks — June 15, 2008 #

  11. [...] The current craze at IBM Hursley involves the CurrentCost meter, a simple little gadget that measures power usage in your house. These are being discussed on IBM [...]

    Pingback by Effing the Ineffable » Interfacing the CurrentCost meter to your PC — June 15, 2008 #

  12. [...] plan The more geeky amongst us have connected the CurrentCost to a server of some sort. By connecting it to something [...]

    Pingback by dale lane » Blog Archive » CurrentCost - getting the history into Windows — June 15, 2008 #

  13. Current Cost Monitor…

    A couple of guys at work have managed to lay their hands on a funky new device called a Current Cost meter. It’s pretty simple to understand, it measures your household electricity usage and displays……

    Trackback by Graham White: My Notes — July 23, 2008 #

  14. Graphing Current Cost…

    After hooking up my Current Cost Meter to a database recently I’ve been logging my power usage so the next step is to look at what I can do with the data. As I mentioned when I introduced my meter lo……

    Trackback by Graham White: My Notes — July 29, 2008 #

  15. [...] reading pages like this and this, the geek inside me knew I had to have one! After it finally arrived I plugged it in and was [...]

    Pingback by light.widgisoft.co.uk » Blog Archive » Current Cost Meter — October 4, 2008 #

  16. [...] I’d like to translate it into some simple charts that could sit on the sidebar of this blog. Some have used the Google Charts API. If I can work out what I’m doing, I’ll do the [...]

    Pingback by Counting the current | daveharte.com — November 24, 2008 #

  17. [...] I was at uni) and Paul Mutton’s Jibble on the Matter, and then the subsequent posts about doing roughly the same thing, I decided that my new flat would need to have an electricity monitoring [...]

    Pingback by Electricity Usage Logging with CurrentCost EnviR and a Raspberry Pi — November 11, 2012 #

Sorry, the comment form is closed at this time.

Powered by WordPress with GimpStyle Theme design by Horacio Bella.
The postings on this site are my own and don't necessarily represent my employer's positions, strategies or opinions.