Skip to content
Daemon that listens for data from a current cost device, stores it in a rrd database, and can also optionally serve a dynamic webpage to allow easy viewing.
Python Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
wwwroot/static
.bzrignore
README
currentcostd-generate-graphs.sh
currentcostd.py
init.d.currentcostd.sh

README

currentcostd is a python based daemon designed to listen to the output from the currentcost devices, and then store the corresponding data in an RRD database.

The daemon can currently:
  * Switch user
  * Run the foreground for debugging purposes
  * Runs an optional, basic, HTTP server where you can see the current power and temperature, and serve static files (Note, static files are very badly done and is probably exploitable at this point - just needed something working here for a demo)
  * Uses a template file to build the web based UI

Rather than make the daemon generate graphs I've currently resorted to a shell script and rrdtool on a cronjob.

ToDos:
  * Make the HTTP server less crap
  * More error checking

Issues:
  * It doesn't understand multiple sensors
  * Error checking is barely there
  * Not smart enough to know when its not getting data and take the necessary steps
  * The code is probably pretty poor. My excuse is that python makes me angry and this was an attempt to see if I could live with it.

At present it depends on:
  * pyserial
  * python-rrdtool

Thanks go out to to the following guys who have done the majority of the leg work already:
  * Paul Mutton (http://www.jibble.org/currentcost/)
  * Everyone involved with the currentcost project at code.google.com (http://code.google.com/p/currentcost/)
  * James Smith (http://www.ibm.com/developerworks/xml/tutorials/x-ameetut/)
  * "histori1" (http://forum.makehistori.com/index.php?topic=688.0)
Something went wrong with that request. Please try again.