Tuesday, January 5, 2010

Using Google Visualization API for Power Monitoring

I just started playing around with the Visualization API today and it's pretty cool. Here's a short screencast I just did showing real-time power usage from our Brultech ECM-1240 power monitor. Every second, data from the ECM-1240 is stored in MySQL. The gauges are in a simple HTML page with a little AJAX to fetch the power data each second from MySQL. The API takes care of the graphics and updating them.


  1. Neat. Any code you could share about this? Have thought about doing a similar dashboard for data in a MySQL db..

  2. my AJAX code is really optimized for my setup and it'd be work to extract relevant parts, but there are lots of tutorials for using AJAX with mysql ( ie: http://www.w3schools.com/PHP/php_ajax_database.asp ). plus, the google api has lots of sample code.

  3. This is cool. I do want for my sensor network which I am building now to post directly to google appengine or spreadsheets.

    To comment on your demo - Not sure that the dials are the right widget for this kind of information. You are probably just experimenting with the widgets so no further comment neccessary.

    Anyway I am an Eventghost user. I do not yet use xPL because I think Eventghost does a lot of the things that I would use xPL for. Your posts do make me want to look at xPL though.

  4. i wanted real-time line charts like those in tomato router firmware ( http://bit.ly/7sYzba ). the google line charts didn't work out, but the gauges gave nice eye candy.

    EG has a lot of functionality and you could implement a lot of the google API stuff in python scripts since they offer a python SDK. xPL's main benefit, to me, is that it's a well defined protocol that lends itself well to a distributed type of control environment. EG is more centralized.

    feel free to stop by the xPL forums ( http://xplproject.org.uk/forums ) if you decide to give xPL a try.