The lost outpost

Current Cost monitoring from an iPhone

December 11, 2008 · 15 Comments

For a while now I’ve wanted to be able to check my CurrentCost meter’s graphs on my iPhone.

Up until now I’ve been hooked up to the “Hursley mothership” and been publishing my data to a central dashboard. Unfortunately, although that draws some pretty graphs, it runs in Java and therefore isn’t supported in Mobile Safari on the phone.

This is still a work in progress, but with a combination of Ubuntu running on a Viglen MPC-L, rrdtool for gathering and graphing the stats, and the iWebKit framework for creating the user interface, I now have a simple iPhone-optimised web application which lets me view the graphs. All that’s happening here is that the data from the serial port is being dropped into rrdtool and graphs generated; and then Apache / PHP is serving up an optimised dashboard for looking at the graphs.

I just mentioned about three different topics I really should blog about in more detail (MPC-L, rrdtool, and iWebKit) but that will all have to wait.

Categories: 24924
Tagged: , ,

15 responses so far ↓

  • Current Cost monitoring from an iPhone | PHP-Blog.com // December 12, 2008 at 3:58 | Reply

    [...] rest is here: Current Cost monitoring from an iPhone Related ArticlesBookmarksTags Commentaires sur Menu HTML et CSS, sliding doors et item [...]

  • UgoTrade » Blog Archive » Smart Planet:Interview with Andy Stanford-Clark // December 15, 2008 at 18:14 | Reply

    [...] HomeCamp ‘08 was organized by Chris Dalby and Dale Lane and sponsored by Current Cost and Redmonk. A video of Andy Stanford-Clark’s talk, by Andy Piper, is up on Viddler. Also see Andy Piper’s post abut CurrentCost meters and most recently about running his CurrentCost meter’s graphs on his iphone. [...]

  • Richard // January 5, 2009 at 13:27 | Reply

    Nicely done, I like it. Now if current cost would produce a meter that pushed your data to the net, then we all could use something like this or even a native iPhone app.

    Well done.

  • Mark // January 19, 2009 at 23:13 | Reply

    Hi

    Thanks for this information it is fascinating. I have been looking for a way to monitor my home power usage in automated way for a while now. I have been using an Efergy meter for a year now and manually recording the figures and only just found the Current Cost devices.

    I was going to use the website below to publish the figures from my CC. However the system would have relied on one of my Macs being on all the time. This system is much more efficient and more personal.
    http://community.pachube.com/?q=node/100

    Any chance of releasing the code that creates the pages?

    Mark

  • Fernando // January 22, 2009 at 6:36 | Reply

    Thanks for the article. I have a buddy that loads and runs everything on linux. I wonder if he would attempt the iPhone Linux-flavor…he might be able to run everything off of that thing. Great little gadget.

    The iPhone Source

  • Andy Piper // January 23, 2009 at 9:13 | Reply

    Fernando – no, you wouldn’t be able to run this on iPhone/Linux… as you wouldn’t physically be able to connect the CurrentCost meter to it.

    Mark – thanks for your interest. Lots of folks are using Pachube with their CC meters now (which actually fulfils Richard’s idea, as it means the data is pushed to the cloud). However, my app isn’t going to prevent you from needing an always-on machine… the CC is connected to a small low-power Linux box (Viglen MPC-L) which pulling the data from the serial port and using MQTT/Really Small Message Broker to publish the data, with rrdtool storing and graphing it.

    As for releasing the code… it’s a mess of scripts somewhat similar to the technique described at http://www.jibble.org/currentcost/ but using iWebkit for the display of the graphs. I might well post the HTML/PHP pages somewhere at some point, as a few people have asked… it’s nothing very complex. No time at the moment though :-/

  • Mark // January 23, 2009 at 20:54 | Reply

    Hi

    I have got my CurrentCost working and creating graphs under one my Ubuntu virtual PCs. There does not seem to be a version of rrdtool for Mac OS X, and I am not yet confident to compile one. I have a MPC-L on order!

    Mark

  • TwtrCtr - Tracking Twitter followers with an iPhone « The lost outpost // January 28, 2009 at 17:36 | Reply

    [...] on my previous experience of using the iWebkit framework to build an iPhone-optimised web wrapper for the …, I thought it might be interesting to play around with using iWebkit to display the TwitterCounter [...]

  • Mark // February 8, 2009 at 15:23 | Reply

    Hi

    My MPC-L turned up on Friday. I have just got my CurrentCost working displaying graphs via a webpage designed for the iPhone.

    http://metphoto.homeunix.net/met_current/index.html

    Now I just need to work out to set up cron to auto update the graphs!

    Thanks for all the advice and information.
    Mar

  • Andy Piper // February 9, 2009 at 9:35 | Reply

    Mark, nice work. Suggestion – set the width=100% attribute on your graph pages and the images should auto-size to the iPhone screen, I think they crop at the moment. I actually have one of the original CC meters and haven’t got history or temperature data on my app yet but since I have a CC128 I ought to get that set up.

  • Denver PC Guy // February 11, 2009 at 20:25 | Reply

    This would be great to monitor current costs while Im out in the field directly from my iphone. I could see this as being a major help.

    JOHN

  • Experiments with PHP and MQTT « The lost outpost // February 20, 2009 at 14:14 | Reply

    [...] PHP. There are a couple of reasons for this, but the primary one is that I’d like to extend my prototype iPhone CurrentCost monitoring web application to display more up-to-date information about the state of my home energy usage. I’d planned [...]

  • Blue Fusion, the 2009 edition « The lost outpost // March 10, 2009 at 10:22 | Reply

    [...] my home power monitoring [...]

  • Colin Partridge // March 23, 2009 at 11:10 | Reply

    Inspired by this blog and also the code on jibble.org I’ve managed to get my Current Cost metering data online, here.. http://www.halfmanhalfmac.co.uk/page9/page9.html

    The machine running this is an old Mac-mini running OS X.

    Cheers Colin

  • IMPACT – work, play, product announcements « The lost outpost // May 5, 2009 at 15:49 | Reply

    [...] talk about green IT, which connects with my interest in energy monitoring and Home [...]

Leave a Comment