Tweet-a-watt Tweet-a-Watt + Google Powermeter!
Intro

Once you have the Tweet-a-Watt working with the python scripts, we can add a cool extension and have beautiful graphs generated thanks to Google Powermeter!

This code, based on the original T-a-W, was created by the super-rad Devlin Thyne! You can download it from our source repository on github which now includes this script

Please note that this mod is new, and is still under development, if you are having difficulties, try posting to the forums.

Right now its only tested to work with a single T-a-W!

Log in + Activate

Visit http://www.google.com/powermeter/about/ and log in with your google account

Next, go to https://www.google.com/powermeter/device/activate?mfg=Adafruit&model=Tweet_a_Watt&did=AF000002&cvars=0&dvars=1

To activate your Tweet-a-Watt

Once you activate, you'll get a chunk of text in a box. Copy and paste this into a text file to save it

Out of this text, there are two things we need, the token and the path. The token is between the text token= and the next &. The path is everything after path=.

hash=0123456789abcdef0123456789abcdef,0123456789abcdef0123456789abcdef,0123456789abcdef0123456789abcdef&token=ABCdefGHI-_JkLMNoP&path=/user/0123456789123456/7891234567819/variable/Adafruit.Tweet_a_Watt.AF000002

So in this case, the token is ABCdefGHI-_JkLMNoP and the path is /user/0123456789123456/7891234567819/variable/Adafruit.Tweet_a_Watt.AF000002

Save this in a text file, you'll need it for the next step!

Python code

Download the Google Powermeter python API scripts and place all the files in the same directory as the Wattcher.py scripts.

Now edit gmeter-wattcher.py to have the correct COM/Serial port and calibration data that you figured out in the previous steps. Also, find the two lines

#Google PowerMeter stuff:
powerMeterToken = "paste your token info here"
powerMeterPath = "paste your path info here"

Edit them so that the token and path you got from google go in between the quotes. If you want lots of data spit out, edit

QUIET = True

To be False

Save gmeter-wattcher.py, Open up a command line as before and go to the wattcher directory and run python gmeter-wattcher.py after a few minutes you shoould see data sent to google:

Now go back to your browser and click on "Check for measurements again"

Success!

Widgetty

Now we can get the graphs, Click "Add Powermeter to iGoogle"

And then, of course, the big shiny blue button

Now you gots widgets!

 

May 17, 2011 20:07