Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

Anchor
Overview
Overview
Overview

The following operations allow you to work with Smoke and Carbon Monoxide alarms. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with Smoke and Carbon Monoxide alarms, see Sample configuration.

OperationDescription
1Working with Smoke + CO Alarms in NestviewCOAlarmStateRetrieves the  status of the CO alarm.
1Working with Smoke + CO Alarms in NestviewSmokeAlarmStateRetrieves the  status of the smoke alarm.
1Working with Smoke + CO Alarms in NestviewBatteryHealthRetrieves  battery health state .
1Working with Smoke + CO Alarms in NestviewManualTestStateRetrieves last manual test status.
1Working with Smoke + CO Alarms in NestviewLastManualTestStatusRetrieves test status of last manual test.
1Working with Smoke + CO Alarms in NestviewLastManualTestTimestampRetrieves time stamp of last manual test.
1Working with Smoke + CO Alarms in NestviewOnlineStatusRetrieves the online status .
1Working with Smoke + CO Alarms in NestviewLastConnectionInformationRetrieves the last connection information .

Anchor
OperationDetails
OperationDetails
Operation details

This section provides the details on each operation related to Smoke and CO alarms.

...

Code Block
languagexml
titlegetServices
<nest.getServices>
    <device>{$ctx:device}</device>
    <deviceId>{$ctx:deviceId}</deviceId>
    <operation>viewCOAlarmState{$ctx:operation}</operation>
    <structureId>{$ctx:structureId}</structureId>
</nest.getServices>
Properties
  • device    :Type of the Nest device(smoke_co_alarms).
  • deviceId  :Id of the above mentioned device.
  • operation :The operation to perform.

Anchor
viewCOAlarmState
viewCOAlarmState
View Carbon Monoxide Alarm State

This operation retrieves CO alarm state. This property is read-only with Smoke+CO read permission. It can be “ok or warning or emergency”.

Anchor
sampleRequest
sampleRequest
Sample request

Following is a sample REST/JSON request that can be handled by the viewCOAlarmState operation.

Code Block
titleSample Request for viewCOAlarmState
{
"clientId":"b44cdb3-f056-4c5b-b8a5-e3fd2c6d055f",
"clientSecret":"fjdp7dKJ7p8ipXhAmjNIeF9R",
"code":"E9GW2BQH",
"apiUrl":"https://firebase-apiserver01-tah01-iad01.dapi.production.nest.com:9553",
"device":"smoke_co_alarms",
"deviceId":"VhVmm7HOhEcL5sSzblcDOMMSoJ03t2br",
"operation":"viewCOAlarmState"
}

Anchor
viewSmokeAlarmState
viewSmokeAlarmState
View Smoke Alarm State

This operation retrieves Smoke alarm state. This property is read-only with Smoke+CO read permission. It can be “ok or warning or emergency”.

Sample request

Following is a sample REST/JSON request that can be handled by the viewSmokeAlarmState operation.

Code Block
titleSample Request for viewSmokeAlarmState
collapsetrue
{
"clientId":"b44cdb3-f056-4c5b-b8a5-e3fd2c6d055f",
"clientSecret":"fjdp7dKJ7p8ipXhAmjNIeF9R",
"code":"E9GW2BQH",
"apiUrl":"https://firebase-apiserver01-tah01-iad01.dapi.production.nest.com:9553",
"device":"smoke_co_alarms",
"deviceId":"VhVmm7HOhEcL5sSzblcDOMMSoJ03t2br",
"operation":"viewSmokeAlarmState"
}

Anchor
viewBatteryHealth
viewBatteryHealth
View Battery Health

This operation retrieves battery life/health status. This is the estimate of remaining battery power level. It can be “ok or replace”. This property is read-only with Smoke+CO read permission.

Sample request

Following is a sample REST/JSON request that can be handled by the  viewBatteryHealth operation.

Code Block
titleSample Request for viewBatteryHealth
collapsetrue
{
"clientId":"b44cdb3-f056-4c5b-b8a5-e3fd2c6d055f",
"clientSecret":"fjdp7dKJ7p8ipXhAmjNIeF9R",
"code":"E9GW2BQH",
"apiUrl":"https://firebase-apiserver01-tah01-iad01.dapi.production.nest.com:9553",
"device":"smoke_co_alarms",
"deviceId":"VhVmm7HOhEcL5sSzblcDOMMSoJ03t2br",
"operation":"viewBatteryHealth"
}

Anchor
viewManualTestState
viewManualTestState
View Manual Test State

This operation retrieves the manual test state of the Smoke and CO alarm. This property is read-only with Smoke+CO read permission. State of the manual smoke and CO alarm test. It can be true or false.

Sample request

Following is a sample REST/JSON request that can be handled by the  viewManualTestState operation.

Code Block
titleSample Request for viewManualTestState
collapsetrue
{
"clientId":"b44cdb3-f056-4c5b-b8a5-e3fd2c6d055f",
"clientSecret":"fjdp7dKJ7p8ipXhAmjNIeF9R",
"code":"E9GW2BQH",
"apiUrl":"https://firebase-apiserver01-tah01-iad01.dapi.production.nest.com:9553",
"device":"smoke_co_alarms",
"deviceId":"VhVmm7HOhEcL5sSzblcDOMMSoJ03t2br",
"operation":"viewManualTestState"
}

Anchor
viewLastManualTestStatus
viewLastManualTestStatus
View Last Manual Test Status

