{"_id":"57f4af00531675240061d8a7","user":"56130dcf8e503f0d00648b03","__v":0,"category":{"_id":"57f52ed668a53b2000e03efa","project":"56130e29d2b2370d0096b91a","__v":0,"version":"56130e2ad2b2370d0096b91d","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-10-05T16:48:22.773Z","from_sync":false,"order":1,"slug":"stack-enabled","title":"Stack Enabled"},"project":"56130e29d2b2370d0096b91a","version":{"_id":"56130e2ad2b2370d0096b91d","project":"56130e29d2b2370d0096b91a","__v":11,"createdAt":"2015-10-05T23:56:26.509Z","releaseDate":"2015-10-05T23:56:26.509Z","categories":["56130e2bd2b2370d0096b91e","56130f638e503f0d00648b05","561317cdbe80130d00f188dd","561317d8ff92880d005ca212","56f97c0f8fef7520003f818e","570d751180c9010e00d77f4d","570d7543e2a0b40e0077aa90","571699927256fb0e00c1d01c","57f43db31592cb0e00761dd6","57f52ed668a53b2000e03efa","57f5350f485e6e2b005b2f27"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"0.0.0","version":"0"},"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-10-05T07:42:56.516Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","examples":{"codes":[{"code":"curl -X GET 'https://api.stacklighting.com/v0/sense/energy-usage?site_id=6133345811384985&device_id=xdDEVVLmzGDydWnoJLy7AQGyLw&period=hourly&start_time=2016-09-04T00:00:00&end_time=2016-09-04T02:00:00 \\\n     -H 'Content-Type: application/json' \\\n     -H 'Authorization: Bearer YmE3MTU5MWItZTIwMC00MDc2LWJmZTQtZDH5YmUxMTA0ZTNmOjU3NjE2NzM5MzE1MjIwNDg=' ","language":"curl"}]},"method":"get","results":{"codes":[{"language":"json","status":200,"name":"","code":"{\n  \"xdDEVVLmzGDydWnoJLy7AQGyLw\": [\n    {\n      \"product\": \"4\",\n      \"avg_level\": \"0.0\",\n      \"max_brightness\": \"0\",\n      \"max_als_level\": \"104\",\n      \"mains_voltage\": \"0\",\n      \"timestamp\": \"2016-09-04T00:00:00\",\n      \"avg_power\": \"3.614761953940615E-5\",\n      \"avg_als_level\": \"88.75\",\n      \"avg_brightness\": \"0.0\",\n      \"min_als_level\": \"77\",\n      \"min_brightness\": \"0\",\n      \"avg_temp\": \"21.25\",\n      \"min_temp\": \"20.0\",\n      \"max_temp\": \"22.0\"\n    },\n    {\n      \"product\": \"4\",\n      \"avg_level\": \"0.0\",\n      \"max_brightness\": \"0\",\n      \"max_als_level\": \"81\",\n      \"mains_voltage\": \"0\",\n      \"timestamp\": \"2016-09-04T01:00:00\",\n      \"avg_power\": \"3.614761953940615E-5\",\n      \"avg_als_level\": \"63.416666666666664\",\n      \"avg_brightness\": \"0.0\",\n      \"min_als_level\": \"57\",\n      \"min_brightness\": \"0\",\n      \"avg_temp\": \"21.166666666666668\",\n      \"min_temp\": \"21.0\",\n      \"max_temp\": \"22.0\"\n    },\n    {\n      \"product\": \"4\",\n      \"avg_level\": \"0.0\",\n      \"max_brightness\": \"0\",\n      \"max_als_level\": \"60\",\n      \"mains_voltage\": \"0\",\n      \"timestamp\": \"2016-09-04T02:00:00\",\n      \"avg_power\": \"3.614761953940615E-5\",\n      \"avg_als_level\": \"57.666666666666664\",\n      \"avg_brightness\": \"0.0\",\n      \"min_als_level\": \"56\",\n      \"min_brightness\": \"0\",\n      \"avg_temp\": \"21.0\",\n      \"min_temp\": \"20.0\",\n      \"max_temp\": \"22.0\"\n    }\n  ]\n}"}]},"auth":"required","params":[{"_id":"57f4af00531675240061d8ac","ref":"","in":"query","required":true,"desc":"The unique identifier for the site.","default":"","type":"string","name":"site_id"},{"_id":"57f4af00531675240061d8ab","ref":"","in":"query","required":true,"desc":"The unique identifier for the device.","default":"","type":"string","name":"device_id"},{"_id":"57f4af00531675240061d8aa","ref":"","in":"query","required":true,"desc":"The unit of measurement for the time passed between start and end times.","default":"hourly","type":"string","name":"period"},{"_id":"57f4af00531675240061d8a9","ref":"","in":"query","required":true,"desc":"The period's start time.","default":"","type":"string","name":"start_time"},{"_id":"57f4af00531675240061d8a8","ref":"","in":"query","required":true,"desc":"The period's end time.","default":"","type":"string","name":"end_time"}],"url":"/sense/energy-usage?site_id=:site_id&device_id=:device_id&period=:period&start_time=:start_time&end_time=:end_time"},"isReference":true,"order":1,"body":"","excerpt":"This endpoint returns energy usage information from a device.\n\n<strong>Currently only available to <a href=\"http://stacklighting.com/stack-enabled\">Stack Enabled</a> partners.</strong> Contact partners:::at:::stacklighting.com for more information.","slug":"energy","type":"endpoint","title":"Energy Usage"}

getEnergy Usage

This endpoint returns energy usage information from a device. <strong>Currently only available to <a href="http://stacklighting.com/stack-enabled">Stack Enabled</a> partners.</strong> Contact partners@stacklighting.com for more information.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Query Params

site_id:
required
string
The unique identifier for the site.
device_id:
required
string
The unique identifier for the device.
period:
required
stringhourly
The unit of measurement for the time passed between start and end times.
start_time:
required
string
The period's start time.
end_time:
required
string
The period's end time.

Examples


Result Format


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}