<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Power Graphing</title>
	<atom:link href="http://knolleary.net/2008/05/05/power-graphing/feed/" rel="self" type="application/rss+xml" />
	<link>http://knolleary.net/2008/05/05/power-graphing/</link>
	<description>taking my thoughts for a walk</description>
	<lastBuildDate>Mon, 22 Mar 2010 02:00:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ian MacDonald</title>
		<link>http://knolleary.net/2008/05/05/power-graphing/comment-page-1/#comment-12470</link>
		<dc:creator>Ian MacDonald</dc:creator>
		<pubDate>Thu, 19 Nov 2009 11:10:35 +0000</pubDate>
		<guid isPermaLink="false">http://knolleary.net/?p=157#comment-12470</guid>
		<description>Been playing with this for almost 2 weeks now. Pushed the data into a MySQL table slightly differently to you though as I set time as a timestamp so its more flexible. I can then convert to unix time and do time calcs that way.

For example:

+---------------------+-------+------+
&#124; time                &#124; power &#124; temp &#124;
+---------------------+-------+------+
&#124; 2009-11-06 23:19:24 &#124;  1493 &#124; 22.9 &#124; 
&#124; 2009-11-06 23:19:30 &#124;  1492 &#124; 22.9 &#124; 
&#124; 2009-11-06 23:19:36 &#124;  1512 &#124; 22.9 &#124; 
&#124; 2009-11-06 23:19:42 &#124;  1514 &#124; 22.9 &#124; 
&#124; 2009-11-06 23:19:49 &#124;  1506 &#124; 22.9 &#124; 
&#124; 2009-11-06 23:19:54 &#124;  1498 &#124; 22.9 &#124; 
&#124; 2009-11-06 23:20:00 &#124;  1491 &#124; 22.9 &#124; 
&#124; 2009-11-06 23:20:07 &#124;  1487 &#124; 22.9 &#124; 
&#124; 2009-11-06 23:20:13 &#124;  1486 &#124; 22.9 &#124; 
&#124; 2009-11-06 23:20:19 &#124;  1488 &#124; 22.9 &#124; 
+---------------------+-------+------+
10 rows in set (0.00 sec)

Then I can pull out data like this:

select time ,truncate(avg(power),1) as power, truncate(avg(temp),1) as temp from power where time &gt; SUBDATE(NOW(), INTERVAL 1 WEEK) group by floor(unix_timestamp(time)/3600);
+---------------------+--------+------+
&#124; time                &#124; power  &#124; temp &#124;
+---------------------+--------+------+
&#124; 2009-11-12 10:59:18 &#124;  960.8 &#124; 22.8 &#124; 
&#124; 2009-11-12 11:00:00 &#124;  980.7 &#124; 22.7 &#124; 
&#124; 2009-11-12 12:00:02 &#124;  991.5 &#124; 22.7 &#124;
.....
&#124; 2009-11-19 08:00:00 &#124;  996.5 &#124; 23.2 &#124; 
&#124; 2009-11-19 09:00:05 &#124;  973.0 &#124; 22.9 &#124; 
&#124; 2009-11-19 10:00:05 &#124;  974.7 &#124; 22.8 &#124; 
+---------------------+--------+------+

You can convert your YYYYMMDDhhmmss to mysql time with something like: 

