C-Aware Project Wiki

Joule

From C-Aware Project Wiki

Jump to: navigation, search

< Main Page


Joule is a collection of scripts and a HTML Web App to record and visualise the energy use of a collection of sensors, currently the sensors within the William Gates Building at The University of Cambridge. It provides a tool to explore a tree of sensors, drill down to interesting areas based on geography or energy use such as lighting or server power, and plot charts over a range of time periods, helping to identify both short and long term patterns.

The web app can be found on the Computer Laboratory Meters page.


Contents

Using Joule

The main interface to the electricity data we collect is the Joule Web App, which is designed to be used to explore, identify and compare the energy consumption throughout the building, either to aid in the running of the building or to inform the occupants.

The presentation is based on two tree structures: functional and geographic. The same data is presented, only the organisation is different. Clicking on a triangle will expand the tree, exploring by geography or function depending on which is selected. Clicking a square will show the graph for a specific sensor, and clicking a circle will show the graph for the sum of sensors in that section.

Dragging the blue selection box on the lower chart will zoom the time scale for selected data in the chart view, and clicking the blue triangle in the lower left corner expands the time period into the past by one month increments.

The tabs along the top change the information displayed. The 'Stacked' visualisation uses a similar presentation but is used to give an easier to understand overview of which circuits make up the majority of the energy consumption. 'Sensor Info' presents a table of all currently used sensors, when their data was last updated etc. This also provides statistics on the number of erroneous readings that have been automatically detected by the data processing scripts.


Joule Maintenance and Development

Web App

To present the data captured by the metering hardware installed into the Computer Lab, we created an app to visualise the energy data of the building. The app presents a hierarchical view of the sensors in the building in both a functional and geographic tree, and allows the user to plot data from individual or groups of sensors, for example; to compare the lighting between corridors, or to find the biggest use of energy by room.

More info...

Data Collection

To capture electricity use within the computer lab, we have installed high accuracy electricty monitors on main circuits within the building, and use USB Current clamps to monitor additional sub circuits. This information is logged and stored, for use with the web application.

More info...

Index Generation

The web app relies on an index file to identify the location of the most recent JSON files for each sensor. This index is currently generated using the index generator script in the scripts directory, as seen at https://github.com/caware/c-vis/tree/master/scripts . Running python indexgenerator.py will give an output describing how to use the script, or you can use / edit the generateindex.sh script to simplify this process.

Joule Dependencies

The Joule web app depends on a few files and layout options as it stands within the Computer Lab, but is built to be flexible and used in different settings. As discussed in Joule web App the webapp itself requires access to a config file which points to a further two files, an error report and an index of sensors. A normal static file serving webserver is all that is needed to host the app, the configuration files and the energy data.

Joule @ the CL

There is little that is exclusive to the CL installation of Joule that should not be very similar in other installations. There are some custom scripts that gather the data from the metering hardware used within the lab. However after these have run and processed that data into the JSON file format, documented on the C-Aware API page Joule is able to access and display this data without any further modification.

There are two configuration options that are set in the config.json file first loaded by the app, which allow certain sensors to behave differently within the meter tree. These can been seen for reference at http://www.cl.cam.ac.uk/meters/tools/wgb-vis/configs/config.json

  • sensorIgnore is used to prevent any sensor from being used in any calculations or showing up in the meter tree. Currently the lab does not ignore any sensors.
  • sensorNoAverage is used for sensors that are below another sensor, that is the sensors energy reading is already measure further up the tree by another sensor. These sensors are thus not used for calculating summing averages. Currently the lab excludes one sensor from this.

Joule in Other Locations

As discussed previously, all that is needed to host the Joule webapp is a static file web server. This is used to serve the application, as well as the configuration, index and error report files, and the energy data JSON files.

The selection of monitoring infrastructure for a particular situation is rather outside the scope of this document, however the chosen hardware should be able to be interfaced with programatically, and a set of JSON data files created from this interface which conform to the C-Aware JSON API. The helper scripts included in the GitHub Repository should be run over these files every time the data contained within them changes, which will keep the index files upto date, and allow the web app access to the latest information.