This operation retrieves the manual test state of the Smoke and CO alarm that indicates device status by the color in the Nest UI . This property is read-only  with Smoke+CO read permission. The status is noticed by ui_color_state. It is an aggregate condition for battery+smoke+co states, and reflects the actual color indicators displayed in the Nest app.

Last manual test status can be “gray (offline) or green (ok) or yellow (warning) or red (emergency)”.

Sample request

Following is a sample REST/JSON request that can be handled by the  viewLastManualTestStatus operation.

Code Block
titleSample Request for viewLastManualTestStatus
collapsetrue
{
"clientId":"b44cdb3-f056-4c5b-b8a5-e3fd2c6d055f",
"clientSecret":"fjdp7dKJ7p8ipXhAmjNIeF9R",
"code":"E9GW2BQH",
"apiUrl":"https://firebase-apiserver01-tah01-iad01.dapi.production.nest.com:9553",
"device":"smoke_co_alarms",
"deviceId":"VhVmm7HOhEcL5sSzblcDOMMSoJ03t2br",
"operation":"viewLastManualTestStatus"
}

Anchor
viewLastManualTestTimestamp
viewLastManualTestTimestamp
View Last Manual Test Time Stamp

This operation retrieves the time stamp of the last successful manual smoke and CO alarm test, in ISO 8601 format. This property is read-only with Smoke+CO read permission.

Sample request

Following is a sample REST/JSON request that can be handled by the  viewLastManualTestTimestamp operation.

Code Block
titleSample Request for viewLastManualTestTimestamp
collapsetrue
{
"clientId":"b44cdb3-f056-4c5b-b8a5-e3fd2c6d055f",
"clientSecret":"fjdp7dKJ7p8ipXhAmjNIeF9R",
"code":"E9GW2BQH",
"apiUrl":"https://firebase-apiserver01-tah01-iad01.dapi.production.nest.com:9553",
"device":"smoke_co_alarms",
"deviceId":"VhVmm7HOhEcL5sSzblcDOMMSoJ03t2br",
"operation":"viewLastManualTestTimestamp"
}

Anchor
viewOnlineStatus
viewOnlineStatus
View Online Status

This operation retrieves the device connection status with the Nest Service. This property is read-only with Smoke+CO read permission. It can be true or false.

Sample request

Following is a sample REST/JSON request that can be handled by the  viewOnlineStatus operation.

Code Block
titleSample Request for viewOnlineStatus
collapsetrue
{
"clientId":"b44cdb3-f056-4c5b-b8a5-e3fd2c6d055f",
"clientSecret":"fjdp7dKJ7p8ipXhAmjNIeF9R",
"code":"E9GW2BQH",
"apiUrl":"https://firebase-apiserver01-tah01-iad01.dapi.production.nest.com:9553",
"device":"smoke_co_alarms",
"deviceId":"VhVmm7HOhEcL5sSzblcDOMMSoJ03t2br",
"operation":"viewOnlineStatus"
}

Anchor
viewLastConnectionInformation
viewLastConnectionInformation
View Last Connection Information

This operation retrieves the time stamp of the last successful interaction with the Nest service, in ISO 8601 format. This property is read-only with Smoke+CO read permission.

Sample request

Following is a sample REST/JSON request that can be handled by the  viewLastConnectionInformation operation.

Code Block
titleSample Request for viewLastConnectionInformation
collapsetrue
{
"clientId":"b44cdb3-f056-4c5b-b8a5-e3fd2c6d055f",
"clientSecret":"fjdp7dKJ7p8ipXhAmjNIeF9R",
"code":"E9GW2BQH",
"apiUrl":"https://firebase-apiserver01-tah01-iad01.dapi.production.nest.com:9553",
"device":"smoke_co_alarms",
"deviceId":"VhVmm7HOhEcL5sSzblcDOMMSoJ03t2br",
"operation":"viewLastConnectionInformation"
}

Anchor
sampleconfiguration
sampleconfiguration
Sample configuration

Following is a sample proxy service that illustrates how to connect to Nest with the init and getAccessToken operations to use the getServices operation. The sample request for this proxy can be found in viewCOAlarmState sample request.

Code Block
titleSample Proxy
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="nest_getServices"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
    <target>
        <inSequence>
            <property name="device" expression="json-eval($.device)"/>
            <property name="deviceId" expression="json-eval($.deviceId)"/>
            <property name="operation" expression="json-eval($.operation)"/>
            <property name="structureId" expression="json-eval($.structureId)"/>
            <property name="clientId" expression="json-eval($.clientId)"/>
            <property name="clientSecret" expression="json-eval($.clientSecret)"/>
            <property name="code" expression="json-eval($.code)"/>
            <property name="apiUrl" expression="json-eval($.apiUrl)"/>
           <nest.init>
                <apiUrl>{$ctx:apiUrl}</apiUrl>
           </nest.init>
            <nest.getAccessToken>
                <clientId>{$ctx:clientId}</clientId>
                <clientSecret>{$ctx:clientSecret}</clientSecret>
                <code>{$ctx:code}</code>
            </nest.getAccessToken>
            <nest.getServices>
                <device>{$ctx:device}</device>
                <deviceId>{$ctx:deviceId}</deviceId>
                <operation>{$ctx:operation}</operation>
                <structureId>{$ctx:structureId}</structureId>
            </nest.getServices>
            <respond/>
        </inSequence>
        <outSequence>
            <log/>
            <send/>
        </outSequence>
    </target>
    <description/>
</proxy>