As described in past articles, I use the Pachube online Database/Internet-Of-Things-Thingee to log data from Tweet-A-Watt and various other sensors. (It’s pronounced “Patch-bay”, apparently, but that won’t stop me from my thinking “Pa-Chew-Bee” every time I see the word. Feel free to join me.)
I like Pachube — it’s reliable, well-designed, well-documented, and very much open to hobbyists. They recently did away with paid plans and made all aspects of the site and service free, so I’d encourage you to give them a try. If you need help at getting your data into Pachube, see their Quick Start guide and Tutorials. My article on connecting Tweet-A-Watt to Pachube also contains some tips on getting started, and my article on the FEZ XBee Sensor shows an easy way to post data to Pachube from Python.
Pachube’s site provides a page for each of your feeds, showing a graph of the last 24 hours of readings from each of your datastreams. That’s good if you remember to go look at it, but I’d prefer that my graphs come to me, via a gadget on my iGoogle home page.
Pachube released a Google Gadget some time ago, and I’ve been using it for some time. It works well, but there are a few extra features that I really wanted:
- larger graphs, and the ability to resize the gadget container to see them
- a time axis in local time, rather than UTC
- the ability the set the timespan: 12 hours, 1 week, 1 month, etc.
- a Maximized view that shows the graphs in humongous GigaMegaSize
So, I’ve created a Google Gadget which adds these features, plus a few more.
You can grab the gadget from the Google Gadgets directory.
Settings
Here is a description of the various options available on the Edit Settings dialog.
Feed #: Numeric Pachube Feed ID
Datastreams: To graph all datastreams in the feed, leave this field blank. Otherwise, enter the datastream ID and click the Add button. For example, to add the 2 datastreams below…
…type Cactus, click Add, type CatGrass, click Add. The field should then look like this:
Time Span, Time Span Units – This determines what period of time will be graphed. As shown in the screenshot, the default is 24 hours. Time Span Units can be set to hours, days, weeks or months.
Show Status. If true, each graph will be preceded by a line of text giving the Datastream ID, the last reading and the date and time it was received, as shown in this screenshot.
Detailed Grid. If true, vertical and horizontal grid lines will be displayed, as in the 2 graphs above. If false, only a vertical grid separating each time span unit is displayed, as in the following (GigaMegaSized) graph.
Axis Labels: If true, numeric labels are added to the vertical and horizontal axis indicating the range of values. Note that, depending on the time span, these labels tend to overlap in a smaller graph (and I don’t have any control over the format of the labels). If false, the only labels are the minimum and maximum value of the vertical axis.
Graph Width and Graph Height: Determines the size of each graph, in pixels. When the gadget is maximized, both sizes are automatically doubled. These values are required, and are initially set to a width of 280 and a height of 100.
Gadget Height: Determines the height of the overall gadget, in pixels. If not specified, a default of 200 is used. (The gadget width can’t be set by the code, and varies depending on the browser type and the resolution of the monitor.)
Time zone: Your local time zone. The default is UTC (aka Greenwich Mean Time). This setting affects the timestamp in the Status field, as well as the labels on the horizontal axis of the grid. The rather eclectic collection of names in the dropdown lists was Pachube’s idea, not mine. (Look here if you don’t believe me!)
Wrapping Up
I’d welcome any bug reports or feature requests.
iGoogle’s Gadget framework does a lot of caching sleight-of-hand, so if you find that a change of settings doesn’t appear in the gadget, try refreshing the page. As for features , there are some things I can’t add because they aren’t supported by Pachube’s API yet (multiple datastreams in a graph, for example), but otherwise I’m open to suggestions.
For developers, I plan to write an article in the near future explaining the gadget’s use of the Pachube API.






When I view your Google widget it shows each graph has a title utilizing the datastream ID from Pachube. I have 2 other 3rd party apps that send data to Pachube using the datastream ID in numeric form. Is there any way your graph title can display the TAGS, UNITS or SYMBOL from Pachube?
Yes, that’s a good idea, and it should be easy to implement: the tags, units and symbol are all returned by Pachube’s Feeds API. I’ll add this to my To Do list.
Dan.