Skip to content

cloud.smarthq.service.environmental.sensor

  • Configuration


    Describes boundaries and fixed properties for the service.

    Go There

  • State


    A list of the states this service can be in.

    Go There

  • Commands


    How to change the state of the service.

    Go There

  • Data Types


    All the data types used for this service.

    Go There

Description

Service that represents the functionality of the environmental sensors

Example Device Response (Digital Twin API)

Service representing the functionality of the environmental sensors

{
  "adapterId": "0000000000000000000000000000000000000000",
  "alertTypes": [],
  "createdDateTime": "2022-03-04T12:12:12.123Z",
  "deviceId": "0000000000000000000000000000000000000000000000000000000000000000",
  "deviceType": "cloud.smarthq.device.appliance",
  "gatewayId": "0000000000000000000000000000000000000000000000000000000000000000",
  "kind": "device#item",
  "lastPresenceTime": "2022-03-04T12:12:12.123Z",
  "lastSyncTime": "2022-03-04T12:12:12.123Z",
  "presence": "OFFLINE",
  "removable": true,
  "services": [
    {
      "serviceType": "cloud.smarthq.service.environmental.sensor",
      "lastSyncTime": "2022-03-04T12:12:12.123Z",
      "domainType": "cloud.smarthq.domain.sensor.voc",
      "supportedCommands": [
        "cloud.smarthq.command.environmental.sensor.updateperiod.set",
        "cloud.smarthq.command.environmental.sensor.index.set"
      ],
      "state": {
        "updatePeriodValue": 10.0,
        "stateValue": 1.0,
        "indexValue": 100.0,
        "airQualityValue": 5.0
      },
      "serviceId": "0000000000000000000000000000000000000000000000000000000000000000",
      "serviceDeviceType": "cloud.smarthq.device.appliance",
      "config": {
        "indexValueUnits": "cloud.smarthq.type.integerunits.unitless",
        "updatePeriodUnits": "cloud.smarthq.type.integerunits.minutes",
        "updatePeriodMaximum": 255.0,
        "indexValueMaximum": 255.0,
        "indexValueMinimum": 0.0,
        "updatePeriodMinimum": 0.0
      },
      "lastStateTime": "2022-03-04T12:12:12.123Z"
    }
  ],
  "userId": "000000000000000"
}

Configuration

The following are properties for the gateway/device sync as part of the "config" object for each individual service.

Field Name Property Type Required
indexValueMaximum INTEGER No
indexValueMinimum INTEGER No
indexValueUnits INTEGER_UNITS No
updatePeriodMaximum INTEGER No
updatePeriodMinimum INTEGER No
updatePeriodUnits INTEGER_UNITS No

State

The following are properties for the device state report as part of the "state" object for each individual service.

Field Name Property Type Required
airQualityValue INTEGER Yes
disabled BOOLEAN No
indexValue INTEGER Yes
stateValue INTEGER Yes
updatePeriodValue INTEGER Yes

Commands

The following are properties for both the Digital Twin API to send a command to the device as well as the properties passed as part of a command to the gateway to be processed by the device itself.

cloud.smarthq.command.environmental.sensor.updateperiod.set

Command used to set the idle update period time in environmental sensors

Field Name Property Type Required
value INTEGER Yes

Example Commands

Command to set the idle period time to update environmental sensors index values.

{
  "command": {
    "commandType": "cloud.smarthq.command.environmental.sensor.updateperiod.set",
    "value": 5.0
  },
  "deviceId": "00000000000000000000000000000000000000000000000000000000000000",
  "domainType": "cloud.smarthq.domain.sensor.voc",
  "kind": "service#command",
  "serviceDeviceType": "cloud.smarthq.device.appliance",
  "serviceType": "cloud.smarthq.service.environmental.sensor"
}

Supported Outcomes

Each service has an allow listed set of outcomes that the device may return when asked to execute a command.