select str_to_date(&#039;20080502231747&#039;, &#039;%Y%m%d%H%i%s&#039;);
+-----------------------------------------------+
&#124; str_to_date(&#039;20080502231747&#039;, &#039;%Y%m%d%H%i%s&#039;) &#124;
+-----------------------------------------------+
&#124; 2008-05-02 23:17:47                           &#124; 
+-----------------------------------------------+

so you could convert that to unixtime.</description>
		<content:encoded><![CDATA[<p>Been playing with this for almost 2 weeks now. Pushed the data into a MySQL table slightly differently to you though as I set time as a timestamp so its more flexible. I can then convert to unix time and do time calcs that way.</p>
<p>For example:</p>
<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;-+&#8212;&#8212;+<br />
| time                | power | temp |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;-+&#8212;&#8212;+<br />
| 2009-11-06 23:19:24 |  1493 | 22.9 |<br />
| 2009-11-06 23:19:30 |  1492 | 22.9 |<br />
| 2009-11-06 23:19:36 |  1512 | 22.9 |<br />
| 2009-11-06 23:19:42 |  1514 | 22.9 |<br />
| 2009-11-06 23:19:49 |  1506 | 22.9 |<br />
| 2009-11-06 23:19:54 |  1498 | 22.9 |<br />
| 2009-11-06 23:20:00 |  1491 | 22.9 |<br />
| 2009-11-06 23:20:07 |  1487 | 22.9 |<br />
| 2009-11-06 23:20:13 |  1486 | 22.9 |<br />
| 2009-11-06 23:20:19 |  1488 | 22.9 |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;-+&#8212;&#8212;+<br />
10 rows in set (0.00 sec)</p>
<p>Then I can pull out data like this:</p>
<p>select time ,truncate(avg(power),1) as power, truncate(avg(temp),1) as temp from power where time &gt; SUBDATE(NOW(), INTERVAL 1 WEEK) group by floor(unix_timestamp(time)/3600);<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8211;+&#8212;&#8212;+<br />
| time                | power  | temp |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8211;+&#8212;&#8212;+<br />
| 2009-11-12 10:59:18 |  960.8 | 22.8 |<br />
| 2009-11-12 11:00:00 |  980.7 | 22.7 |<br />
| 2009-11-12 12:00:02 |  991.5 | 22.7 |<br />
&#8230;..<br />
| 2009-11-19 08:00:00 |  996.5 | 23.2 |<br />
| 2009-11-19 09:00:05 |  973.0 | 22.9 |<br />
| 2009-11-19 10:00:05 |  974.7 | 22.8 |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8211;+&#8212;&#8212;+</p>
<p>You can convert your YYYYMMDDhhmmss to mysql time with something like: </p>
<p>select str_to_date(&#8216;20080502231747&#8242;, &#8216;%Y%m%d%H%i%s&#8217;);<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
| str_to_date(&#8216;20080502231747&#8242;, &#8216;%Y%m%d%H%i%s&#8217;) |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
| 2008-05-02 23:17:47                           |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+</p>
<p>so you could convert that to unixtime.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Monitoring Your Power Usage &#171; Isotoma Blog</title>
		<link>http://knolleary.net/2008/05/05/power-graphing/comment-page-1/#comment-12441</link>
		<dc:creator>Monitoring Your Power Usage &#171; Isotoma Blog</dc:creator>
		<pubDate>Wed, 04 Nov 2009 22:27:29 +0000</pubDate>
		<guid isPermaLink="false">http://knolleary.net/?p=157#comment-12441</guid>
		<description>[...] some more detailed information check out: http://mungbean.org/blog/?p=477 and also http://knolleary.net/2008/05/05/power-graphing/ for some tips on [...]</description>
		<content:encoded><![CDATA[<p>[...] some more detailed information check out: <a href="http://mungbean.org/blog/?p=477" rel="nofollow">http://mungbean.org/blog/?p=477</a> and also <a href="http://knolleary.net/2008/05/05/power-graphing/" rel="nofollow">http://knolleary.net/2008/05/05/power-graphing/</a> for some tips on [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dale lane &#187; Blog Archive &#187; HomeCamp</title>
		<link>http://knolleary.net/2008/05/05/power-graphing/comment-page-1/#comment-11388</link>
		<dc:creator>dale lane &#187; Blog Archive &#187; HomeCamp</dc:creator>
		<pubDate>Sun, 30 Nov 2008 18:27:34 +0000</pubDate>
		<guid isPermaLink="false">http://knolleary.net/?p=157#comment-11388</guid>
		<description>[...] leave a low-powered server connected to the meter constantly, collecting every update and maintain your own history (e.g. with a Slug or Viglen-MPC, storing every update from the meter in MySQL) [...]</description>
		<content:encoded><![CDATA[<p>[...] leave a low-powered server connected to the meter constantly, collecting every update and maintain your own history (e.g. with a Slug or Viglen-MPC, storing every update from the meter in MySQL) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: knolleary &#187; Blog Archive &#187; CurrentCostuino</title>
		<link>http://knolleary.net/2008/05/05/power-graphing/comment-page-1/#comment-11297</link>
		<dc:creator>knolleary &#187; Blog Archive &#187; CurrentCostuino</dc:creator>
		<pubDate>Wed, 19 Nov 2008 22:16:45 +0000</pubDate>
		<guid isPermaLink="false">http://knolleary.net/?p=157#comment-11297</guid>
		<description>[...] have previously mentioned that part of the setup used to graph the power data online was to publish the data to a [...]</description>
		<content:encoded><![CDATA[<p>[...] have previously mentioned that part of the setup used to graph the power data online was to publish the data to a [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dollarone</title>
		<link>http://knolleary.net/2008/05/05/power-graphing/comment-page-1/#comment-11069</link>
		<dc:creator>dollarone</dc:creator>
		<pubDate>Sat, 06 Sep 2008 15:07:47 +0000</pubDate>
		<guid isPermaLink="false">http://knolleary.net/?p=157#comment-11069</guid>
		<description>Andrew Carr and others who have looked for a script to read the Current Cost data:


#!/usr/bin/perl
# Based on logger.pl by Bruce S. Garlock 2002-09-11
# (see http://aplawrence.com/Unix/logger.html)
# Requirements: Device::SerialPort 0.12 (from cpan)

use Device::SerialPort 0.12;

$LOGDIR    = &quot;~/log&quot;;  # path to data file
$LOGFILE   = &quot;currentcost.log&quot;;  # file name to output to
$PORT      = &quot;/dev/ttyS0&quot;; # port to watch

# Serial Settings
$ob = Device::SerialPort-&gt;new ($PORT) &#124;&#124; die &quot;Can&#039;t Open $PORT: $!&quot;;
$ob-&gt;baudrate(2400)   &#124;&#124; die &quot;failed setting baudrate&quot;; # set to 9600 if you have the newer version
$ob-&gt;parity(&quot;none&quot;)    &#124;&#124; die &quot;failed setting parity&quot;;
$ob-&gt;databits(8)       &#124;&#124; die &quot;failed setting databits&quot;;
$ob-&gt;handshake(&quot;none&quot;) &#124;&#124; die &quot;failed setting handshake&quot;;
$ob-&gt;write_settings    &#124;&#124; die &quot;no settings&quot;;

# open the logfile, and Port
open(LOG,&quot;&gt;&gt;${LOGDIR}/${LOGFILE}&quot;) &#124;&#124; die &quot;can&#039;t open smdr file $LOGDIR/$LOGFILE for append: $SUB $!\n&quot;;
open(DEV, &quot;&lt;$PORT&quot;) &#124;&#124; die &quot;Cannot open $PORT: $_&quot;;

select(LOG), $&#124; = 1;      # set nonbufferd mode

# Loop forver, logging data to the log file
while($_ = ){        # print input device to file
    print LOG $_;
    print STDOUT $_;      # optional logging to STDOUT
}
undef $ob;</description>
		<content:encoded><![CDATA[<p>Andrew Carr and others who have looked for a script to read the Current Cost data:</p>
<p>#!/usr/bin/perl<br />
# Based on logger.pl by Bruce S. Garlock 2002-09-11<br />
# (see <a href="http://aplawrence.com/Unix/logger.html)" rel="nofollow">http://aplawrence.com/Unix/logger.html)</a><br />
# Requirements: Device::SerialPort 0.12 (from cpan)</p>
<p>use Device::SerialPort 0.12;</p>
<p>$LOGDIR    = &#8220;~/log&#8221;;  # path to data file<br />
$LOGFILE   = &#8220;currentcost.log&#8221;;  # file name to output to<br />
$PORT      = &#8220;/dev/ttyS0&#8243;; # port to watch</p>
<p># Serial Settings<br />
$ob = Device::SerialPort-&gt;new ($PORT) || die &#8220;Can&#8217;t Open $PORT: $!&#8221;;<br />
$ob-&gt;baudrate(2400)   || die &#8220;failed setting baudrate&#8221;; # set to 9600 if you have the newer version<br />
$ob-&gt;parity(&#8220;none&#8221;)    || die &#8220;failed setting parity&#8221;;<br />
$ob-&gt;databits(8)       || die &#8220;failed setting databits&#8221;;<br />
$ob-&gt;handshake(&#8220;none&#8221;) || die &#8220;failed setting handshake&#8221;;<br />
$ob-&gt;write_settings    || die &#8220;no settings&#8221;;</p>
<p># open the logfile, and Port<br />
open(LOG,&#8221;&gt;&gt;${LOGDIR}/${LOGFILE}&#8221;) || die &#8220;can&#8217;t open smdr file $LOGDIR/$LOGFILE for append: $SUB $!\n&#8221;;<br />
open(DEV, &#8220;&lt;$PORT&#8221;) || die &#8220;Cannot open $PORT: $_&#8221;;</p>
<p>select(LOG), $| = 1;      # set nonbufferd mode</p>
<p># Loop forver, logging data to the log file<br />
while($_ = ){        # print input device to file<br />
    print LOG $_;<br />
    print STDOUT $_;      # optional logging to STDOUT<br />
}<br />
undef $ob;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nick</title>
		<link>http://knolleary.net/2008/05/05/power-graphing/comment-page-1/#comment-11053</link>
		<dc:creator>nick</dc:creator>
		<pubDate>Fri, 01 Aug 2008 14:14:48 +0000</pubDate>
		<guid isPermaLink="false">http://knolleary.net/?p=157#comment-11053</guid>
		<description>@Christy - if you have something to suggest, feel free to post details here. Or you can send me the details directly to nol @ this site.</description>
		<content:encoded><![CDATA[<p>@Christy &#8211; if you have something to suggest, feel free to post details here. Or you can send me the details directly to nol @ this site.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christy Simmons</title>
		<link>http://knolleary.net/2008/05/05/power-graphing/comment-page-1/#comment-11052</link>
		<dc:creator>Christy Simmons</dc:creator>
		<pubDate>Fri, 01 Aug 2008 13:36:04 +0000</pubDate>
		<guid isPermaLink="false">http://knolleary.net/?p=157#comment-11052</guid>
		<description>Any way we can submit or suggest a great graphing tool to you? Please email me for more info..i have something that you might want to blog about!</description>
		<content:encoded><![CDATA[<p>Any way we can submit or suggest a great graphing tool to you? Please email me for more info..i have something that you might want to blog about!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Graham White: My Notes</title>
		<link>http://knolleary.net/2008/05/05/power-graphing/comment-page-1/#comment-11051</link>
		<dc:creator>Graham White: My Notes</dc:creator>
		<pubDate>Tue, 29 Jul 2008 15:31:52 +0000</pubDate>
		<guid isPermaLink="false">http://knolleary.net/?p=157#comment-11051</guid>
		<description>&lt;strong&gt;Graphing Current Cost...&lt;/strong&gt;

After hooking up my Current Cost Meter to a database recently I&#039;ve been logging my power usage so the next step is to look at what I can do with the data.  As I mentioned when I introduced my meter lo......</description>
		<content:encoded><![CDATA[<p><strong>Graphing Current Cost&#8230;</strong></p>
<p>After hooking up my Current Cost Meter to a database recently I&#8217;ve been logging my power usage so the next step is to look at what I can do with the data.  As I mentioned when I introduced my meter lo&#8230;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dale lane &#187; Blog Archive &#187; CurrentCost - getting the history into Windows</title>
		<link>http://knolleary.net/2008/05/05/power-graphing/comment-page-1/#comment-11011</link>
		<dc:creator>dale lane &#187; Blog Archive &#187; CurrentCost - getting the history into Windows</dc:creator>
		<pubDate>Sun, 15 Jun 2008 21:33:21 +0000</pubDate>
		<guid isPermaLink="false">http://knolleary.net/?p=157#comment-11011</guid>
		<description>[...] plan The more geeky amongst us have connected the CurrentCost to a server of some sort. By connecting it to something [...]</description>
		<content:encoded><![CDATA[<p>[...] plan The more geeky amongst us have connected the CurrentCost to a server of some sort. By connecting it to something [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Effing the Ineffable &#187; Interfacing the CurrentCost meter to your PC</title>
		<link>http://knolleary.net/2008/05/05/power-graphing/comment-page-1/#comment-11010</link>
		<dc:creator>Effing the Ineffable &#187; Interfacing the CurrentCost meter to your PC</dc:creator>
		<pubDate>Sun, 15 Jun 2008 16:54:06 +0000</pubDate>
		<guid isPermaLink="false">http://knolleary.net/?p=157#comment-11010</guid>
		<description>[...] a simple little gadget that measures power usage in your house. These are being discussed on IBM blogs everywhere, because while the device itself is very neat, it also has the ability to output the [...]</description>
		<content:encoded><![CDATA[<p>[...] a simple little gadget that measures power usage in your house. These are being discussed on IBM blogs everywhere, because while the device itself is very neat, it also has the ability to output the [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
