call us: +44 (0)208 686 6372
20 Apr 2011

Real time data with Pachube using TCP stream

We have just released a gem (Ruby plugin) which uses the new beta Pachube TCP stream using Eventmachine.

The Gem is available on the Carbon Calculated github here: https://github.com/carboncalculated/pachube-stream

Pachube allows you to manage and sensor realtime data such as electricity, and have recently partnered with CurrentCost acting as the data store for the CurrentCost web bridge.

Our gem allows a Ruby developer to access their own or publically available data streams from pachube and consume the data inside their own applications. Here at CarbonCalculated we are using the Pachube Stream gem to enable realtime monitoring of electricity, gas and water consumption and related carbon emissions across our range of products. This means there is no longer a need to import gas, electricty or water bills, simply fit a web enabled meter and add the readings from the device straight into your companies carbon footprint!

To get started with the gem, read the documentation on github and have a look at the examples here: https://github.com/carboncalculated/pachube-stream/tree/master/examples

The pachube gem is open source and therefore pull requests are very much welcome!

5 Apr 2011

Electricity Bill Carbon Calculator - An adventure into sproutcore

We at Carbon Calculated always look at the advances in technology and how we can use them for developing new application for carbon calculation.

We have been experimenting with Sproutcore (Javascript MVC framework) recently and have knocked up a quick example application:

Screen_shot_2011-04-05_at_19

Electricity Carbon Calculator example app

and the code for this is open source and availble here:

https://github.com/carboncalculated/electric-bill-carbon-calculator-sproutcore

This shows how quick and easy Sproutcore and the Carbon Calculated API are to use.

 

29 Sep 2010

New Carbon Calculated Browser

A new version of the browser has been released; we now handle displaying the source information ourselves via a content management system;

We have also updated the browser to indicate a link to our QA applications; As we are a firm believer in transparent data and calculations; anyone can verify and question the results that are gained from our platform, a true open source data provider for carbon calculations!!…. Yes thats what we are!

Admin

12 Aug 2010

Open Source Applications using the Carbon Calculated Gem

We have just release first in a series of open source applications to help developers get a better understanding of the carbon calculated platform.

Rails3

The application is in Rails3 and uses the calculated gem

Application

You can find the application here

Gem

You can find the gem here

12 Jul 2010

Calculators and Original Features (you saw it here first!)

Just thought I would give a quick outline of the features that we released form day 1 of the platforms release; and also the power of having validations at the CORE of our calculators; and what this means to developers.

Greenhouse gases

From the first release of the API we have supported other Greenhouse gases (CH4, N20, CO2E, indirect CO2E, direct CO2E, direct CO2, indirect CO2) besides CO2.

This can be shown here on the browser

This rich calculation information can really help if you need to build an application for the CDP (carbon disclosure project) for instance

Information When Calculating

When you ask for a result from the platform it well tell you what is used in its calculation; This enables the developer to use these results for all kinds of possibilities. To Show a quick example of this lets get an emission result for traveling by plane from Heathrow to JFK

Path

/calculators/4bab7e17f78b122cdd000001/answer.json?api_key=your_api_key&transport_type=4bd5cb38dfde7b12560033db&transport=4bd5cb39dfde7b12560033ff&no_of_journeys=1&no_of_people=1&formula_input_name=per_passenger_km&origin=4b83f9af0e61b2220d00538d&destination=4b83f9db0e61b2220d005faa

If you do not understand this request please look at the API documentation; however going to the browser may help to understand the parameters that will be sent

This request returns the following result

