{"id":1142,"date":"2009-11-27T00:20:39","date_gmt":"2009-11-27T00:20:39","guid":{"rendered":"http:\/\/dalelane.co.uk\/blog\/?p=1142"},"modified":"2009-11-27T00:21:09","modified_gmt":"2009-11-27T00:21:09","slug":"how-much-did-i-spend-on-electricity-to-do-that","status":"publish","type":"post","link":"https:\/\/dalelane.co.uk\/blog\/?p=1142","title":{"rendered":"How much did I spend on electricity to do that?"},"content":{"rendered":"<p><a href=\"http:\/\/www.flickr.com\/photos\/dalelane\/4137289132\/\" title=\"Selecting a chunk of a graph by dalelane, on Flickr\"><img loading=\"lazy\" decoding=\"async\" align=\"right\" hspace=10 vspace=10 src=\"http:\/\/farm3.static.flickr.com\/2657\/4137289132_5281e4bd13_m.jpg\" width=\"240\" height=\"188\" alt=\"Selecting a chunk of a graph\" \/><\/a>Time for number 73 in my <a href=\"http:\/\/dalelane.co.uk\/blog\/?s=currentcost+graph\">never-ending list of ever-so-slightly-different things to try with a graph of home energy usage data<\/a> <\/p>\n<p>\ud83d\ude42<\/p>\n<p>This time&#8230; working out the electricity used (and the cost) of doing&#8230; well, something in particular.<\/p>\n<p>We already have <a href=\"http:\/\/www.flickr.com\/photos\/dalelane\/3829875730\/\" target=\"_blank\">live graphs<\/a> (Switch something on and watch the graph shoot up. Switch it off and watch the line drop.)<\/p>\n<p>And we&#8217;ve already got graphs with hourly, <a href=\"http:\/\/currentcostgui.googlecode.com\/files\/ccgui_graphs.png\" target=\"_blank\">daily<\/a>, or monthly totals. <\/p>\n<p>But if I boil a kettle, how do I know how much that cost? <\/p>\n<p>The live graph shows you the shape of the usage curve for a particular appliance.<\/p>\n<p>What I wanted was to be able to start the live graph running, switch something on, then after it&#8217;s finished, go back to the live graph, see the bump in the graph for when I did that, and measure the area under it &#8211; giving me my total energy usage for that time.<\/p>\n<p>A quick bit of Python-tinkering later, and <a href=\"http:\/\/www.youtube.com\/watch?v=cRxyakj-jB8&#038;hd=1\" target=\"_blank\">here we go<\/a>&#8230; <\/p>\n<p><object width=\"445\" height=\"364\"><param name=\"movie\" value=\"http:\/\/www.youtube.com\/v\/cRxyakj-jB8&#038;hl=en_GB&#038;fs=1&#038;rel=0&#038;hd=1\"><\/param><param name=\"allowFullScreen\" value=\"true\"><\/param><param name=\"allowscriptaccess\" value=\"always\"><\/param><embed src=\"http:\/\/www.youtube.com\/v\/cRxyakj-jB8&#038;hl=en_GB&#038;fs=1&#038;rel=0&#038;hd=1\" type=\"application\/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"445\" height=\"364\"><\/embed><\/object><\/p>\n<p>Click-and-drag to highlight a span of the graph, and the Python script calculates the area (<em>more-or-less<\/em>) under that part of the curve, using this to calculate how much energy I used during this time. <\/p>\n<p><!--more-->I&#8217;ll tidy this up and <a href=\"http:\/\/code.google.com\/p\/currentcostgui\" target=\"_blank\">share this update<\/a> in the next day or so. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Time for number 73 in my never-ending list of ever-so-slightly-different things to try with a graph of home energy usage data \ud83d\ude42 This time&#8230; working out the electricity used (and the cost) of doing&#8230; well, something in particular. We already have live graphs (Switch something on and watch the graph shoot up. Switch it off [&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],"tags":[194,214,302,267,212],"class_list":["post-1142","post","type-post","status-publish","format-standard","hentry","category-code","tag-currentcost","tag-electricity","tag-energy","tag-matplotlib","tag-python"],"_links":{"self":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1142","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=1142"}],"version-history":[{"count":0,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1142\/revisions"}],"wp:attachment":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}