Tag Archives: currentcost

Current Cost update

After a few weeks away, I’ve had another fiddle with the Python scripts I run to graph data from my Current Cost meter. You can see the results here.

Of note, I’ve switched from using the Google Graphs API to RRDTool. This is for two reasons – the Google graphs API just seemed a bit fiddly, even using PyGoogleChart, and rrdtool graphs just seem pretty easy to output. In addition, it means I get averaging for free and don’t have to manage the database.

I’m still using the Python I tweaked from Dale Lane, but I created an RRD based on Paul Mutton’s guidance and update it using a Python module for RRD from Corey Goldberg. Feel free to ask for a copy of the scripts.

For some reason my sqlite db update script liked to bomb out after a couple of hours, but this seems to be working fine and has been gathering data reliably for the last few days.

Of course the whole point of this isn’t just to make pretty graphs, but to try and do something about our consumption. I’m already obsessing about the graphs produced, and they’re making it easy to see when something’s left on – our ‘base load’ seems to be about 200W, so anything more than this means something’s on somewhere.

Our most obvious heavy power usage is the oven, at about 3kW, but there’s not much I can do about that other than cook more with gas  – or eat more salad! It’s generally not on for long, so not the end of the world. Interestingly, the oven seems to heat up in under 10 minutes (solid power use, followed by intermittent bursts to keep it hot). I’d always assumed this to be longer, so that’ll save some time and money!

I’m also quite conscious of the fact we sit in the living room with a few 60W lights on in the evening for quite some time. They’re on dimmer switches so I’m now hunting for dimmable CFLs. The Megaman bulbs seem to come quite highly rated, but I’m not really sure how good they are. If anyone’s readig this and has some insight, feel free to leave a comment!

My next plan with the graphs is to work on aggregating daily/weekly data to show trending totals and ignore the short-term fluctuations, so that I can see how things are improving. When I get some time at home to myself I’m going to try and work out exactly where the 200W base load is going (NAS, router and Sky are the key candidates) and see if I can get it lower.

Real-time-ish Current Cost graphing

Since installing my Current Cost meter, I managed to get Dale‘s graphing app up and running fairly quickly. Since then, I’ve progressed a bit with my own Python.

The scripts are fairly thrown together as I’ve waded my way through various Python documentation, and the sqlite and Google Chart API modules, but I’ve managed to get some initial graphing up and running, which you can find on the Current Cost tab (or click here).

The graphs should update every couple of minutes, and so far show power usage & temperature readings for the last 15 minutes, and last hour. To get these working, I have a script which listens continually for the output from the CC128 and stores it into a sqlite database. There’s a second script which reads this database and makes calls to the Google charting API, generates PNG files and then pushes those up to my blog host.

I’d like to get 6-hourly, daily and weekly graphs, but these will require a bit more fiddling as the data needs aggregating before passing to the chart API. I suspect it’ll be a few weeks before I have the time to get that working… Likewise the graphs need a bit of tidying up (better axes, labels, etc).

In the unlikely event that anyone’s interested in the Python scripts to do this, either leave a comment in this post or drop me a mail.

My first electricity graph

…almost. I’ve mentioned before how I’ve been reading my electricity and gas meters every four weeks or so, which gives a rough approximation of how much we’re consuming in our house.

I’ve got my Current Cost meter up and running with Dale Lane‘s Python app. This was ever-so-slightly fiddly, so I thought I’d add my voice to those already out there with some step-by-step instructions for OS X users.

  1. Get a Current Cost meter
  2. Order the USB serial lead
  3. Install the drivers for said lead – this creates a new device
  4. Install the Apple Developer Tools
  5. Download the Python source for Dale’s app
  6. Follow the prerequisite list
  7. Install MacPorts
  8. Rebuild SQLite (run sudo port install sqlite3 +loadable_extensions from an XTerm)
  9. Export the DYLD_LIBRARY_PATH (for me this was export DYLD_LIBRARY_PATH=/opt/local/lib)
  10. Run the app – python currentcost.py

Not too bad, and you should get a nice pretty graph, like so:

Next up, I’m going to be taking the real-time data into a database and trying my own bit of graphing.

Current Cost

My Current Cost CC128 arrived yesterday, an eagerly awaited treat after my day at Home Camp ’08.

It’s already producing surprising data – when I got up this morning, the house seemed to have an ‘ambient’ power consumption of 278 watts, which seems pretty high, but I think the boiler was whirring away at the time.

As I sit here, with some lights on and various other bits and pieces, it’s reporting 674W, or £2.26/day at this rate of consumption.

The real value of the Current Cost though is the cable for attaching to a PC, so you can capture and report on the data. Not being too much of a coder, it’s going to be a bit of an adventure – the CC just outputs chunks of XML every 6 seconds, but handily there’s tons of good work out there to ‘borrow’.

I’m hoping to produce some graphs a bit like these, or even better make the lights on Corneliuss, my Nabaztag light up according to how much we’re using!