Cognitive Systems WiFi Motion App-Cloud API (v1-5-x)

App Cloud APIs are used by mobile applications.

Download OpenAPI description
Languages
Servers
Mock server

https://docs.cognitivesystems.com/_mock/assets/specs/app-cloud/v1-5-x/

https://docs.cognitivesystems.com/api/v1/

Overview

Operations

Out of Box

Operations

Logging In

Operations

Geofencing

Operations

Account Management

Operations

Network Settings

Operations

Sounding v2

Operations

Events, History, and Visualizations

Operations

Household Insights [BETA]

Operations

Get Sleep-Wake Settings

Request

Both the owner or the member bound to the network can consume this endpoint. Responds to the application whether sleep feature is enabled, and the user-provided household sleep time and household wake time.

If the owner has not yet enabled the feature viaPOST, the following template is sent:

{
  enabled: false,
  sleep_hour: 23,
  sleep_minute: 0,
  wake_hour: 7,
  wake_minute: 0
}

A record of the household settings is made only when the feature is enabled for the first time.

curl -i -X GET \
  https://docs.cognitivesystems.com/_mock/assets/specs/app-cloud/v1-5-x/sleep_times/settings \
  -H 'Authorization: YOUR_API_KEY_HERE'

Responses

Bodyapplication/json
enabledbooleanrequired
sleep_hourintegerrequired
Example: 23
sleep_minuteintegerrequired
wake_hourintegerrequired
Example: 9
wake_minuteintegerrequired
Example: 15
Response
application/json
{ "enabled": false, "sleep_hour": 23, "sleep_minute": 0, "wake_hour": 9, "wake_minute": 15 }

Set Sleep-Wake Settings

Request

Only the user with a role of "owner" can make a request to this endpoint.

Bodyapplication/json
enabledboolean

toggle on or off the sleep feature

sleep_hourinteger

user supplied hour for time of sleep

Example: 23
sleep_minuteinteger

user supplied minute for time of sleep

wake_hourinteger

user supplied hour for time of wake

Example: 9
wake_minuteinteger

user supplied minute for time of wake

Example: 15
curl -i -X POST \
  https://docs.cognitivesystems.com/_mock/assets/specs/app-cloud/v1-5-x/sleep_times/settings \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "enabled": false,
    "sleep_hour": 23,
    "sleep_minute": 0,
    "wake_hour": 9,
    "wake_minute": 15
  }'

Responses

Bodyapplication/json
enabledbooleanrequired
sleep_hourintegerrequired
Example: 23
sleep_minuteintegerrequired
wake_hourintegerrequired
Example: 9
wake_minuteintegerrequired
Example: 15
Response
application/json
{ "enabled": false, "sleep_hour": 23, "sleep_minute": 0, "wake_hour": 9, "wake_minute": 15 }

Household Sleep-Wake Times Data

Request

This endpoint retrieves the timezone of the user from the network model and supplies it to the micro service. The micro service will return hour values for wake and sleep in the network's timezone.

Path
queried_daysinteger[ 1 .. 7 ]required

can be omitted. when omitted defaults to 7

Query
force_pastboolean

Specifically for QA and load validation, this switch if set to true force allows a request sleep data to query the full 7 days back despite the enable time being later than this. The number of queried days will be respected in the path param

Default false
curl -i -X GET \
  'https://docs.cognitivesystems.com/_mock/assets/specs/app-cloud/v1-5-x/sleep_times/data/{queried_days}?force_past=false' \
  -H 'Authorization: YOUR_API_KEY_HERE'

Responses

Bodyapplication/json
avg_sleep_time_sinteger
Example: 82380
avg_wake_time_sinteger
Example: 23280
average_interruptionsnumber
duration_avg_sinteger
Example: 27900
queried_daysinteger

the number of days actually queried to the insights micro-service

Example: 6
motion_stateobject

the unarmed/home/0 or armed/away/ 1 history of the network

Example: {"data":[0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"from_ts":1618243200,"bucket":3600}
dataArray of objects

the array of days queried, length of array will match queried number of days

Example: [{"house_day":18729,"sleep_ts":1618266600,"sleep_weight":0.923879533,"wake_ts":1618286400,"wake_weight":0.965925826},{"house_day":18730,"sleep_ts":1618353900,"sleep_weight":0.896872742,"wake_ts":1618372800,"wake_weight":0.965925826},{"house_day":18731,"sleep_ts":1618440300,"sleep_weight":0.896872742,"wake_ts":1618476300,"wake_weight":0.555570233},{"house_day":18732,"sleep_ts":1618517700,"sleep_weight":0.98078528,"wake_ts":1618545600,"wake_weight":0.965925826},{"house_day":18734,"sleep_ts":1618687800,"sleep_weight":0.923879533,"wake_ts":1618711200,"wake_weight":0.707106781},{"house_day":18735,"sleep_ts":1618766100,"sleep_weight":0.555570233,"wake_ts":1618807500,"wake_weight":0.997858923}]
Response
application/json
{ "avg_sleep_time_s": 82380, "avg_wake_time_s": 23280, "duration_avg_s": 27900, "queried_days": 6, "motion_state": { "data": [], "from_ts": 1618243200, "bucket": 3600 }, "data": [ {}, {}, {}, {}, {}, {} ] }

Zone Priority [BETA]

Operations

Universal Alerting

Operations

Meta

Operations

Administration

Operations