WiFi Motion Core APIs (v3-x-x)

The WiFi Motion Core Cloud APIs facilitate the creation, configuration, and management of WiFi Motion networks via RESTful APIs. Additionally, it offers interfaces for accessing topologies, events, and motion data. This documentation outlines the endpoints for engaging with the WiFi Motion cloud and includes specifications for the following APIs:

Network Settings

Motion History

The motion history APIs provide various historical motion metrics.

Live Motion

The live motion API opens a web socket and triggers the network to emit recorded motion at a 500ms interval.

Events

The events APIs allow you to retrieve, create or tag events emitted by the network.

Network Status

High-level APIs for retrieving the network's topology, last status message, or to view or modify the network's metadata.

Location Data

The location data APIs expose localized motion data. Localization happens on a per mac, or custom location name base.

Find

A set of APIs to find a network in the WiFi Motion Cloud. Individual, or groups of networks can be queried by their primary identifiers or by MAC.

Insights (advanced)

APIs of the internal Home Insights Microservice. Used for motion-based activity and sleep insights.

Config (advanced)

Fine-grained network configuration. These APIs give full access to the underlying motion detection controls, but have no safeguards to prevent unwanted side effects. For friendlier configuration management, see the Network Settings APIs.

Node (advanced)

Interface to manage the access point or mesh nodes of a network. Provides APIs to find, delete or alter the configuration of nodes.

Gatekeeper (advanced)

Endpoint used by WiFi Motion agent for the initial cloud connection. This API returns credentials for connecting to the MQTT broker and stores the initial network configuration. We don't recommend using this API directly.

Management (advanced)

Execute commands directly on the network's access point, or on a mesh node. We recommend using the NOC Management Page for these actions.

Debug (advanced)

Debug endpoints, for internal use only.

Application Settings (advanced)

The application settings API allows users to create, update, delete, and retrieve configurations based on network ID.

Download OpenAPI description
Languages
Servers
Mock server

https://docs.cognitivesystems.com/_mock/assets/specs/mns/v3-x-x/

Network Settings

Operations

Motion History

Operations

Live Motion

Operations

Events

Operations

Network Status

Operations

Network Meta

Operations

Location Data

Operations

Find

Operations

Config

Operations

Node

Operations

Gatekeeper

Operations

Management

Operations

Debug

Operations

Insights

Operations

Version

Request

Returns version information of the home-insights microservice.

If 404, the service has not been enabled.

curl -i -X GET \
  https://docs.cognitivesystems.com/_mock/assets/specs/mns/v3-x-x/insights/version

Responses

Bodyapplication/json
string
Response
application/json
"v1-4-0"

Sleep and Wake Times

Request

Query
networkIdintegerrequired

Motion Network ID (returned as 'id' by Find API calls)

afromstring

Starting time for report

Default "now-1d"
atostring

Ending time of report

Default "now"
timeZonestringrequired

IANA String for time Zone (Ex: America/Toronto, America/New_York)

pnginteger

When set to 1 will return PNG plot instead of json (debug)

Default 0
fetchAllinteger

When set to 1 will return all candidates instead of just top (debug)

Default 0
sleepTimeinteger[ 0 .. 23 ]required

Expected sleep hour in 24h time (ex: 0 for midnight)

wakeTimeinteger[ 0 .. 23 ]required

Expected wake time in 24h time (ex: 8 for 8am)

durationinteger

When set to 1 will return newer Sleep Duration structure including stats and string format times

Default 1
interruptioninteger

(BETA) When set to 1 will augment Sleep Duration structure with counts for Interruptions. Requires duration=1

Default 0
curl -i -X GET \
  'https://docs.cognitivesystems.com/_mock/assets/specs/mns/v3-x-x/insights/sleepTimes?afrom=now-1d&ato=now&duration=1&fetchAll=0&interruption=0&networkId=0&png=0&sleepTime=23&timeZone=string&wakeTime=23'

Responses

Sleep times (duration=1 format)

Bodyapplication/json
arrays
Response
application/json
[ { "avg_sleep_str": "00:58", "avg_wake_str": "08:30", "duration_avg_s": 27257, "duration_avg_str": "7h34m", "qry_days": 7 }, [ {}, {}, {}, {}, {}, {}, {} ] ]

Daily Activity

Request

Query
networkIdintegerrequired

Motion Network ID (returned as 'id' by Find API calls)

afromstring

Starting time for report. This can be an epoch value, or can be in the form of now-1d. Do not use quotation marks within this field.

Default "now-1d"
atostring

Ending time of report. This can be an epoch value, or can be in the form of now. Do not use quotation marks within this field.

Default "now"
timeZonestringrequired

IANA String for time Zone (Ex: America/Toronto, America/New_York). Do not use quotation marks within this field.

pnginteger

When set to 1 will return PNG plot instead of json (debug)

Default 0
goalinteger[ -1 .. 3 ]Deprecated

(BETA) Control for enabling response of different Goal calculations. Each considers the current day's activity relative to the rest of the query window, providing the window average and current delta activity values. The different integer modes [1,2,3] select the aggregations of 'day' as: today so far, Last 24hr block, Last Full calendar day. [0] for all and [-1] for none.

Default 0
curl -i -X GET \
  'https://docs.cognitivesystems.com/_mock/assets/specs/mns/v3-x-x/insights/activity?afrom=now-1d&ato=now&goal=0&networkId=0&png=0&timeZone=string'

Responses

Daily Activity. [percent active, epoch unix timestamp]

Bodyapplication/json
arrays
Response
application/json
[ { "qry_days": 7.010416666666667 }, [ [], [], [], [], [], [], [] ] ]

Insights v2

Operations

Universal Alerting

Operations

Application Settings

Operations