Posts Tagged ‘serial’

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…)