<?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>..the cat came back.. &#187; monitoring</title>
	<atom:link href="http://blog.automated.it/tag/monitoring/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.automated.it</link>
	<description>i does tech i does.</description>
	<lastBuildDate>Tue, 17 Jan 2012 18:25:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Gratifying Graphic Gizmos</title>
		<link>http://blog.automated.it/2009/03/01/gratifying-graphic-gizmos/</link>
		<comments>http://blog.automated.it/2009/03/01/gratifying-graphic-gizmos/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 08:47:37 +0000</pubDate>
		<dc:creator>ScaredyCat / Andy Powell</dc:creator>
				<category><![CDATA[1-Wire]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[environment]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[Pachube]]></category>

		<guid isPermaLink="false">http://blog.automated.it/?p=207</guid>
		<description><![CDATA[Yesterday the Current Cost unit actually got installed for real, something I was dreading. Dreading not because it was a difficult thing to do but simply because I expected the figure it would show would be terrible. Guess what, it wasn&#8217;t. In fact it seemed to be fairly close to that of other people who [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday the <a href=http://www.currentcost.com/ target=_new>Current Cost</a> unit actually got installed for real, something I was dreading. Dreading not because it was a difficult thing to do but simply because I expected the figure it would show would be terrible. Guess what, it wasn&#8217;t. In fact it seemed to be fairly close to that of other people who are monitoring theirs. The initial figure of 371 Watts didn&#8217;t last too long once the dishwasher and oven came on and an interesting spike appeared when the hob went on for the kettle. </p>
<p><img class="left" title="Current Cost Graph" src="/images/gallery/environment/small_69.png" alt="" width="387" height="166" /><br />
<br/><br />
Continuing with my sudden graphing fetish, as well as using a Current Cost unit I have dotted a number of little devices I&#8217;ve built with <a href='http://www.digi.com/products/wireless/zigbee-mesh/' target=_new>Xbee</a> and <a href='http://arduino.cc' target=_new>Arduinos</a> to measure temperatures (and other things)  around the house. More information on those will come out later, but it&#8217;s an interesting project too. </p>
<p>Since I have the data for those it&#8217;d be rude not to graph them too, there&#8217;s a sample in the thumbnails below.</p>
<p>Not content with graphing them locally I picked up a <a href=http://www.pachube.com target=_new>Pachube</a> invite and started graphing data there too. The process is simple really and as you can see on the right hand side of this page under &#8216;Graphy Stuff&#8217;, graph images can be embedded in your own or other sites. The really interesting thing about Pachube is that you can <a href=http://www.pachube.com/feeds/1498 target=_new>share</a> your data with people who may be interested. The data they get to see is delayed by approximately 15 minutes. If you output your data in the <a href=http://community.pachube.com/?q=node/127>eeml</a> format then you can specify your own tags too.</p>
<p><a title="Electricity Usage Graph" rel="thumbnail" href="http://blog.automated.it/images/gallery/environment/graph_69_1.png"><img src="http://blog.automated.it/images/gallery/environment/thumb_graph_69_1.png" alt="Electricity Usage Graph" width="176" height="64" /></a><a title="Temperature in the garage" rel="thumbnail" href="http://blog.automated.it/images/gallery/environment/graph_70_1.png"><img src="http://blog.automated.it/images/gallery/environment/thumb_graph_70_1.png" alt="Temperature in the garage" width="176" height="64" /></a><br />
<br/></p>

<br><a href=http://blog.automated.it/2009/03/01/gratifying-graphic-gizmos/><p><img style='float:right;margin-left:15px;margin-bottom:10px;' src='http://blog.automated.it/images/tccb.png' border='0'></a></p><br>

<br><span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fblog.automated.it%2F2009%2F03%2F01%2Fgratifying-graphic-gizmos%2F&amp;title=Gratifying+Graphic+Gizmos" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.automated.it%2F2009%2F03%2F01%2Fgratifying-graphic-gizmos%2F&amp;title=Gratifying+Graphic+Gizmos" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fblog.automated.it%2F2009%2F03%2F01%2Fgratifying-graphic-gizmos%2F&amp;title=Gratifying+Graphic+Gizmos" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fblog.automated.it%2F2009%2F03%2F01%2Fgratifying-graphic-gizmos%2F&amp;title=Gratifying+Graphic+Gizmos" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fblog.automated.it%2F2009%2F03%2F01%2Fgratifying-graphic-gizmos%2F&amp;title=Gratifying+Graphic+Gizmos', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://del.icio.us/favicon.ico" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.automated.it%2F2009%2F03%2F01%2Fgratifying-graphic-gizmos%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fblog.automated.it%2F2009%2F03%2F01%2Fgratifying-graphic-gizmos%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fblog.automated.it%2F2009%2F03%2F01%2Fgratifying-graphic-gizmos%2F&amp;title=Gratifying+Graphic+Gizmos" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.automated.it%2F2009%2F03%2F01%2Fgratifying-graphic-gizmos%2F&amp;title=Gratifying+Graphic+Gizmos" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
<a href="http://twitter.com/home?status=Currently reading http%3A%2F%2Fblog.automated.it%2F2009%2F03%2F01%2Fgratifying-graphic-gizmos%2F" title="Click to send this page to Twitter!" target="_blank"><img src="http://www.twitter.com/favicon.ico" width="16" height="16" alt="[Twitter]" /></a>
</span><br><br>]]></content:encoded>
			<wfw:commentRss>http://blog.automated.it/2009/03/01/gratifying-graphic-gizmos/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Current Cost Capers</title>
		<link>http://blog.automated.it/2009/02/13/current-cost-capers/</link>
		<comments>http://blog.automated.it/2009/02/13/current-cost-capers/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 09:38:06 +0000</pubDate>
		<dc:creator>ScaredyCat / Andy Powell</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[monitoring]]></category>

		<guid isPermaLink="false">http://blog.automated.it/?p=205</guid>
		<description><![CDATA[My Unbioctium Current Cost CC128 arrived on Thursday and although I&#8217;m not going to actually get a chance in install it for a couple of weeks I did have a play. The first thing to do once it was all up and paired with the base was get the output into my laptop. To do [...]]]></description>
			<content:encoded><![CDATA[<p>My <a href=http://shop.ebay.co.uk/?_nkw=unbioctium target=_new><del datetime="2009-02-13T08:41:13+00:00">Unbioctium</del></a> <a title="Current Cost" href="http://www.currentcost.com/" target="_blank">Current Cost</a> CC128 arrived on Thursday and although I&#8217;m not going to actually get a chance in install it for a couple of weeks I did have a play. The first thing to do once it was all up and paired with the base was get the output into my laptop. To do this you will need to buy the data cable or <a href=http://e.inste.in/2008/06/15/interfacing-the-currentcost-meter-to-your-pc/ target=_new>make</a> up your own&#8230;</p>
<p>At first I tried to be smart with reading from the serial port, as that seems to be a bit unreliable I fell back on the old tried and tested method. I also decided from the outset that I was going to parse the XML that the the CC128  spat out rather than just filter the bits needed with regexp.</p>
<p>You will need to make sure you have the perl modules Device::SerialPort and XML::Simple installed. If you don&#8217;t have them then as root on your linux box do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">perl -MCPAN -e shell</pre></div></div>

<p>then install each module, for example Device::SerialPort,</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">install Device::SerialPort</pre></div></div>

<p>and here&#8217;s the script which is also available for <a href=/files/cc-128.txt target=_new>download</a>.<em>Updated to make it more reliable</em>.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
</pre></td><td class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</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>
<span style="color: #000000; font-weight: bold;">use</span> XML<span style="color: #339933;">::</span><span style="color: #006600;">Simple</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$port</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;/dev/ttyUSB0&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: #666666; font-style: italic;"># using XML::Parser speeds xml parsing up lots!</span>
<span style="color: #0000ff;">$backend</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'XML::Parser'</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$ENV</span><span style="color: #009900;">&#123;</span>XML_SIMPLE_PREFERRED_PARSER<span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$backend</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># we use this to only do 1 iteration (or not)</span>
<span style="color: #0000ff;">$escape</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</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;&lt;$port&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$escape</span> <span style="color: #339933;">&lt;=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000066;">sleep</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<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>
&nbsp;
		<span style="color: #666666; font-style: italic;"># for debug</span>
		<span style="color: #666666; font-style: italic;">#print $line;</span>
&nbsp;
		<span style="color: #0000ff;">$isValid</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">index</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$line</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;&lt;msg&gt;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #0000ff;">$isValid</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">last</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;This data is&quot;</span><span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$isValid</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">?</span><span style="color: #ff0000;">&quot;&quot;</span><span style="color: #339933;">:</span><span style="color: #ff0000;">&quot; not&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot; valid<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;"># force XML::Simple to see this as a string not as a file</span>
		<span style="color: #666666; font-style: italic;"># since XML::Simple is stupid and needs to be shot</span>
&nbsp;
		<span style="color: #0000ff;">$line</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;&lt;fakeTag&gt;$line&lt;/fakeTag&gt;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #0000ff;">$isHistoric</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">index</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$line</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;&lt;hist&gt;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #0000ff;">$nref</span> <span style="color: #339933;">=</span> XMLin<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$line</span><span style="color: #339933;">,</span>forcearray <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #0000ff;">$ref</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$nref</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>msg<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;"># just for reference, show if data is historic or not</span>
&nbsp;
		<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;This data is&quot;</span><span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$isHistoric</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">?</span><span style="color: #ff0000;">&quot;&quot;</span><span style="color: #339933;">:</span><span style="color: #ff0000;">&quot; not&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot; historic<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #0000ff;">$isHistoric</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	        	<span style="color: #0000ff;">$dsb</span>        <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">$ref</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>dsb<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
        		<span style="color: #0000ff;">$recordTime</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ref</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #000066;">time</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
        		<span style="color: #0000ff;">$ccname</span>     <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ref</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>src<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
        		<span style="color: #0000ff;">$temp</span>       <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ref</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>tmpr<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
			<span style="color: #0000ff;">$ch1watts</span>   <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">$ref</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>ch1<span style="color: #009900;">&#125;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>watts<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
			<span style="color: #0000ff;">$sensor</span>     <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">$ref</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>sensor<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
			<span style="color: #0000ff;">$id</span>         <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ref</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>id<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
			<span style="color: #0000ff;">$type</span>       <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">$ref</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>type<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">defined</span> <span style="color: #0000ff;">$ref</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>whatever<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #666666; font-style: italic;"># do something based on whatever</span>
&nbsp;
			<span style="color: #009900;">&#125;</span>
&nbsp;
        		<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;This $ccname was born $dsb days ago as at $recordTime - temperature is: $temp :: Current Watts in use on channel 1 are $ch1watts :: Sensor is $sensor, with an id of $id and a type of $type<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;"># for cacti you'd probably just want to output CC_Temperature:$temp CC_Watts1:$ch1watts </span>
&nbsp;
			<span style="color: #666666; font-style: italic;"># insert data into db</span>
&nbsp;
			<span style="color: #666666; font-style: italic;"># if you want to exit after a 'good' iteration set this to 1 otherwise set it to 0 (or don't change it to 1 :) );</span>
			<span style="color: #0000ff;">$escape</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">#process or ignore historic data</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<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></td></tr></table></div>

<p>and here&#8217;s some example output, remember that I haven&#8217;t actually connected the loop around my electrical cable as yet.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">This data is not historic
This CC128-v0.11 was born 1 days ago as at 21:16:44 - temperature is: 23.7 :: Watts used on channel 1 are 0 :: Sensor is 0, with an id of 02835 and a type of 1</pre></div></div>

<p>Historic data isn&#8217;t processed at the moment but it would be trivial to do. I&#8217;m not processing it since I don&#8217;t really see the point if you&#8217;re going to store the results in a database.</p>

<br><a href=http://blog.automated.it/2009/02/13/current-cost-capers/><p><img style='float:right;margin-left:15px;margin-bottom:10px;' src='http://blog.automated.it/images/tccb.png' border='0'></a></p><br>

<br><span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fblog.automated.it%2F2009%2F02%2F13%2Fcurrent-cost-capers%2F&amp;title=Current+Cost+Capers" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.automated.it%2F2009%2F02%2F13%2Fcurrent-cost-capers%2F&amp;title=Current+Cost+Capers" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fblog.automated.it%2F2009%2F02%2F13%2Fcurrent-cost-capers%2F&amp;title=Current+Cost+Capers" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fblog.automated.it%2F2009%2F02%2F13%2Fcurrent-cost-capers%2F&amp;title=Current+Cost+Capers" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fblog.automated.it%2F2009%2F02%2F13%2Fcurrent-cost-capers%2F&amp;title=Current+Cost+Capers', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://del.icio.us/favicon.ico" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.automated.it%2F2009%2F02%2F13%2Fcurrent-cost-capers%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fblog.automated.it%2F2009%2F02%2F13%2Fcurrent-cost-capers%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fblog.automated.it%2F2009%2F02%2F13%2Fcurrent-cost-capers%2F&amp;title=Current+Cost+Capers" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.automated.it%2F2009%2F02%2F13%2Fcurrent-cost-capers%2F&amp;title=Current+Cost+Capers" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
<a href="http://twitter.com/home?status=Currently reading http%3A%2F%2Fblog.automated.it%2F2009%2F02%2F13%2Fcurrent-cost-capers%2F" title="Click to send this page to Twitter!" target="_blank"><img src="http://www.twitter.com/favicon.ico" width="16" height="16" alt="[Twitter]" /></a>
</span><br><br>]]></content:encoded>
			<wfw:commentRss>http://blog.automated.it/2009/02/13/current-cost-capers/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