{"calculations":{"co2":{"value":681.049338,"units":"kg"},"n2o":{"value":6.676954,"units":"kg CO2e"},"ch4":{"value":0.0607,"units":"kg CO2e"},"co2e":{"value":687.786992,"units":"kg"}},"answer_set_id":"4bd5cb3bdfde7b125600377f","source":{"id":"4ca48e57fd516d1b5b000014","description":"","main_source_ids":["4bebea80dfde7b477d000008"],"external_url":"http://miniapps.carboncalculated.com/journey/calculation/answers/new","wave_id":"me9YDh_mC"},"calculator_id":"4bab7e17f78b122cdd000001","computation_id":"4bcc683e1076f1533f000001","object_references":{"4b83f9af0e61b2220d00538d":{"id":"4b83f9af0e61b2220d00538d","template_name":"airport","characteristics":[{"attribute":"label","value":"United Kingdom, London - LGW","units":null,"value_type":"String","id":null},{"attribute":"airport_name","value":"London - LGW","units":null,"value_type":"String","id":null},{"attribute":"latitude","value":"51.15","units":null,"value_type":"Float","id":null},{"attribute":"longitude","value":"-0.19","units":null,"value_type":"Float","id":null},{"attribute":"iata_code","value":"LGW","units":null,"value_type":"String","id":null},{"attribute":"airport","value":"Gatwick","units":null,"value_type":"String","id":null},{"attribute":"country","value":"United Kingdom","units":null,"value_type":"String","id":null}],"formula_inputs":[],"identifier":"United Kingdom, London - LGW - Gatwick"},"4b83f9db0e61b2220d005faa":{"id":"4b83f9db0e61b2220d005faa","template_name":"airport","characteristics":[{"attribute":"label","value":"United States, New York - JFK","units":null,"value_type":"String","id":null},{"attribute":"airport_name","value":"New York - JFK","units":null,"value_type":"String","id":null},{"attribute":"latitude","value":"40.64","units":null,"value_type":"Float","id":null},{"attribute":"longitude","value":"-73.78","units":null,"value_type":"Float","id":null},{"attribute":"iata_code","value":"JFK","units":null,"value_type":"String","id":null},{"attribute":"airport","value":"John F Kennedy International","units":null,"value_type":"String","id":null},{"attribute":"country","value":"United States","units":null,"value_type":"String","id":null}],"formula_inputs":[],"identifier":"United States, New York - JFK - John F Kennedy International"},"4bd5cb39dfde7b12560033ff":{"id":"4bd5cb39dfde7b12560033ff","template_name":"transport","characteristics":[{"attribute":"label","value":"Long Haul International - Average","units":null,"value_type":"String","id":"4bd5cb39dfde7b1256003400"},{"attribute":"transport_type","value":"plane","units":null,"value_type":"String","id":"4bd5cb39dfde7b1256003401"},{"attribute":"flight_length","value":"Long-haul international","units":null,"value_type":"String","id":"4bd5cb39dfde7b1256003404"},{"attribute":"travel_class","value":"Average","units":null,"value_type":"String","id":"4bd5cb39dfde7b1256003405"}],"formula_inputs":[{"model_state":"active","name":"per_passenger_km","group_name":null,"values":{"km_uplift_factor":1.09,"co2":0.1122,"ch4":1.0e-05,"n2o":0.0011,"co2e":0.11331},"active_at":"2010-04-26T17:19:50Z","input_units":"km","label_input_units":"km per passenger","main_source_id":null,"source":null,"id":null}],"identifier":"Long Haul International - Average","used_formula_inputs":{"per_passenger_km":{"model_state":"active","name":"per_passenger_km","group_name":null,"values":{"km_uplift_factor":1.09,"co2":0.1122,"ch4":1.0e-05,"n2o":0.0011,"co2e":0.11331},"active_at":"2010-04-26T17:19:50Z","input_units":"km","label_input_units":"km per passenger","main_source_id":null,"source":null,"id":null}}}},"used_global_computations":{"haversine_distance_degrees":5568.769219237845}

This has vast of information for the developers so let me highlight a few key aspects of what we get back;

Calculations

{"calculations":{"co2":{"value":681.049338,"units":"kg"},"n2o":{"value":6.676954,"units":"kg CO2e"},"ch4":{"value":0.0607,"units":"kg CO2e"},"co2e":{"value":687.786992,"units":"kg"}}

Main Source Ids

4bebea80dfde7b477d000008"

This allow you to link to the browser to show your user where and how the result was obtained

http://browser.carboncalculated.com/main_sources/4bebea80dfde7b477d000008

Object References

{"id":"4b83f9af0e61b2220d00538d","template_name":"airport","characteristics":[{"attribute":"label","value":"United Kingdom, London - LGW","units":null,"value_type":"String","id":null},{"attribute":"airport_name","value":"London - LGW","units":null,"value_type":"String","id":null},{"attribute":"latitude","value":"51.15","units":null,"value_type":"Float","id":null},{"attribute":"longitude","value":"-0.19","units":null,"value_type":"Float","id":null},{"attribute":"iata_code","value":"LGW","units":null,"value_type":"String","id":null},{"attribute":"airport","value":"Gatwick","units":null,"value_type":"String","id":null},{"attribute":"country","value":"United Kingdom","units":null,"value_type":"String","id":null}],"formula_inputs":[],"identifier":"United Kingdom, London - LGW - Gatwick"}

All the generic objects (objects) that were used in the calculation will be returned; this enables a developer to have access to characteristics that these objects have and utilise them accordingly;

The airport JFK will bring back its latitude, longitude, and country;

The transport object “long haul flight” will tell you its uplight factor its attached emissions values and where they came from; via its source id; this can then be used to inform the end user exactly how the result was calculated;

Used Computations

"used_global_computations":{"haversine_distance_degrees":5568.769219237845}

Here we can clearly see that we get the distance from the two airports; it even explains the formula used to get that distance; how transparent is that!

Super Calculators

Having validations at the CORE of the calculators enables us to give developers powerful features; we use these features here to build automatic UIs for our calculators that we build; Our QA application are an example of this;

Lets find the emissions of travelling by London Bus for 10Km

/calculators/4bab7e17f78b122cdd000001/answer.json?api_key=your_api_key&transport_type=4bd5cb38dfde7b1256003360&transport=4bd5cb38dfde7b1256003361&no_of_journeys=1&no_of_people=1&distance=10&formula_input_name=per_passenger_km

Look!!!!!!!!!!

/calculators/4bab7e17f78b122cdd000001/

this the same calculator for the previous flight calculation we did; But this calculator contains many computations; one for flight one for flight using airport; and one for other transport vehicles.

How can this work??? How does it know what to calculated? Validations

Why is this so cool?

You the developer may not know what the user wants to calculate; however you know it evolves transport!

Therefore you can just use the passenger transport calculator to determine what kind of transport calculation it need to use

Now when you create a Journey calculator for instance; you dont have to create logic in determining what calculation to use; just ask the platform to determine it for you;

Its hard to convey how powerful this feature is? But if you into carbon calculations; please look at our new QA application for Defra Waste emissions; this has 16 separate computations and yet it we only have to send the users answers to to the 1 calculator; this means no extra logic; no extra code; time saved; LOTS!

Carbon Calculated Team

News and guidance from the Carbon Calculated team; a bunch of software developers and carbon experts based in London, UK.

Contributors

carboncalculated nogeek constructioncc