{"id":283,"date":"2008-06-23T21:05:49","date_gmt":"2008-06-23T21:05:49","guid":{"rendered":"http:\/\/dalelane.co.uk\/blog\/?p=283"},"modified":"2008-06-23T21:35:40","modified_gmt":"2008-06-23T21:35:40","slug":"our-mashed-08-hack-currentcost-live","status":"publish","type":"post","link":"https:\/\/dalelane.co.uk\/blog\/?p=283","title":{"rendered":"Our Mashed 08 hack: CurrentCost Live"},"content":{"rendered":"<p>Yesterday was the end of <a href=\"http:\/\/mashed08.backnetwork.com\/\" target=\"_blank\">Mashed 08<\/a> &#8211; the annual London hackday from <a href=\"http:\/\/backstage.bbc.co.uk\/\" target=\"_blank\">BBC Backstage<\/a>. <\/p>\n<p>I <a href=\"http:\/\/twitter.com\/dalelane\/statuses\/833876132\" target=\"_blank\">saw last week<\/a> that there was going to be a <a href=\"http:\/\/mashed08.backnetwork.com\/event\/?articleid=20\" target=\"_blank\">&#8220;social responsibility&#8221; category in the hack challenge<\/a>, and decided that a CurrentCost hack was in order!<\/p>\n<p>Together with <a href=\"http:\/\/cumbers.wordpress.com\/\" target=\"_blank\">Rich<\/a>, we spent a day trying to hack together a competitive challenge based around CurrentCost, encouraging people to reduce their home electricity usage by making it into a game they can play with their friends.<\/p>\n<p>Here are a few notes based on the presentation I gave at the end. <\/p>\n<p><!--more--><a href=\"http:\/\/www.flickr.com\/photos\/dalelane\/2494743990\/\" title=\"CurrentCost - the transmitter by dalelane, on Flickr\"><img loading=\"lazy\" decoding=\"async\" align=\"left\" style=\"border: thin black solid\" hspace=\"10\" vspace=\"10\" width=\"160\" height=\"240\" alt=\"CurrentCost - the transmitter\" src=\"http:\/\/farm3.static.flickr.com\/2159\/2494743990_961099494e_m.jpg\" \/><\/a>To start, a little background. This is my electricity meter at home.<\/p>\n<p>The device attached to it is a <a href=\"http:\/\/www.currentcost.com\/\" target=\"_blank\">CurrentCost meter<\/a>. It&#8217;s an inductive loop that goes around a cable into my electric meter.  Every six seconds it measures the amount of electricity I&#8217;m using at home.<br \/>\n<br clear=\"all\"\/><br \/>\n<a href=\"http:\/\/www.flickr.com\/photos\/dalelane\/2493925687\/\" title=\"CurrentCost - the LCD display by dalelane, on Flickr\"><img loading=\"lazy\" decoding=\"async\" align=\"right\" style=\"border: thin black solid\" hspace=\"10\" vspace=\"10\" src=\"http:\/\/farm4.static.flickr.com\/3205\/2493925687_2e40962cf4_m.jpg\" width=\"173\" height=\"240\" alt=\"CurrentCost - the LCD display\" \/><\/a>The large black box contains a transmitter, which is used to send the meter readings to this &#8211; the display unit.<\/p>\n<p>This shows you the reading &#8211; so you can see at a glance how much electricity you are using.<br \/>\n<br clear=\"all\"\/><br \/>\n<a href=\"http:\/\/flickr.com\/photos\/rooreynolds\/2438688453\/\" target=\"_blank\"><img decoding=\"async\" align=\"left\" style=\"border: thin black solid\" hspace=\"10\" vspace=\"10\" src=\"http:\/\/farm3.static.flickr.com\/2179\/2438688453_c257a85e2a_m.jpg\"\/><\/a>We&#8217;ve had these meters for a few weeks now, and what has made them more interesting is the port underneath. <\/p>\n<p>Connect a serial cable to the port and you can get the <a href=\"http:\/\/cumbers.wordpress.com\/2008\/05\/07\/breakdown-of-currentcost-xml-output\/\" target=\"_blank\">electric meter readings in XML form<\/a>. <\/p>\n<p>With friends and colleagues at work, we&#8217;ve been playing with different things that we can do with this data.<br \/>\n<br clear=\"all\"\/><br \/>\n<a href=\"http:\/\/www.flickr.com\/photos\/dalelane\/2585909618\/\" title=\"tweaking the CurrentCost GUI by dalelane, on Flickr\"><img loading=\"lazy\" decoding=\"async\" align=\"right\" style=\"border: thin black solid\" hspace=\"10\" vspace=\"10\" src=\"http:\/\/farm4.static.flickr.com\/3173\/2585909618_385fe4db63_m.jpg\" width=\"240\" height=\"186\" alt=\"tweaking the CurrentCost GUI\" \/><\/a>For example, last week I made a start on <a href=\"http:\/\/dalelane.co.uk\/blog\/?p=281\">a Windows GUI for the CurrentCost data<\/a>. <\/p>\n<p>Each new update can be shown as a new bar, with graphs for hourly, daily and monthly totals.<\/p>\n<p>A group of us at <a href=\"http:\/\/www.ibm.com\/uk\/hursley\/\" target=\"_blank\">work<\/a> have worked on an infrastructure that lets us upload our meter readings to a broker out there on the Internet.<br \/>\n<a href=\"http:\/\/flickr.com\/photos\/dalelane\/2509049808\/\" target=\"_blank\"><img decoding=\"async\" vspace=\"10\" src=\"http:\/\/i267.photobucket.com\/albums\/ii311\/dale_lane\/080623-ccostslide.gif\"\/><\/a><\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/dalelane\/2522806416\/\" title=\"First day's full CurrentCost data by dalelane, on Flickr\"><img loading=\"lazy\" decoding=\"async\" align=\"left\" style=\"border: thin black solid\" hspace=\"10\" vspace=\"10\" src=\"http:\/\/farm3.static.flickr.com\/2299\/2522806416_57247b0d1c_m.jpg\" width=\"240\" height=\"141\" alt=\"First day's full CurrentCost data\" \/><\/a>One of the first uses of this was a way to display real-time graphs of each house&#8217;s electricity usage online.<\/p>\n<p>But with all of our readings in one place, we can start making more interesting uses of the data. And this is where we were when we arrived at Mashed.<\/p>\n<p>The idea was to create a game based on the data. We&#8217;re both <a href=\"http:\/\/dalelane.co.uk\/blog\/?p=264\">XBox 360 owners<\/a> and one way that XBox encourages people to play is through <a href=\"http:\/\/live.xbox.com\/member\/dalelane\" target=\"_blank\">XBox Live<\/a>. <\/p>\n<p><a href=\"http:\/\/i267.photobucket.com\/albums\/ii311\/dale_lane\/080623-xboxlive1.jpg\" target=\"_blank\"><img decoding=\"async\" align=\"left\" src=\"http:\/\/i267.photobucket.com\/albums\/ii311\/dale_lane\/080623-xboxlive1sm.jpg\" style=\"border: thin black solid\" hspace=\"10\" vspace=\"10\"\/><\/a>Firstly, it has &#8216;Achievements&#8217;. <\/p>\n<p>Instead of just scores, they set challenges that you can work towards.<br \/>\n<br clear=\"all\"\/><br \/>\n<a href=\"http:\/\/i267.photobucket.com\/albums\/ii311\/dale_lane\/080623-xboxlive2.jpg\" target=\"_blank\"><img decoding=\"async\" align=\"right\" src=\"http:\/\/i267.photobucket.com\/albums\/ii311\/dale_lane\/080623-xboxlive2sm.jpg\" style=\"border: thin black solid\" hspace=\"10\" vspace=\"10\"\/><\/a>And it&#8217;s social. <\/p>\n<p>You don&#8217;t just look at your own score, you look at your score compared with those of your friends. <\/p>\n<p>You don&#8217;t just see if you&#8217;ve completed an achievement, you see which completed compared with your friends. <\/p>\n<p><br clear=\"all\"\/><br \/>\nIt makes games more interesting and engaging, and provides an incentive to try harder. We thought we&#8217;d try and copy that approach with the CurrentCost data.<\/p>\n<p>There are a number of achievements we could define:<\/p>\n<ul>\n<li>Lowest single reading\n<\/li>\n<li>Lowest total power use\n<\/li>\n<li>Lowest average use\n<\/li>\n<\/ul>\n<p>and so on. <\/p>\n<p>We could also define challenges based on personal improvements:<\/p>\n<ul>\n<li>Lowest percentage of personal average\n<\/li>\n<li>Highest reduction in use\n<\/li>\n<\/ul>\n<p>etc.<\/p>\n<p>We started with <a href=\"http:\/\/code.google.com\/appengine\/\" target=\"_blank\">Google App Engine<\/a>. We wrote an app that would provide a web-based way to specify groups of CurrentCost users. <\/p>\n<p><img decoding=\"async\" align=\"center\" src=\"http:\/\/i267.photobucket.com\/albums\/ii311\/dale_lane\/080623-gae.gif\"\/><\/p>\n<p>The app accesses the CurrentCost readings for these users from the broker, and analyses them against the achievements we&#8217;d defined. The scores are then stored in the Google App Engine database.<\/p>\n<p>But how to report the results to users?<\/p>\n<p><img decoding=\"async\" align=\"center\" src=\"http:\/\/i267.photobucket.com\/albums\/ii311\/dale_lane\/080623-gae2.gif\"\/><\/p>\n<p>As our aim was to help encourage and motivate people, we didn&#8217;t want to create a whole new site as a stand-alone thing that people would have to remember to visit. <\/p>\n<p>Instead, we wanted to find ways to put this in places where people already go. <\/p>\n<p>Firstly, <a href=\"http:\/\/twitter.com\/\" target=\"_blank\">twitter<\/a>. Every good hack needs a twitter element! <\/p>\n<p><img decoding=\"async\" align=\"center\" src=\"http:\/\/i267.photobucket.com\/albums\/ii311\/dale_lane\/080623-twitter.gif\"\/><\/p>\n<p>All members of a CurrentCostLive team could follow a twitter bot for their team, which reported scores, winners and losers as twitter messages. It could even send you @replies or dm&#8217;s with advice for how to save electricity to users who aren&#8217;t doing too well.<\/p>\n<p>Secondly, widgets and gadgets. We liked the idea of modules for each achievement that could be included in people&#8217;s blogs or social network sites. If you put your electricity usage on your Facebook profile where everyone can see it, maybe that would encourage you to try and reduce your usage?<\/p>\n<p><a href=\"http:\/\/i267.photobucket.com\/albums\/ii311\/dale_lane\/080623-igoogle.png\" target=\"_blank\"><img decoding=\"async\" align=\"center\" src=\"http:\/\/i267.photobucket.com\/albums\/ii311\/dale_lane\/080623-igooglesm.png\" style=\"border: thin black solid\" align=\"left\" hspace=\"10\" vspace=\"10\"\/><\/a><br \/>\nAs an example of this, we tried to write a few iGoogle gadgets. The vision was that you would be able to choose which achievements you are interested in, and add these to your homepage &#8211; moving them around wherever you want.<\/p>\n<p>Thirdly, on your TV. <a href=\"http:\/\/twitter.com\/stevegodwin\" target=\"_blank\">Steve Godwin<\/a> was kind enough to let us reuse his (<em>prize-winning!<\/em>) hack that lets you add a twitter feed to your digital TV &#8211; so that the text comes up on screen while you watch your program.<\/p>\n<p><a href=\"http:\/\/i267.photobucket.com\/albums\/ii311\/dale_lane\/080623-tv1.png\" target=\"_blank\"><img decoding=\"async\" vspace=\"10\" style=\"border: thin black solid\" align=\"center\" src=\"http:\/\/i267.photobucket.com\/albums\/ii311\/dale_lane\/080623-tv1sm.png\"\/><\/a><\/p>\n<p>Using the twitter feed we could set up for each CurrentCostLive team, this would let you see on TV how you and your friends are doing in your CurrentCost challenges as they are completed.<\/p>\n<p><a href=\"http:\/\/i267.photobucket.com\/albums\/ii311\/dale_lane\/080623-tv2.png\" target=\"_blank\"><img decoding=\"async\" style=\"border: thin black solid\" vspace=\"10\" align=\"center\" src=\"http:\/\/i267.photobucket.com\/albums\/ii311\/dale_lane\/080623-tv2sm.png\"\/><\/a><\/p>\n<p>That was the idea we presented. Unfortunately, we had some <a href=\"http:\/\/twitter.com\/dalelane\/statuses\/840554375\" target=\"_blank\">hassles with Google App Engine<\/a>, so some of the links between the bits needed to be faked for the demonstration, but most importantly, the idea seemed to capture people&#8217;s interest. <\/p>\n<p><a href=\"http:\/\/twitter.com\/chriscooke\" target=\"_blank\">Chris<\/a> was cruel enough to record my on-stage ramblings, so a <a target=\"_blank\" href=\"http:\/\/www.youtube.com\/watch?v=Ka5f35NLdOs\">video of this presentation<\/a> has found it&#8217;s way to YouTube. I&#8217;m sure my voice doesn&#8217;t really sound like that&#8230; \ud83d\ude42 <\/p>\n<p><object width=\"425\" height=\"344\"><param name=\"movie\" value=\"http:\/\/www.youtube.com\/v\/Ka5f35NLdOs&#038;hl=en&#038;rel=0\"><\/param><embed src=\"http:\/\/www.youtube.com\/v\/Ka5f35NLdOs&#038;hl=en&#038;rel=0\" type=\"application\/x-shockwave-flash\" width=\"425\" height=\"344\"><\/embed><\/object><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday was the end of Mashed 08 &#8211; the annual London hackday from BBC Backstage. I saw last week that there was going to be a &#8220;social responsibility&#8221; category in the hack challenge, and decided that a CurrentCost hack was in order! Together with Rich, we spent a day trying to hack together a competitive [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,4],"tags":[50,194,158,231,147,229,228,230,212],"class_list":["post-283","post","type-post","status-publish","format-standard","hentry","category-code","category-ibm","tag-bbc","tag-currentcost","tag-google","tag-google-app-engine","tag-hackday","tag-mashed","tag-mashed08","tag-mashed2008","tag-python"],"_links":{"self":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=283"}],"version-history":[{"count":0,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/283\/revisions"}],"wp:attachment":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}