<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Awooga!!! &#187; electricity</title>
	<atom:link href="http://awooga.nl/tag/electricity/feed" rel="self" type="application/rss+xml" />
	<link>http://awooga.nl</link>
	<description>how hard can it be?</description>
	<lastBuildDate>Wed, 05 May 2010 20:01:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Bye Bye Standby double wall switch</title>
		<link>http://awooga.nl/bye-bye-standby-double-wall-switch</link>
		<comments>http://awooga.nl/bye-bye-standby-double-wall-switch#comments</comments>
		<pubDate>Mon, 26 Oct 2009 12:56:15 +0000</pubDate>
		<dc:creator>Q</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[bye bye standby]]></category>
		<category><![CDATA[electricity]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[home easy]]></category>
		<category><![CDATA[modding]]></category>

		<guid isPermaLink="false">http://awooga.nl/?p=423</guid>
		<description><![CDATA[I&#8217;m a big fan of Bye Bye Standby and am slowly replacing all switches and lights with their products. One thing that is sorely missed though, is a double wall switch. The kind that sits at the bottom of your stairs and controls the lights upstairs and downstairs. Home Easy do one, but that protocol [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a big fan of <a href="http://www.byebyestandby.co.uk/" target="_blank" class="liexternal">Bye Bye Standby</a> and am slowly replacing all switches and lights with their products.  One thing that is sorely missed though, is a double wall switch.  The kind that sits at the bottom of your stairs and controls the lights upstairs and downstairs.  <a href="http://www.homeeasy.eu/home.php" target="_blank" class="liexternal">Home Easy</a> do one, but that protocol is not compatible.  So I combined the best of both worlds and cobbled one together myself :)<br />
<br /><br /><center><script type="text/javascript"><!--
google_ad_client = "pub-3248212177098373";
google_ad_slot = "3039514391";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</center><br /><br />
<a href="/gallery/modding/bbsb-switch/DSC02694.JPG.html" ><img src="/g/image/35810-3/DSC02694.JPG" alt="" /></a> <a href="/gallery/modding/bbsb-switch/DSC02695.JPG.html" ><img src="/g/image/35815-3/DSC02695.JPG" alt="" /></a> <a href="/gallery/modding/bbsb-switch/DSC02696.JPG.html" ><img src="/g/image/35819-3/DSC02696.JPG" alt="" /></a> <a href="/gallery/modding/bbsb-switch/DSC02697.JPG.html" ><img src="/g/image/35823-3/DSC02697.JPG" alt="" /></a> <a href="/gallery/modding/bbsb-switch/DSC02698.JPG.html" ><img src="/g/image/35827-3/DSC02698.JPG" alt="" /></a> <a href="/gallery/modding/bbsb-switch/DSC02699.JPG.html" ><img src="/g/image/35831-3/DSC02699.JPG" alt="" /></a></p>
<p>Start by stripping all switches down to their bare PCBs.  The idea is to use the push button switches inside the <a href="http://www.diy.com/diy/jsp/bq/nav.jsp?action=detail&#038;fh_secondid=9686459&#038;fh_view_size=10&#038;fh_eds=%3F&#038;fh_location=%2F%2Fcatalog01%2Fen_GB%2Fcategories%3C{9372015}%2Fcategories%3C{9372042}%2Fcategories%3C{9372189}%2FspecificationsProductType%3Dhome_automation%2FspecificationsSpecificProductType%3Don_off_range&#038;fh_refview=lister&#038;ts=1249160690494&#038;isSearch=false" target="_blank" class="liexternal">Home Easy HE308</a> switch and connect them to the push button switches from the <a href="http://www.uk-automation.co.uk/wall-switch-standby-domia-lite-p-1273.html" target="_blank" class="liexternal">Bye Bye Standby wall switches</a> and then stuff it all in the wall.</p>
<p><a href="/gallery/modding/bbsb-switch/DSC02700.JPG.html" ><img src="/g/image/35835-3/DSC02700.JPG" alt="" /></a> <a href="/gallery/modding/bbsb-switch/DSC02702.JPG.html" ><img src="/g/image/35843-3/DSC02702.JPG" alt="" /></a> <a href="/gallery/modding/bbsb-switch/DSC02703.JPG.html" ><img src="/g/image/35847-3/DSC02703.JPG" alt="" /></a> <a href="/gallery/modding/bbsb-switch/DSC02704.JPG.html" ><img src="/g/image/35851-3/DSC02704.JPG" alt="" /></a> <a href="/gallery/modding/bbsb-switch/DSC02705.JPG.html" ><img src="/g/image/35855-3/DSC02705.JPG" alt="" /></a> <a href="/gallery/modding/bbsb-switch/DSC02706.JPG.html" ><img src="/g/image/35859-3/DSC02706.JPG" alt="" /></a></p>
<p>Carefully solder wires to each BBSB switch and then solder them to the HE308.  As the PCB of the HE308 connects some of the pins, it wouldn&#8217;t work when I tested it.  No problem though, it just meant that I had to get my faithful Dremel out and dremel away all PCB lines surrounding the switches.</p>
<p><a href="/gallery/modding/bbsb-switch/DSC02707.JPG.html" ><img src="/g/image/35864-5/DSC02707.JPG" alt="" class="aligncenter" /></a></p>
<p>Make sure you test it once it&#8217;s all been connected up, not just when you&#8217;re finished putting it back into your wall ;)  At this point in time, make sure you have set the address codes to the correct modules.</p>
<p><a href="/gallery/modding/bbsb-switch/DSC02711.JPG.html" ><img src="/g/image/35879-3/DSC02711.JPG" alt="" /></a> <a href="/gallery/modding/bbsb-switch/DSC02712.JPG.html" ><img src="/g/image/35883-3/DSC02712.JPG" alt="" /></a> <a href="/gallery/modding/bbsb-switch/DSC02714.JPG.html" ><img src="/g/image/35891-3/DSC02714.JPG" alt="" /></a></p>
<p>As the whole package is larger than my backbox, I removed the bottom from a plastic backbox and used a hammer and old screwdriver to chisel away at the wall behind it.  Once I had everything inside and made sure that it was still working, I discovered that the edges from the backbox were larger than the switch itself.  Doh!</p>
<p>I took everything out again and carefully reduced the edging until it all fitted neatly underneath the switch.</p>
<p><a href="/gallery/modding/bbsb-switch/DSC02716.JPG.html" ><img src="/g/image/35900-5/DSC02716.JPG" alt="" class="aligncenter" /></a><br />
<br /><br /><center><script type="text/javascript"><!--
google_ad_client = "pub-3248212177098373";
google_ad_slot = "3039514391";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</center><br /><br />
For those who are worried about the batteries, they are no more difficult to replace than a normal BBSB switch.  I would replace both at the same time though if you have to :)</p>
]]></content:encoded>
			<wfw:commentRss>http://awooga.nl/bye-bye-standby-double-wall-switch/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Mul-tea Charger</title>
		<link>http://awooga.nl/the-mul-tea-charger</link>
		<comments>http://awooga.nl/the-mul-tea-charger#comments</comments>
		<pubDate>Sun, 04 Oct 2009 19:15:23 +0000</pubDate>
		<dc:creator>Q</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[chargers]]></category>
		<category><![CDATA[crafts]]></category>
		<category><![CDATA[electricity]]></category>
		<category><![CDATA[gadgets]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[hub]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[modding]]></category>
		<category><![CDATA[nokia]]></category>
		<category><![CDATA[sony ericsson]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[W880i]]></category>

		<guid isPermaLink="false">http://awooga.nl/?p=413</guid>
		<description><![CDATA[Who doesn&#8217;t have a multitude of devices, phones and other gadgets on their desks? I certainly have, and I finally had enough of all the chargers and wallwarts that each item seems to bring with them. With two iPhones almost constantly being charged, and a Nokia phone thrown in for good measure, I needed to [...]]]></description>
			<content:encoded><![CDATA[<p>Who doesn&#8217;t have a multitude of devices, phones and other gadgets on their desks?  I certainly have, and I finally had enough of all the chargers and wallwarts that each item seems to bring with them.  With two iPhones almost constantly being charged, and a Nokia phone thrown in for good measure, I needed to have something flexible enough for those plus any future gadgets.  So, I googled a bit, and found the <a href="http://www.idaptweb.com/UK/idapt/idapt_i3/overview.html" target="_blank" class="liexternal">IDAPT I3</a>, and the beautiful, but ridiculously priced <a href="http://www.pedlars.co.uk/page_1973.html" target="_blank" class="liexternal">The Sanctuary</a>.  And then I started to think, how easy would it be to put a mains powered USB hub inside a box and have several USB charger leads coming out of the box, each charging a different device?<br />
<br /><br /><center><script type="text/javascript"><!--
google_ad_client = "pub-3248212177098373";
google_ad_slot = "3039514391";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</center><br /><br />
And the answer is, very easy :)</p>
<p><a href="/gallery/modding/charger/DSC02612.JPG.html" ><img src="/g/image/35708-3/DSC02612.JPG" alt="" /></a> <a href="/gallery/modding/charger/DSC02613.JPG.html" ><img src="/g/image/35713-3/DSC02613.JPG" alt="" /></a> <a href="/gallery/modding/charger/DSC02614.JPG.html" ><img src="/g/image/35717-3/DSC02614.JPG" alt="" /></a></p>
<p>I started off with a 4 port powered USB hub, which I had lying in a drawer and plugged my iPhone charger leads into it, expecting them to instantly charge my two iPhones.  But to my surpise, nothing happened&#8230;  so another quick Google later, I came accross a blog entry of <a href="http://carlhutzler.com/blog/2009/07/28/usb-hub-as-an-ipodiphone-charger/" target="_blank" class="liexternal">Carl Hutzler</a>, which details why they won&#8217;t charge.  All you have to do is sacrifice the hub and forego it&#8217;s PC functionality by cutting the D+/- lines and short them.  A quick test shows they now finally charge themselves.  Apparently it is better to stick 2x 100K Ohm resistors on the D+/- lines, which I will do at some point, but for now, this will do.</p>
<p><a href="/gallery/modding/charger/DSC02616.JPG.html" ><img src="/g/image/35721-3/DSC02616.JPG" alt="" /></a> <a href="/gallery/modding/charger/DSC02617.JPG.html" ><img src="/g/image/35725-3/DSC02617.JPG" alt="" /></a> <a href="/gallery/modding/charger/DSC02618.JPG.html" ><img src="/g/image/35734-3/DSC02618.JPG" alt="" /></a></p>
<p>All I now had to do was find a suitable SWMBO friendly container, and as our furniture is all beech, the tea storage container I found for £1.99 at <a href="http://www.qdstores.co.uk/" target="_blank" class="liexternal">QD stores</a> was perfect.  I just needed to gut the compartiments out and put something on top of the plastic lid.  At my local crafts store I found a small foam pad for 50p which was nice and soft.  Unfortunately I got my measurements all wrong, so I messed up the black pad, but SWMBO came to the rescue by rummaging through my kids crafts drawers by digging up a piece of brown padding.</p>
<p><a href="/gallery/modding/charger/DSC02619.JPG.html" ><img src="/g/image/35738-3/DSC02619.JPG" alt="" /></a> <a href="/gallery/modding/charger/DSC02620.JPG.html" ><img src="/g/image/35742-3/DSC02620.JPG" alt="" /></a> <a href="/gallery/modding/charger/DSC02621.JPG.html" ><img src="/g/image/35746-3/DSC02621.JPG" alt="" /></a> <a href="/gallery/modding/charger/DSC02622.JPG.html" ><img src="/g/image/35750-3/DSC02622.JPG" alt="" /></a> <a href="/gallery/modding/charger/DSC02623.JPG.html" ><img src="/g/image/35759-3/DSC02623.JPG" alt="" /></a></p>
<p>The final thing to do is then drill some holes at the locations convenient for your devices, and put it all together.  Job done!</p>
<p><a href="/gallery/modding/charger/DSC02624.JPG.html" ><img src="/g/image/35763-3/DSC02624.JPG" alt="" /></a> <a href="/gallery/modding/charger/DSC02625.JPG.html" ><img src="/g/image/35767-3/DSC02625.JPG" alt="" /></a> <a href="/gallery/modding/charger/DSC02626.JPG.html" ><img src="/g/image/35771-3/DSC02626.JPG" alt="" /></a><br />
<br /><br /><center><script type="text/javascript"><!--
google_ad_client = "pub-3248212177098373";
google_ad_slot = "3039514391";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</center><br /></p>
]]></content:encoded>
			<wfw:commentRss>http://awooga.nl/the-mul-tea-charger/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Current Cost Classic vs CC128</title>
		<link>http://awooga.nl/current-cost-classic-vs-cc128</link>
		<comments>http://awooga.nl/current-cost-classic-vs-cc128#comments</comments>
		<pubDate>Fri, 13 Feb 2009 00:04:12 +0000</pubDate>
		<dc:creator>Q</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[currentcost]]></category>
		<category><![CDATA[dell]]></category>
		<category><![CDATA[electricity]]></category>
		<category><![CDATA[gadgets]]></category>
		<category><![CDATA[graphs]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[modding]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[serial]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[temperatures]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://awooga.nl/?p=330</guid>
		<description><![CDATA[Back in November I bought (well, actually I signed up to a new deal with E.ON which included one) a Current Cost electricity monitor, and hooked it up to my server so I could gather the stats for Cacti. I do this by running a small perl script which looks as follows: #!/usr/bin/perl # /usr/local/bin/cc-classic.pl [...]]]></description>
			<content:encoded><![CDATA[<p>Back in November I bought (well, actually I signed up to a new deal with <a href="http://www.eonenergy.com/" target="_blank" class="liexternal">E.ON</a> which included one) a <a href="http://www.currentcost.co.uk/" target="_blank" class="liexternal">Current Cost</a> <a href="http://www.currentcost.com/product-theclassic.html" target="_blank" class="liexternal">electricity monitor</a>, and hooked it up to my server so I could gather the stats for <a href="http://www.cacti.net/" target="_blank" class="liexternal">Cacti</a>.  I do this by running a small perl script which looks as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
<span style="color: #666666; font-style: italic;"># /usr/local/bin/cc-classic.pl</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> Device<span style="color: #339933;">::</span><span style="color: #006600;">SerialPort</span> <span style="color: #000066;">qw</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">:</span>PARAM <span style="color: #339933;">:</span>STAT <span style="color: #cc66cc;">0.07</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$port</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;/dev/currentcost&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$ob</span> <span style="color: #339933;">=</span> Device<span style="color: #339933;">::</span><span style="color: #006600;">SerialPort</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$port</span><span style="color: #009900;">&#41;</span>
      <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Can not open port $port<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$ob</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">baudrate</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">9600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$ob</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">write_settings</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$ob</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">close</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>SERIAL<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;+&gt;$port&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$line</span> <span style="color: #339933;">=</span> <span style="color: #009999;">&lt;SERIAL&gt;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$line</span> <span style="color: #339933;">=~</span> <span style="color: #000066;">m</span><span style="color: #339933;">!</span><span style="color: #009999;">&lt;ch1&gt;</span><span style="color: #009999;">&lt;watts&gt;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">\d</span><span style="color: #339933;">+</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;/</span>watts<span style="color: #339933;">&gt;&lt;/</span>ch1<span style="color: #339933;">&gt;.*</span><span style="color: #009999;">&lt;tmpr&gt;</span><span style="color: #0000ff;">\s</span><span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">-*</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">\d</span><span style="color: #339933;">.</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;/</span>tmpr<span style="color: #339933;">&gt;!</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
     <span style="color: #0000ff;">$watts</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$1</span><span style="color: #339933;">;</span>
     <span style="color: #0000ff;">$temperature</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$2</span><span style="color: #339933;">;</span>
     <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;watts:$watts temp:$temperature&quot;</span><span style="color: #339933;">;</span>
     <span style="color: #b1b100;">last</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>SERIAL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This would give me the two values I am interested in; watts and temperature (since it sits in <del datetime="2009-02-12T23:22:12+00:00">the garage</del> <a href="/node-zero-33-13-the-final-install" class="liinternal">node 0</a> ;)) in Cacti&#8217;s format:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>cc-classic.pl
watts:<span style="color: #000000;">761</span> temp:<span style="color: #000000;">11.3</span></pre></div></div>

<p>But today, I received my new unit, a Current Cost <a href="http://www.currentcost.com/product-cc128.html" target="_blank" class="liexternal">CC128</a>.  It&#8217;s main benefit is that it supports individual appliance monitors, which makes the output even more useful.  So, armed with a draft copy of the <a href="http://www.currentcost.com/cc128/xml.htm" target="_blank" class="liexternal">CC128 XML</a> output document, I prepared my script to read as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
<span style="color: #666666; font-style: italic;"># /usr/local/bin/cc-cc128.pl</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> Device<span style="color: #339933;">::</span><span style="color: #006600;">SerialPort</span> <span style="color: #000066;">qw</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">:</span>PARAM <span style="color: #339933;">:</span>STAT <span style="color: #cc66cc;">0.07</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$port</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;/dev/currentcost&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$ob</span> <span style="color: #339933;">=</span> Device<span style="color: #339933;">::</span><span style="color: #006600;">SerialPort</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$port</span><span style="color: #009900;">&#41;</span>
      <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Can not open port $port<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$ob</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">baudrate</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">57600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$ob</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">write_settings</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$ob</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">close</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>SERIAL<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;+&gt;$port&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$line</span> <span style="color: #339933;">=</span> <span style="color: #009999;">&lt;SERIAL&gt;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$line</span> <span style="color: #339933;">=~</span> <span style="color: #000066;">m</span><span style="color: #339933;">!</span><span style="color: #009999;">&lt;tmpr&gt;</span><span style="color: #0000ff;">\s</span><span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">-*</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">\d</span><span style="color: #339933;">.</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;/</span>tmpr<span style="color: #339933;">&gt;.*</span><span style="color: #009999;">&lt;ch1&gt;</span><span style="color: #009999;">&lt;watts&gt;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">\d</span><span style="color: #339933;">+</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;/</span>watts<span style="color: #339933;">&gt;&lt;/</span>ch1<span style="color: #339933;">&gt;!</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
     <span style="color: #0000ff;">$watts</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$2</span><span style="color: #339933;">;</span>
     <span style="color: #0000ff;">$temperature</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$1</span><span style="color: #339933;">;</span>
     <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;watts:$watts temp:$temperature&quot;</span><span style="color: #339933;">;</span>
     <span style="color: #b1b100;">last</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>SERIAL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>And guess what&#8230;  that works just fine ;)</p>
<p>For those who read diff:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">diff</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>cc-classic.pl <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>cc-cc128.pl 
2c2
<span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #666666; font-style: italic;"># /usr/local/bin/cc-classic.pl</span>
<span style="color: #660033;">---</span>
<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #666666; font-style: italic;"># /usr/local/bin/cc-cc128.pl</span>
10c10
<span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #007800;">$ob</span>-<span style="color: #000000; font-weight: bold;">&gt;</span>baudrate<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">9600</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
<span style="color: #660033;">---</span>
<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$ob</span>-<span style="color: #000000; font-weight: bold;">&gt;</span>baudrate<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">57600</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
17c17
<span style="color: #000000; font-weight: bold;">&lt;</span>   <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$line</span> =~ m<span style="color: #000000; font-weight: bold;">!&lt;</span>ch1<span style="color: #000000; font-weight: bold;">&gt;&lt;</span>watts<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>\d+<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #000000; font-weight: bold;">&lt;/</span>watts<span style="color: #000000; font-weight: bold;">&gt;&lt;/</span>ch1<span style="color: #000000; font-weight: bold;">&gt;</span>.<span style="color: #000000; font-weight: bold;">*&lt;</span>tmpr<span style="color: #000000; font-weight: bold;">&gt;</span>\s<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>-<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>\d.<span style="color: #7a0874; font-weight: bold;">&#93;</span>+<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #000000; font-weight: bold;">&lt;/</span>tmpr<span style="color: #000000; font-weight: bold;">&gt;!</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #660033;">---</span>
<span style="color: #000000; font-weight: bold;">&gt;</span>   <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$line</span> =~ m<span style="color: #000000; font-weight: bold;">!&lt;</span>tmpr<span style="color: #000000; font-weight: bold;">&gt;</span>\s<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>-<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>\d.<span style="color: #7a0874; font-weight: bold;">&#93;</span>+<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #000000; font-weight: bold;">&lt;/</span>tmpr<span style="color: #000000; font-weight: bold;">&gt;</span>.<span style="color: #000000; font-weight: bold;">*&lt;</span>ch1<span style="color: #000000; font-weight: bold;">&gt;&lt;</span>watts<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>\d+<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #000000; font-weight: bold;">&lt;/</span>watts<span style="color: #000000; font-weight: bold;">&gt;&lt;/</span>ch1<span style="color: #000000; font-weight: bold;">&gt;!</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000;">19</span>,20c19,<span style="color: #000000;">20</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>      <span style="color: #007800;">$watts</span> = $<span style="color: #000000;">1</span>;
<span style="color: #000000; font-weight: bold;">&lt;</span>      <span style="color: #007800;">$temperature</span> = $<span style="color: #000000;">2</span>;
<span style="color: #660033;">---</span>
<span style="color: #000000; font-weight: bold;">&gt;</span>      <span style="color: #007800;">$watts</span> = $<span style="color: #000000;">2</span>;
<span style="color: #000000; font-weight: bold;">&gt;</span>      <span style="color: #007800;">$temperature</span> = $<span style="color: #000000;">1</span>;</pre></div></div>

<p>Please note, the above only works with 1 sensor (the main transmitter), so it is likely to change in the future.  For now it suits my need.</p>
]]></content:encoded>
			<wfw:commentRss>http://awooga.nl/current-cost-classic-vs-cc128/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Lies, damned lies, and statistics</title>
		<link>http://awooga.nl/lies-damned-lies-and-statistics</link>
		<comments>http://awooga.nl/lies-damned-lies-and-statistics#comments</comments>
		<pubDate>Fri, 23 Jan 2009 13:52:49 +0000</pubDate>
		<dc:creator>Q</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[1wire]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[currentcost]]></category>
		<category><![CDATA[electricity]]></category>
		<category><![CDATA[gadgets]]></category>
		<category><![CDATA[graphs]]></category>
		<category><![CDATA[modding]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[temperatures]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://awooga.nl/?p=186</guid>
		<description><![CDATA[I&#8217;ve been using a 1 wire network for quite some time now, but when I deleted a directory to much on my server, I lost a lot of the stats that I had gathered. A couple of weeks ago I finally got my behind in gear again and rebuild my network, this time making sure [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using a <a href="http://en.wikipedia.org/wiki/1-Wire" target="_blank" class="liexternal">1 wire network</a> for quite some time now, but when I deleted a directory to much on my server, I lost a lot of the stats that I had gathered.  A couple of weeks ago I finally got my behind in gear again and rebuild my network, this time making sure it all gets backed up ;)</p>
<p>One day I&#8217;ll write something about how it&#8217;s all been done, but for now you&#8217;ll have to suffice with some pretty graphs.</p>
<p>Here&#8217;s the daily graph for the temperatures in our bedrooms for the past 24 hours:</p>
<p><img class="aligncenter" src="/graphs/graphs/graph_5_1.png" alt="Daily temperatures Bedrooms" width="90%" /></p>
<p>And recently I added a <a href="http://www.currentcost.com/" target="_blank" class="liexternal">Current Cost</a> meter to my network, which gives me the shocking facts about my electricity usage for the past 24 hours:</p>
<p><img class="aligncenter" src="/graphs/graphs/graph_7_1.png" alt="Daily electricy usage" width="90%" /></p>
<p>The above graphs are updated hourly, and I&#8217;ve got other graphs too, extending the period of graphing.  You can find them <a href="http://awooga.nl/graphs/" class="liinternal">here</a> for the time being.</p>
<blockquote><p><strong>Update 25.1.2009</strong></p>
<p>And now you&#8217;re able to follow the stats on twitter: <a href="http://twitter.com/awoogadotnl" target="_blank" class="liexternal">http://twitter.com/awoogadotnl</a></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://awooga.nl/lies-damned-lies-and-statistics/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