Outcome Documentation
cloud.smarthq.outcome.badrequest The request was invalid.
cloud.smarthq.outcome.developererror Only used when there is a server side bug
cloud.smarthq.outcome.deviceoffline The device is offline.
cloud.smarthq.outcome.forbidden The request is forbidden due to permissions.
cloud.smarthq.outcome.internalerror The server had an issue processing the request
cloud.smarthq.outcome.missingconfig The service config is missing
cloud.smarthq.outcome.missingstate The service state is missing
cloud.smarthq.outcome.notallowed The command is not allowed.
cloud.smarthq.outcome.notfound The request is forbidden due to permissions.
cloud.smarthq.outcome.notsupported The command is not supported.
cloud.smarthq.outcome.outofbounds General out of bounds error
cloud.smarthq.outcome.servicedisabled Feature is currently disabled
cloud.smarthq.outcome.success Successful request
cloud.smarthq.outcome.timeout The server experienced timeout waiting for a response from the gateway

cloud.smarthq.command.environmental.sensor.index.set

Command used to update the index value in environmental sensors

Field Name Property Type Required
value INTEGER Yes

Example Commands

Command to request the update of the environmental sensors index value.

{
  "command": {
    "commandType": "cloud.smarthq.command.environmental.sensor.index.set",
    "value": 1.0
  },
  "deviceId": "00000000000000000000000000000000000000000000000000000000000000",
  "domainType": "cloud.smarthq.domain.sensor.voc",
  "kind": "service#command",
  "serviceDeviceType": "cloud.smarthq.device.appliance",
  "serviceType": "cloud.smarthq.service.environmental.sensor"
}

Supported Outcomes

Each service has an allow listed set of outcomes that the device may return when asked to execute a command.

Outcome Documentation
cloud.smarthq.outcome.badrequest The request was invalid.
cloud.smarthq.outcome.developererror Only used when there is a server side bug
cloud.smarthq.outcome.deviceoffline The device is offline.
cloud.smarthq.outcome.forbidden The request is forbidden due to permissions.
cloud.smarthq.outcome.internalerror The server had an issue processing the request
cloud.smarthq.outcome.missingconfig The service config is missing
cloud.smarthq.outcome.missingstate The service state is missing
cloud.smarthq.outcome.notallowed The command is not allowed.
cloud.smarthq.outcome.notfound The request is forbidden due to permissions.
cloud.smarthq.outcome.notsupported The command is not supported.
cloud.smarthq.outcome.outofbounds General out of bounds error
cloud.smarthq.outcome.servicedisabled Feature is currently disabled
cloud.smarthq.outcome.success Successful request
cloud.smarthq.outcome.timeout The server experienced timeout waiting for a response from the gateway

Data Types

BOOLEAN

Value must be either true or false.

INTEGER

Value must be an integer. Field specific restrictions such as a minimum and maximum may apply depending on the field.

INTEGER_UNITS

INTEGER_UNITS Documentation
cloud.smarthq.type.integerunits.cfm Cubic feet per minute
cloud.smarthq.type.integerunits.count Integer count
cloud.smarthq.type.integerunits.dbm Decibel milliwatts
cloud.smarthq.type.integerunits.gallons Gallons
cloud.smarthq.type.integerunits.hours Hours
cloud.smarthq.type.integerunits.kwh Kilo watt hour
cloud.smarthq.type.integerunits.level level
cloud.smarthq.type.integerunits.minutes Minutes
cloud.smarthq.type.integerunits.ounces Ounces
cloud.smarthq.type.integerunits.ounces.fluid Fluid ounces
cloud.smarthq.type.integerunits.percentage Percentage
cloud.smarthq.type.integerunits.rpm Revolutions per Minute
cloud.smarthq.type.integerunits.seconds Seconds
cloud.smarthq.type.integerunits.thermostatsignalv1 Thermostat Signal v1
cloud.smarthq.type.integerunits.unitless unitless
cloud.smarthq.type.integerunits.watts Watts