Current Cost presentation at Open Tech 2008

Here’s the presentation Nick and I gave at Open Tech 2008 yesterday.

SlideShare | View with comments at SlideShare

I really enjoyed the whole event and will try to put up some notes up about it tomorrow.

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…

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.