Efergy Engage API Reference - part 1

This is the first post in a multipart series where I will try to describe the energyhive api.

Update 12 Feb 2015

There appears to be an official api document available from energyhive, it can be found on http://napi.hbcontent.com/document/index.php. Thanks to Robert R for sharing in it in the comments.

Authentication

Url : https://engage.efergy.com/mobile/
Function : get_token
Parameters :

  • username
  • password
  • device

Example:

https://engage.efergy.com/mobile/get_token?username=email&password=pass&device=android

Result:

{
    "status":"ok",
    "token":"tokenvalue"
}

token

All API calls need to have the value of token as url parameter with name token.
ex. https://engage.efergy.com/mobile_proxy/getInstant?token=tokenvalue

offset

Besides token as parameter for all functions, the offset parameter is used on most functions, it will contain the negative number of minutes your timezone is ahead/behind UTC time.
So if your timezone is UTC+1, the offset parameter will contain -60.

getInstant

Url : https://engage.efergy.com/mobile_proxy/
Function : getInstant

Example:

https://engage.efergy.com/mobile_proxy/getInstant?token=tokenvalue

Result:

{
    "age":7,
    "last_reading_time":1414933104000,
    "reading":123
}

getStatus

Url : https://engage.efergy.com/mobile_proxy/
Function : getStatus
Example:

https://engage.efergy.com/mobile_proxy/getStatus?token=token

Result:

{
"hid": "",
"listOfMacs": [
    {
        "listofchannels": [
            {
                "assoc": 1,
                "cid": "cid.",
                "reading": null,
                "ts": 1414933212,
                "tsDelta": 5,
                "tsHuman": "Sun Nov  2 13:00:12 2014",
                "type": {
                    "battery": 5,
                    "falseBattery": 0,
                    "id": null,
                    "name": ""
                }
            }
        ],
        "mac": "",
        "personality": "E1",
        "status": "on",
        "ts": 1414933212,
        "tsDelta": 5,
        "tsHuman": "Sun Nov  2 13:00:12 2014",
        "type": "EEEHub",
        "version": "2.3.7"
    }
]
}

get[Day, Week, Month, Year]

Url : https://engage.efergy.com/mobile_proxy/
Functions :

  • getDay : get the last 24 hours of data grouped by minute
  • getWeek : get the last 7 days of data grouped by hour
  • getMonth : get the last 28 days of data grouped by day
  • getYear : get the last 12 months of data grouped by month

Parameters :

  • getPreviousPeriod : will add the value of the previous period to the results (0 or 1)
  • cache : set to false, i expect that if this is used, the result will be cached on the backend (and thus not updated on the next call)

Example :

https://engage.efergy.com/mobile_proxy/getYear?token=tokenvalue

Result :

{
"status": "ok",
"data": {
    "1383264000000": [
        "undef"
    ],
   ....
    "1412121600000": [
        48.17
    ]
    }
}

See also :

comments powered by Disqus