SmartGare
API referenceEndpoints

Read a presence sensor

Asks the station's hardware bridge, once, what the presence sensor at the address last confirmed — OCCUPIED or VACANT, something and never a coach — when, and how much it may be believed: CURRENT, STALE, UNAVAILABLE, UNKNOWN or BRIDGE_UNREACHABLE; and the sensor's health as the device statuses read answers it. Nothing is recorded, and the bridge never fails this read. **Required permission:** `referential.device-status:read`

GET/referential/v1/presence-sensor-readings

Asks the station's hardware bridge, once, what the presence sensor at the address last confirmed — OCCUPIED or VACANT, something and never a coach — when, and how much it may be believed: CURRENT, STALE, UNAVAILABLE, UNKNOWN or BRIDGE_UNREACHABLE; and the sensor's health as the device statuses read answers it. Nothing is recorded, and the bridge never fails this read.

Required permission: referential.device-status:read

AuthorizationBearer <token>

In: header

Query Parameters

address*string

The sensor's bridge address, capability@place or capability[role]@place. One sensor per read.

Match^([a-z][a-z0-9]*(?:-[a-z0-9]+)*)(?:\[([a-z][a-z0-9]*(?:-[a-z0-9]+)*)\])?@([A-Za-z0-9_.:-]+)$

Response Body

*/*

curl -X GET "https://example.com/referential/v1/presence-sensor-readings?address=string"
{  "address": "string",  "confirmed_at": "2019-08-24T14:15:22Z",  "health": {    "address": "string",    "checked_at": "2019-08-24T14:15:22Z",    "condition": "HEALTHY",    "health": "AVAILABLE",    "last_confirmed_at": "2019-08-24T14:15:22Z",    "reason": "PARTIAL_FUNCTION",    "stale": true,    "status": "IN_SERVICE"  },  "last_known": "OCCUPIED",  "standing": "CURRENT"}