JSON/REST API released

Flukso announces the immediate availability of its JSON/REST API at the 2010 CeBit exhibition in Hannover. Fluksonians are now able to retrieve time series data of their electricity sensors through the Flukso API. Let's start with a working example:

curl -k -v -X GET -H "Accept: application/json" -H "X-Version: 1.0"
-H "X-Token: d8a8ab8893ea73f768b66b45234b5c3a"
"https://api.flukso.net/sensor/c1411c6b4f9910bbbab09f145f8533b9?interval=hour&unit=watt"

Where:

  • X-Version: Denotes the desired API version. Should be set to 1.0.
  • X-Token: A token associated with the specific sensor id. Different tokens per sensor will allow for varying access permissions, e.g. only allow data in 'month' resolution. This feature will become available in the near future. We now provision a single token per sensor. The token can be found next to its respective sensor id (see below).
  • Sensor: Your sensor id's are displayed under the 'my account' -> 'sensor' tab. Just substitute the above sensor id and token with your own and you're ready to go.
  • Interval: Should be one of {hour, day, month, year, night}
  • Unit: Should be one of {watt, kwhperyear, eurperyear, audperyear}

Data is returned as an array of [unix timestamp, value] tuples, where value will be reported as a "nan" string when no data is available for the interval.

[[1267802160,69], [1267802220,69], [1267802280,73], ... , [1267805760,"nan"]]

The unix timestamp denotes the end of the interval for which the value is reported. So in the above example [1267802220,69] means that in the one-minute interval [1267802160, 1267802220] 69 watts of electricity has been consumed.

Thanks to Geert and Mathias for their valuable feedback during alpha testing.

Have fun!

Update 15/03/10: Added info on where to retrieve token information.

Old vs new fridge

During my quest to reduce our household's electricity consumption, I noticed that our 20-year-old fridge's compressor seemed to be running quasi continuously. As this was a rather clear indication of an inefficient appliance, we decided to swap it out for a new one. I somehow managed to convince my wife to postpone our purchase by a few weeks so that I could hook up a Fluksometer to the old fridge. I also monitored the new fridge to do some benchmarking. In a previous post I already mentioned that we were able to reduce our average nighttime electricity consumption from 130 watts to around 80 watts by swapping this 20-year-old fridge for an new 'A' labeled one. Here's a more detailed chart displaying the collected data over a 24h period.

You can clearly see the old fridge having only four cooling cycles during this particular day, lasting between two to four hours each and consuming approx. 140 watts peak. The new fridge's data shows a more repetitive pattern with one to two, shorter cooling cycles per hour and power consumption mostly well below 60 watts. Extrapolating these measurements to a full year would result in our old fridge consuming 671kWh/year while our new one will only draw 161kWh/year! Money-wise this translates into running costs of 120EUR/year and 30EUR/year, respectively. This means our new fridge will have a payback period of less than four years.

This benchmarking exercise once again shows that negawatts, electricity that isn't created due to energy efficiency, can contribute significantly towards a greener life. In this specific case it doesn't require any behavioural change in our household whatsoever. With the new fridge in place we expect our five-person household to draw less than 2000kWh in 2010.

mySmartGrid

A few months ago we were contacted by Mathias Dalheimer a.k.a. gonium of Fraunhofer ITWM in Kaiserslautern. He told us they were planning to implement and trial a demand-side management platform. Unlike other initiatives in this domain, they want this platform to be based on open-source components to facilitate a bottom-up movement in energy management. Hence the mySmartGrid project name. People attending the Flukso talk at FOSDEM X have already received an introduction to mySmartGrid by Mathias. Here's a summary of what was said during the talk:

Flukso at FOSDEM 10

Our Flukso talk at FOSDEM '10 was very well received. We got tons of questions after the presentation. This constitutes a clear proof that the topic of energy and resource efficiency is a very live and pressing one. In case we weren't able to answer your specific question on Saturday, please feel free to contact us via mail or in the comments. The slides of the Flukso presentation can be downloaded here.

A New Year - A New Server

Last night we migrated the Flukso platform to a Linode VPS. The change should have rippled through the DNS hierarchy by now. Should you experience any connection problems with the Fluksometer then try to resolve it by resetting your broadband router first.

The site should be a lot snappier because of the new hardware. We've also taken the opportunity to change some of the platform's components. As can be seen in the architecture slide, Apache and mod_php have been substituted by Nginx and PHP-FPM. Our first experiences with Nginx have been very positive. It's stable, uses RAM sparingly and serves static content blindingly fast. We're also using it as a reverse-proxy to our Webmachine-based JSON/REST API. More about that in a later post.

Jon Gilkison's post on Nginx and PHP-FPM has been a great help for setting up the new server. Thanks!