field | type | description |
---|---|---|
tag_id | string | Unique id of Tag |
start_time | integer | Start time for report (Unix Epoch format) |
end_time | integer | Start time for report (Unix Epoch format) |
interval_type | integer | See interval_type above |
interval | string,optional | 15min , hour , or day (defaults to 15min if not specified) |
include_minute | boolean,optional | Annotate each record with the interval start minute-of-hour (0-59) |
include_hour | boolean,optional | Annotate each record with the interval start hour-of-day (0-23) |
include_dow | boolean,optional | Annotate each record with the interval start day-of-week (0-6) |
include_all_on | boolean,optional | Include all_on_wh value (default false) |
full_occ_data | boolean,optional | Include active, inactive and sensor time in occupancy (interval_type = 5) replies (default false) |
GET https://example-backend.siteworx.io/api/v1/aggregate_tag_interval_facts?tag_id=5CBswh1EF7Z&interval=hour&interval_type=1&start_time=1676642400&end_time=1676671200
{
"data": [
{
"fact_count": 4,
"interval_start": 1676642400,
"interval_type": 1,
"sum_data": 13.852433281004709,
"updated_at": "0001-01-01T00:00:00Z"
},
{
"fact_count": 4,
"interval_start": 1676646000,
"interval_type": 1,
"sum_data": 41.778335949764525,
"updated_at": "0001-01-01T00:00:00Z"
},
... 4 records omitted ...
{
"fact_count": 4,
"interval_start": 1676664000,
"interval_type": 1,
"sum_data": 42.225641025641025,
"updated_at": "0001-01-01T00:00:00Z"
},
{
"fact_count": 4,
"interval_start": 1676667600,
"interval_type": 1,
"sum_data": 41.68205128205128,
"updated_at": "0001-01-01T00:00:00Z"
}
],
"meta": {
"count": 8
}
}