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.