This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Working with Smoke + CO Alarms in Nest
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.
Operation | Description |
---|---|
viewCOAlarmState | Retrieves the status of the CO alarm. |
viewSmokeAlarmState | Retrieves the status of the smoke alarm. |
viewBatteryHealth | Retrieves battery health state . |
viewManualTestState | Retrieves last manual test status. |
viewLastManualTestStatus | Retrieves test status of last manual test. |
viewLastManualTestTimestamp | Retrieves time stamp of last manual test. |
viewOnlineStatus | Retrieves the online status . |
viewLastConnectionInformation | Retrieves the last connection information . |
Operation details
This section provides the details on each operation related to Smoke and CO alarms.
- All operations in Smoke and CO Alarms use
getServices
method with relevant properties. structureId
is not needed for the operations of Smoke and CO Alarms.
<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.
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”.
Sample request
Following is a sample REST/JSON request that can be handled by the viewCOAlarmState
operation.
{ "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" }
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.
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.
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.
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.
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.
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.
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.
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.
<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>