The Illuminance, or Light Level, API provides illuminance, or ambient light information for a specified asset. Illuminance is measured in lux (lx) and the range is 1 lx ≤ Illuminance ≤ 3.576 Mlx.
Use the following URL method structure to retrieve historical illuminance data for a selected asset.
METHOD: |
GET |
URI: |
<production url>/v1/assets/{id}/events?event-types=LIGHT_LEVEL(start-ts,end-ts,size,page) |
SAMPLE URI |
<production url>/v1/assets/1000000540/events?event-types=LIGHT_LEVEL&start-ts=1461517200000&end-ts=1461689922665&size=2 |
Query Parameters
Parameter |
Description |
Required? |
Values |
id |
GE identifier for an asset. |
Yes |
For example, 1000000540. |
event-types |
Filter by type of event. |
Yes |
LIGHT_LEVEL |
start-ts |
Start time in milliseconds. |
Yes |
Numerical value, such as 1461517200000. |
end-ts |
End time in milliseconds. |
Yes |
Numerical value, such as 1461689922665. |
page |
Page number. |
No |
Numerical value, such as 1. |
size |
Maximum number of records per page. If no size is specified, the default limit applies. |
No |
Numerical value, such as 2. |
Response Parameters
Parameter |
Data Type |
Required? |
Description |
_embedded |
Object |
Yes |
Time (seconds) spent in a particular zone. |
events |
Array |
Yes |
List of events |
….measures |
Array |
Yes |
Provides the following values:- tag: LIGHT_LEVEL
- value: 13.3467
- unit: lux
|
….event-uid |
String |
Yes |
Unique identifier established by a customer or external resource for the event, with value of null. |
….timestamp |
Number |
Yes |
Actual timestamp when event occurred, such as 1461648646761. |
….event-types |
String |
Yes |
Type of event recorded, such as LIGHT_LEVEL. |
….device-uid |
String |
Yes |
A unique identifier established by a customer or external resource, such as Sensor_250_200. |
….location-uid |
String |
Yes |
Unique identifier established by a customer or external resource for a specific location within the monitored area, such as 1000000106. |
_links |
Object |
Yes |
HREFs related to this specific node.- self: Link to the asset details using the GE identifier. See the Get Asset Details section for information on obtaining additional data.
- next page: HREFs to navigate the result set using paging.
|
page |
Object |
Yes |
Pageable information satisfying the search filter. |
….size |
Number |
No |
Maximum number of records to return per page, such as 2. |
….totalElements |
Number |
No |
Total number of elements, such as 45. |
….totalPages |
Number |
No |
Total number of pages, such as 23. |
….number |
Number |
No |
Indicates the page number displayed when returned. Default value is 0. |
Sample Response
{
"_embedded": {
"events": [
{
"properties": {},
"measures": [
{
"tag": "LIGHT_LEVEL",
"value": 13.3467,
"unit": "lux"
}
],
"event-uid": null,
"timestamp": 1461648646761,
"event-type": "LIGHT_LEVEL",
"device-uid": "Sensor_250_200",
"location-uid": "1000000106"
},
{
"properties": {},
"measures": [
{
"tag": "LIGHT_LEVEL",
"value": 13.672,
"unit": "lux"
}
],
"event-uid": null,
"timestamp": 1461650458319,
"event-type": "LIGHT_LEVEL",
"device-uid": "Sensor_250_200",
"location-uid": "1000000105"
}
]
},
"_links": {
"self": {
"href": "http://ie-environmental.run.aws-usw02-pr.ice.predix.io/v1/assets/1000000540/events?event-types=LIGHT_LEVEL&start-ts=1461517200000&end-ts=1461689922665&size=2"
},
"next-page": {
"href": "http://ie-environmental.run.aws-usw02-pr.ice.predix.io/v1/assets/1000000540/events?event-types=LIGHT_LEVEL&start-ts=1461650458319&end-ts=1461689922665&size=2"
}
},
"page": {
"size": 2,
"totalElements": 45,
"totalPages": 23,
"number": 0
}
}