...
...
OverviewThe 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.
Anchor |
---|
| OperationDetails |
---|
| OperationDetails |
---|
|
Operation detailsThis section provides the details on each operation related to Smoke and CO alarms.
...
Code Block |
---|
language | xml |
---|
title | getServices |
---|
|
<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 StateThis 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 requestFollowing is a sample REST/JSON request that can be handled by the viewCOAlarmState
operation.
Code Block |
---|
title | Sample 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 StateThis 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 |
---|
title | Sample Request for viewSmokeAlarmState |
---|
collapse | true |
---|
|
{
"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 HealthThis 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 |
---|
title | Sample Request for viewBatteryHealth |
---|
collapse | true |
---|
|
{
"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 StateThis 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 |
---|
title | Sample Request for viewManualTestState |
---|
collapse | true |
---|
|
{
"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 StatusThis 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 |
---|
title | Sample Request for viewLastManualTestStatus |
---|
collapse | true |
---|
|
{
"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 StampThis 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 |
---|
title | Sample Request for viewLastManualTestTimestamp |
---|
collapse | true |
---|
|
{
"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 StatusThis 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 |
---|
title | Sample Request for viewOnlineStatus |
---|
collapse | true |
---|
|
{
"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 InformationThis 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 |
---|
title | Sample Request for viewLastConnectionInformation |
---|
collapse | true |
---|
|
{
"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 configurationFollowing 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 |
---|
|
<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> |