Posts Tagged ‘currentcost’

CurrentCost app … take 2!

Saturday, August 30th, 2008

a Python CurrentCost appI’ve been talking about it for a while, but I finally got around to spending some time working on a CurrentCost app.

The original code was written in C# using .NET 3.5, and I used WPF (Windows Presentation Foundation) to draw the graphs. For a number of reasons this proved unpopular and I got a ton of emails saying how this was no good for them. So I decided to start again.

The new app is written in Python – using wxPython and matplotlib to create the graphs.

a Python CurrentCost appUsing py2exe, I’ve been able to compile the whole thing (combining my script with a Python interpreter and a copy of all of the third-party libraries I’ve used) into a Windows executable that will (hopefully!) run on any Windows computer, without needing installing or requiring any pre-requisites.

I can also make the Python script itself available, making it something that Linux users could run as well. This means I get the low-overhead Windows experience I wanted, together with the ability to make it cross-platform. Neat!

I’ve been able to produce some more interactive graphs – the graphs in the new app can be zoomed in and out, panned, moved around, printed, and exported to images. As the amount of data in the app builds up, I can see this becoming very useful.

(more…)

Revisiting a Windows GUI for CurrentCost

Monday, July 28th, 2008

tweaking the CurrentCost GUII spent a couple of evenings last month knocking together a quick example of a Windows GUI for the data you get from CurrentCost home electricity use monitors. And then promptly put it to one side and kinda forgot about it.

As a quick recap, I created a Windows app which grabbed the history data from the CurrentCost serial output, and drew a few bar graphs from it – to represent the hours, days, and months data. The app also persisted the history data in the user’s “Application Data” folder, so that older data is kept by the GUI even after it is lost by the CurrentCost meter itself.

I’m thinking about picking it up again, so spent a bit of time idea-storming what I could do with the code. These aren’t all my own ideas – they’re a random collection of ideas and notes taken from discussions with others. I’m posting them here for feedback – new ideas are welcome, as are comments on the usefulness of the stuff I’ve suggested.

(more…)

Our Mashed 08 hack: CurrentCost Live

Monday, June 23rd, 2008

Yesterday was the end of Mashed 08 – the annual London hackday from BBC Backstage.

I saw last week that there was going to be a “social responsibility” category in the hack challenge, and decided that a CurrentCost hack was in order!

Together with Rich, we spent a day trying to hack together a competitive challenge based around CurrentCost, encouraging people to reduce their home electricity usage by making it into a game they can play with their friends.

Here are a few notes based on the presentation I gave at the end.

(more…)

Haven’t we aged well?

Monday, June 23rd, 2008

I’ll write a proper post about Mashed08 once I’ve caught up with work, but in the meantime I wanted to quickly share a couple of pics.

Sylvester McCoy was on stage as compere for the presentation of our hacks, and each of us who presented got to meet him briefly for a pic. This was actually the second time I’ve met him – fourteen years ago, I got to meet him with a couple of others from my school when we won an award for an environmental project at school.

There’s a nice symmetry there… meeting him aged 14 to collect a prize for a environmental project, then aged 28 to collect a prize for a project to help people reduce home electricity usage. Wonder what will happen when I’m 42? 🙂

Before (December 1994)
meeting Doctor Who

After (June 2008)
meeting Doctor Who again!

Tweaking the CurrentCost app

Monday, June 16th, 2008

tweaking the CurrentCost GUI

I spent a bit of tonight tweaking last night’s CurrentCost app.

Not a lot to say about it, as it’s more or less the same as it was last night…

(more…)

CurrentCost – getting the history into Windows

Sunday, June 15th, 2008

The CurrentCost meter has been ignored of late as I’ve been a bit busy with other things. Tonight, I started playing with it again.

The plan
The more geeky amongst us have connected the CurrentCost to a server of some sort. By connecting it to something that’s always on, we can collect a history one reading at a time. But what about people without a server? How can they collect history?

As Rich highlighted in his post on the CurrentCost XML output, the CurrentCost meter maintains some running totals in flash memory, and these are included with updates for every reading from the device.

It maintains:

  • totals for each two-hour block for the last day
  • totals for each day for the last 31 days
  • totals for each month for the last 12 months
  • totals for each year for the last 4 years

This means that if you store and aggregate these history totals, you can connect the meter to a computer periodically and still get reasonable CurrentCost readings history.

  • connect at least once every 26 hours to maintain the two-hourly history
  • connect at least once every 31 days to maintain the daily history
  • connect at least once a year to maintain the monthly history
  • connect at least once every four years to maintain the yearly history

Okay, so the two-hourly history might be a bit much, but the others all seem reasonable, even for non-geeks!

So, the plan is to write a simple Windows application that a user could periodically link to a laptop or computer that will collect CurrentCost readings and aggregate them into history data. And ideally then display them in a pretty way

(Not my plan, incidentally, but rather one that I nicked from Andy. Still, if you’re gonna nick ideas, there are worse places to start… 🙂 )

This is what I’ve got so far…

the start of a CurrentCost GUI

(more…)

CurrentCost hacking – starting to identify appliance power usage

Tuesday, June 3rd, 2008

I needed a break from work tonight, so went back to playing with the CurrentCost meter – a chance to try a few new things.

The objective
I want to make a start on identifying how much electricity different things in my house use. To begin, I’m going to start with a very manual user-driven approach:

Subscribe to updates from the CurrentCost meter, and when a significant change in usage occurs, ask me what I’ve just switched on or off, and collect that information to build up a record of how much electricity different devices use.

How?
It’s already quite late, so I just wanted to hack a quick first version together. I decided to write it as a small Java app.

As I’ve mentioned before, I’m publishing the CurrentCost readings to a small broker running on my home server. The plan was to write a Java application that uses MQTT to subscribe to updates from the broker.

Why? Because I’ve not used Java on the Slug before, or with MQTT. (Is that not a good enough reason? 🙂 )

I’ve written it as a command-line app, because it’s a quick way to run it from different devices around the house. (That is, by cheating 🙂 I’m actually running the app on the home server, using PuTTY / PocketPuTTY / SSH etc. to run it from my ThinkPad, PDAs, mobile, EEE PC, etc.).

(more…)

A daily CurrentCost “bill”

Wednesday, May 28th, 2008

As I’ve finally got my home server capturing the electric meter readings from the CurrentCost, I thought it’d be good to try doing something with it.

I want to start with something a bit different to graphs, because there’s already been a lot of cool work done in different graphing approaches.

As I wrote yesterday, I’ve got a MySQL database that is storing the watt reading from the electric meter captured once every six seconds.

I wondered whether it makes sense to try and turn these figures into a financial cost. It might be interesting (and useful as a behaviour-altering thing) if we could get a “bill” from the CurrentCost meter each day that told us how much we spent on electricity the last day.

+=============================================+
  Your CurrentCost bill for 2008-5-27

     Electricity usage   4.9802 units
      Cost ==           £0.4874

     Standing charge    £0.1582
   ---------------------------------------
     TOTAL COST FOR 2008-5-27 : £  0.65
+=============================================+

I’m not entirely sure of my maths here, but I thought it could be interesting to give it a try.

(more…)