Sign up for our e-newsletter:

Name:
Email:
Company Name:
newsletter

The Enistic Data API

Enter your XML formatted query below and press the submit button to process the query (or send this form automatically from your application):


What is the Enistic Data API?

The Enistic Data API is a way of linking yor application to the Enistic Energy Manager and get energy / power usage data to populate your application.

How to use

POST method

To use the Enistic Data API, simply send a post to this page with a http POST containing a variable called 'xml' (NB no quotes). If the xml variable contains a command correctly formatted as per the example below, you will get back an XML file in the response that you can parse to feed data to your application.

You can get an example of this by looking at the source of this page, which implements this.

GET method

Alternatively, you can send a GET message as part of a URL string as follows:

http://www.enistic.com/xml.php?xml=<your_xml_query_goes_here>

Typical input

Please send commands similar to this:
<xml>
 <commands>
  <command>
   <action>get_data</action>
   <start>10/21/09 15:00</start>
   <end>10/22/09 16:00</end>
   <email>email_address</email>
   <password>password</password>
   <period>minute</period>
   <format>xml</format>
   <filter></filter>
   <channel_filter></channel_filter>
   <timezone>Europe/London</timezone>
  </command>
 </commands>
</xml>

Where there can be multiple commands per message consisting of:

tl
tr
Command Option
<action>

Action can be set to [get_data | switch_on | switch_off].

Switch commands will switch the device with the serial number set in the filter parameter. When using switch commands other fields can be left out.

<start>

Specifies the start date of the data you wish to extract in the following format: mm/dd/yy hh:mm:ss

<end>

Specifies the end date of the data you wish to extract in the following format: mm/dd/yy hh:mm:ss

<period>

Period can be [minute | hour | live] if you set the period to 'live' then start and end are ignored.

Please note that minute by minute data is only kept for the current day so if you want data older than that you must specify hourly data option. Hourly data is held for 3 months.

<format>

Format can be [xml | json], see the examples below.

<filter>

Filter can be [serial_number_of_socket | blank].

If blank the system reports all sockets. If set to a valid serial number it will report only that socket information

<channel_filter>

Channel Filter can be [channel_number_of_socket | blank].

If blank the system reports all channels.

You can also specify multiple channels separated by commas, e.g. <channel_filter>1,2,3</channel_filter>

<timezone>

Timezone can be [timezone_name].

We support most timezones as found on the company preferences page when logged in, however, if your timezone is not listed we can add it on request.

The default is 'Europe/London' (without the quotes)

bl
br

Typical output (XML)

<?xml version="1.0"?>
<results>
  <reading>
    <name>Air con 4</name>
    <serial>12354</serial>
    <datetime>2009-11-15 15:14:00</datetime>
    <power>0</power>
    <energy>0</energy>
    <cost>0</cost>
    <carbon>0</carbon>
  </reading>
  <reading>
    <name>Air con 4</name>
    <serial>12354</serial>
    <datetime>2009-11-15 15:15:00</datetime>
    <power>0</power>
    <energy>0</energy>
    <cost>0</cost>
    <carbon>0</carbon>
  </reading>
  <reading>
    <name>Warehouse lights</name>
    <serial>3002974</serial>
    <datetime>2009-11-15 15:57:00</datetime>
    <power>14.425</power>
    <energy>2.40417E-07</energy>
    <cost>1.2261267E-05</cost>
    <carbon>1.29103929E-07</carbon>
  </reading>
  <reading>
    <name>Warehouse lights</name>
    <serial>3002974</serial>
    <datetime>2009-11-15 15:58:00</datetime>
    <power>14.188</power>
    <energy>2.36467E-07</energy>
    <cost>1.2059817E-05</cost>
    <carbon>1.26982779E-07</carbon>
  </reading>
  <reading>
    <name>Warehouse lights</name>
    <serial>3002974</serial>
    <datetime>2009-11-15 15:59:00</datetime>
    <power>14.188</power>
    <energy>2.36467E-07</energy>
    <cost>1.2059817E-05</cost>
    <carbon>1.26982779E-07</carbon>
  </reading>
  <reading>
    <name>Warehouse lights</name>
    <serial>3002974</serial>
    <datetime>2009-11-15 16:00:00</datetime>
    <power>14.188</power>
    <energy>2.36467E-07</energy>
    <cost>1.2059817E-05</cost>
    <carbon>1.26982779E-07</carbon>
  </reading>
</results>

Typical output (JSON)

Input used was:

<xml>
<commands>
<command>
<action>get_data</action>
<start>10/21/09 15:00</start>
<end>10/22/09 16:00</end>
<email>abc</email>
<password>abc</password>
<period>live</period>
<format>json</format>
<filter></filter>
<timezone>Europe/London</timezone>
</command>
</commands>
</xml>

Which gives the output:

{
{"name":"Demo Room TV/PC","serial":"1109","datetime":"2009-11-15 22:06:10","power":"0","energy":"0.001248","cost":"0.063648","carbon":"0.000670176"},
{"name":"Ross Jarvis","serial":"1161","datetime":"2009-11-15 22:06:10","power":"0","energy":"0","cost":"0","carbon":"0"},
{"name":"Rob Iles","serial":"1061","datetime":"2009-11-15 22:06:10","power":"12.5658","energy":"1345.39","cost":"68614.89","carbon":"722.47443"},
{"name":"Fridge","serial":"1149","datetime":"2009-11-15 22:06:10","power":"0","energy":"1217.09","cost":"62071.59","carbon":"653.57733"},
{"name":"Chris Richardson","serial":"3037","datetime":"2009-11-15 22:06:10","power":"6.8796","energy":"545.631","cost":"27827.181","carbon":"293.003847"},
{"name":"Test Socket","serial":"1656","datetime":"2009-11-15 22:06:10","power":"56.9322","energy":"3434.18","cost":"175143.18","carbon":"1844.15466"},
{"name":"Demo Socket","serial":"1065","datetime":"2009-11-15 22:06:10","power":"0","energy":"15.7223","cost":"801.8373","carbon":"8.4428751"},
{"name":"Adrian Green","serial":"3035","datetime":"2009-11-15 22:06:10","power":"0","energy":"1.42397","cost":"72.62247","carbon":"0.76467189"},
{"name":"Aircon 2 phase 1","serial":"12345","datetime":"2009-11-15 22:06:10","power":"0","energy":"0","cost":"0","carbon":"0"},
{"name":"Test Socket","serial":"1132","datetime":"2009-11-15 22:06:10","power":"1.4742","energy":"115.099","cost":"5870.049","carbon":"61.808163"},
{"name":"Lights - sales office 1","serial":"12355","datetime":"2009-11-15 22:06:10","power":"0.815","energy":"0","cost":"0","carbon":"0"},
{"name":"Lights - sales office 2","serial":"12356","datetime":"2009-11-15 22:06:10","power":"0","energy":"0","cost":"0","carbon":"0"},
{"name":"Lights - warehouse 1","serial":"12357","datetime":"2009-11-15 22:06:10","power":"0","energy":"0","cost":"0","carbon":"0"},
{"name":"Lights - warehouse 2","serial":"12358","datetime":"2009-11-15 22:06:10","power":"0","energy":"0","cost":"0","carbon":"0"},
{"name":"Dist Board 2","serial":"12359","datetime":"2009-11-15 22:06:10","power":"0","energy":"0","cost":"0","carbon":"0"},
{"name":"Lights - warehouse 3","serial":"12360","datetime":"2009-11-15 22:06:10","power":"14.499","energy":"0","cost":"0","carbon":"0"},
{"name":"Air Con 1 phase 1","serial":"12348","datetime":"2009-11-15 22:06:10","power":"0","energy":"0","cost":"0","carbon":"0"},
{"name":"Aircon 2 phase 3","serial":"12347","datetime":"2009-11-15 22:06:10","power":"0","energy":"0","cost":"0","carbon":"0"},
{"name":"Aircon 0 phase 3","serial":"12353","datetime":"2009-11-15 22:06:10","power":"0","energy":"0","cost":"0","carbon":"0"},
{"name":"Air Con 1 phase 2","serial":"12349","datetime":"2009-11-15 22:06:10","power":"0.898","energy":"0","cost":"0","carbon":"0"},
{"name":"Air Con 1 phase 3","serial":"12350","datetime":"2009-11-15 22:06:10","power":"0","energy":"0","cost":"0","carbon":"0"},
{"name":"Aircon 0 phase 1","serial":"12351","datetime":"2009-11-15 22:06:10","power":"0","energy":"0","cost":"0","carbon":"0"},
{"name":"Aircon 0 phase 2","serial":"12352","datetime":"2009-11-15 22:06:10","power":"0.908","energy":"0","cost":"0","carbon":"0"},
{"name":"Aircon 2 phase 2","serial":"12346","datetime":"2009-11-15 22:06:10","power":"1.023","energy":"0","cost":"0","carbon":"0"},
{"name":"Air con 4","serial":"12354","datetime":"2009-11-15 22:06:10","power":"0","energy":"0","cost":"0","carbon":"0"},
{"name":"Air con 2","serial":"3002971","datetime":"2009-11-15 22:06:10","power":"1.023","energy":"0","cost":"0","carbon":"0"},
{"name":"Air con 1","serial":"3002972","datetime":"2009-11-15 22:06:10","power":"0.898","energy":"0","cost":"0","carbon":"0"},
{"name":"Air con 3","serial":"3002973","datetime":"2009-11-15 22:06:10","power":"0.908","energy":"0","cost":"0","carbon":"0"},
{"name":"Warehouse lights","serial":"3002974","datetime":"2009-11-15 22:06:10","power":"14.499","energy":"0","cost":"0","carbon":"0"}
}