Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Description

Returns the consumption of energy on a specific switch that is active on a specific service location during a specified range of time. The call support different aggregation levels to obtain different levels of details.

Resource URL

https://app1pub.smappee.net/dev/v2/servicelocation/[SERVICELOCATIONID]/switch/[ID]/consumption

HTTP method

GET

HTTP header

Authorization: Bearer [ACCESS_TOKEN]

(info) [ACCESS_TOKEN] being the access token received from the Get token or Refresh token authentication calls.

Parameters

ParameterTypeDescription
SERVICELOCATIONIDPath ParameterThe actual id of an accessible service location (see Get Servicelocations)
IDPath ParameterThe actual id of a switch that is active at the service location (see Get Servicelocation Info where a switch is called an actuator)
aggregationQuery Parameter

The level of detail and should be one of:

  • 1 to obtain the 5 minute data (most detailed level)
  • 2 to obtain hourly values
  • 3 to obtain daily values
  • 4 to obtain monthly values
  • 5 to obtain quarterly values
fromQuery ParameterThe UTC timestamp in milliseconds indicating the beginning of the requested period
toQuery ParameterThe UTC timestamp in milliseconds indicating the end of the requested period

Example

http://app1pub.smappee.net/dev/v2/servicelocation/123/switch/2/consumption?aggregation=1&from=1388534400000&to=1391212800000

Result

{
  "serviceLocationId": 123,
  "sensorId": 1,
  "records": [
    {
      "timestamp": 1388534400000,
      "active": 9.0,
      "reactive": 0.0,
    },
    ...
  ]
}

Versioning

This was introduced in version 2 of the API.

Content

  • No labels