Skip to main content

COSmokeSensor

1.COSmokeSensor.getState

Get CO&Smoke Sensor's State

BDDP

ParamValueDesc
methodCOSmokeSensor.getStateGet device's state
targetDevice<String,Necessary>DeviceId of the Sensor;
token<String,Necessary>Net token of the Sensor; You can get it here

BUDP

ParamValueDesc
data.state.online<Boolean,Necessary>Is device online
data.state.state<Boolean,Necessary>Alert state of device
data.state.state.unexpected<Boolean,Necessary>Unexpected error detected, base cannot connect to sensor
data.state.state.sLowBattery<Boolean,Necessary>Battery of sensor is low
data.state.state.smokeAlarm<Boolean,Necessary>Smoke detected
data.state.state.gasAlarm<Boolean,Necessary>CO detected
data.state.state.highTempAlarm<Boolean,Necessary>High temperature(over 57โ„ƒ) detected,
data.state.state.silence<Boolean,Necessary>Reserve
data.state.battery<String,Necessary>Level of base's battery, 0 to 4 means empty to full
data.state.interval<Integer,Optional>Interval of Continuous Alert
data.state.metadata.inspect<Boolean,Optional>This is the result of self-checking
data.state.devTemperature<Integer,Necessary>Current temperature
data.state.sche<Object,Necessary>Schedule of self-checking
data.state.sche.type<String,Necessary>["disable","weekly","monthly"]
data.state.sche.day<Integer,Necessary>Active day of schedule, 0-6 for weekly and 0-27 for monthly
data.state.sche.time<String,Necessary>Time of schedule, HH:MM formatted
data.state.version<String,Necessary>Firmware Version of device
data.reportAt<Date,Necessary>The time that this reported
data.deviceId<String,Necessary>Device EUI

2.COSmokeSensor.setState

Set CO&Smoke Sensor's State

BDDP

ParamValueDesc
methodCOSmokeSensor.setStateSet sensor's State
targetDevice<String,Necessary>DeviceId of the sensor you use;
token<String,Necessary>Net token of the sensor you use;
params.inspect<Boolean,Necessary>Let the device start self-checking.

BUDP

ParamValueDesc

3.COSmokeSensor.setSchedule

Set the scheduled self-checking

BDDP

ParamValueDesc
methodCOSmokeSensor.setScheduleSet Schedule.
targetDevice<String,Necessary>DeviceId of the sensor you use;
token<String,Necessary>Net token of the sensor you use;
params.type<String,Necessary>One of ["disable","weekly","monthly"], "disable" means disable scheduled self-checking ;"weekly" means automatically run self-checking once a week;"monthly" means automatically run self-checking once a month;
params.day<Integer,Necessary>Specify the day of schedule. Effective when schedule is enabled;
params.time<String,Necessary>Specify the time of schedule.; HH:mm formatted; Effective when schedule is enabled;

BUDP

ParamValueDesc

4.Callbacks

You can receive it with Http Callback API or MQTT report topic

BUDP

<Same as 1.COSmokeSensor.getState>