API / Frequently Asked Questions

What is Smart Energy Groups?

Smart Energy Groups is an on-line community for energy aware people to work together to share information on how to use energy more efficiently and reduce energy consumption.

To learn more about the why and where of Smart Energy Groups, rock over here

 

The Smart Energy Manager

We are busy building the open source home energy manager.   This is in and under development, and has been integrated into the site.  If you become a member, you can view public energy groups by clicking on the Groups tab.

The Home Energy Manager will ultimately be linked in with your Smart Energy Groups account when you subscribe for this particular service.  This isn't too far off, and we will be letting you know when happens (...of course).

Energy Manager Software

An open RESTul web service API is planned for the application, allowing external devices to easlily comminicate and exchange information with the system.

Documentation, and useful "stuff" will be made available will deliver packages for:

  • - XML and json message exchange
  • - Ruby modules for application integration
  • - A PC based residential gateway for easy USB connection of devices
  • - An openwrt based residential gatway using Zigbee for wireless device mangement
  • - one day a Rails plugin for your tasty projects

and other relevant languages, let us know if you want one on the list

which will make open sourcing home energy management tops, and perhaps even fun.

The Ruby client residential gateway module is available from git.  This module will connect to Smart Energy Groups using your site token, collect data ane events from your home, office or anywhere you want to instrument and control.  The gateway software can be got from git over here:

http://github.com/samotage/Smart-Energy-Groups-API-Services/tree/master

There is also an Arduino an event driven framework for colelcting data and executing commands available.  This framework is compatable with the Ruby Residential Gateway.  It's available for download from git at:

http://github.com/geekscape/Aiko/tree/master

This framework froms part of the Melbourne based Connected Community Hackerspaces group which is developing the Instrumented and Distributed community, open sourcing and building devices for the common good.

You can learn more, and participate in the project at the connected community hackerspaces here:

http://groups.google.com/group/connected-community-hackerspace/

So get involved, and help particpate to make this awesome!

 

API Documentation

The Ruby Residential Gateway software also contains working examples and documentation for the API, including adaptors which you could use for your own funky project.  At the moment there are 3 API's into the sytem:

A sites transaction - for :get and :put HTML methods on your site.   This will enable all stuff on your site to be instrumented and controlled from a single RESTul resource.  I won't go into details on this here, as it's better to view from the GIT based codeline.

Two streams transactions for the :post HTML method.  The simple version allows you to post a value to your stream's ecxternal id as part of the HTML payload e.g.

http://api.smartenergygroups.com/api_streams/<your external stream id>/add_point

POSTING a payload of:
value=<what ever your value is>

The more structured version allows posting of a number of points

http://api.smartenergygroups.com/api_streams/<your stream external_id>.xml 

A GET to this resource will get data, a PUT sending the following payload will upload the data.   Note you can send multiple points if you wish, however it may make sense then to send up the date time ; in YYYY-MM-DD HH:MM:SS format (24 hour clock version)

PUT  to:  http://api.smartenergygroups.com/api_streams/switch_002.xml

<?xml version="1.0" encoding="UTF-8"?>
<stream>
  <external_id>switch_002</external_id>
  <points>
    <point>
      <point_date>2009-03-01 00:30:00</point_date>
      <value>110.0</value>
    </point>
  </points>
</stream>

Or - a point without a point date, note the server will use it's current time

<?xml version="1.0" encoding="UTF-8"?>
<stream>
  <external_id>switch_002</external_id>
  <points>
    <point>
      <value>110.0</value>
    </point>
  </points>
</stream>

Esskware_web_tag_sm