Skip to content

cloud.smarthq.service.schedule.v1

  • 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 for setting weekly schedules

Example Device Response (Digital Twin API)

Service for scheduled actions.

{
  "adapterId": "0000000000000000000000000000000000000000",
  "alertTypes": [],
  "createdDateTime": "2022-03-04T12:12:12.123Z",
  "deviceId": "0000000000000000000000000000000000000000000000000000000000000000",
  "deviceType": "cloud.smarthq.device.plug",
  "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.schedule.v1",
      "lastSyncTime": "2022-03-04T12:12:12.123Z",
      "domainType": "cloud.smarthq.domain.power",
      "supportedCommands": [
        "cloud.smarthq.command.schedule.v1.set",
        "cloud.smarthq.command.schedule.v1.remove",
        "cloud.smarthq.command.schedule.v1.enable",
        "cloud.smarthq.command.schedule.v1.disable"
      ],
      "state": {
        "schedules": [
          {
            "daysActive": [
              "monday",
              "wednesday"
            ],
            "onActionEnabled": true,
            "scheduleIndex": 1.0,
            "onTime": 300.0,
            "offActionEnabled": true,
            "offTime": 1000.0,
            "enabled": true
          }
        ]
      },
      "serviceId": "0000000000000000000000000000000000000000000000000000000000000000",
      "serviceDeviceType": "cloud.smarthq.device.plug",
      "config": {
        "minScheduleIndex": 1.0,
        "maxScheduleIndex": 15.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 Minimum Maximum
maxScheduleIndex INTEGER Yes 15 15
minScheduleIndex INTEGER Yes 1 1

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 Maximum Items
schedules SCHEDULES Yes 15

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.schedule.v1.set

Command used to set a weekly schedule.

Field Name Property Type Required Maximum Items
schedules SCHEDULES Yes 15

Example Commands

Command to set a weekly schedule.

{
  "command": {
    "commandType": "cloud.smarthq.command.schedule.v1.set",
    "schedules": [
      {
        "daysActive": [
          "monday",
          "wednesday"
        ],
        "onActionEnabled": true,
        "scheduleIndex": 1.0,
        "onTime": 300.0,
        "offActionEnabled": true,
        "offTime": 1000.0,
        "enabled": true
      }
    ]
  },
  "deviceId": "00000000000000000000000000000000000000000000000000000000000000",
  "domainType": "cloud.smarthq.domain.power",
  "kind": "service#command",
  "serviceDeviceType": "cloud.smarthq.device.plug",
  "serviceType": "cloud.smarthq.service.schedule.v1"
}

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.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.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.schedule.v1.remove

Command used to remove a weekly schedule.

Field Name Property Type Required Minimum Maximum
scheduleIndex INTEGER Yes 1 15

Example Commands

Command to remove a weekly schedule.

{
  "command": {
    "commandType": "cloud.smarthq.command.schedule.v1.remove",
    "scheduleIndex": 1.0
  },
  "deviceId": "00000000000000000000000000000000000000000000000000000000000000",
  "domainType": "cloud.smarthq.domain.power",
  "kind": "service#command",
  "serviceDeviceType": "cloud.smarthq.device.plug",
  "serviceType": "cloud.smarthq.service.schedule.v1"
}

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.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.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.schedule.v1.enable

Command used to enable a weekly schedule.

Field Name Property Type Required Minimum Maximum
scheduleIndex INTEGER Yes 1 15

Example Commands

Command to enable a weekly schedule.

{
  "command": {
    "commandType": "cloud.smarthq.command.schedule.v1.enable",
    "scheduleIndex": 1.0
  },
  "deviceId": "00000000000000000000000000000000000000000000000000000000000000",
  "domainType": "cloud.smarthq.domain.power",
  "kind": "service#command",
  "serviceDeviceType": "cloud.smarthq.device.plug",
  "serviceType": "cloud.smarthq.service.schedule.v1"
}

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.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.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.schedule.v1.disable

Command used to disable a weekly schedule.

Field Name Property Type Required Minimum Maximum
scheduleIndex INTEGER Yes 1 15

Example Commands

Command to disable a weekly schedule.

{
  "command": {
    "commandType": "cloud.smarthq.command.schedule.v1.disable",
    "scheduleIndex": 1.0
  },
  "deviceId": "00000000000000000000000000000000000000000000000000000000000000",
  "domainType": "cloud.smarthq.domain.power",
  "kind": "service#command",
  "serviceDeviceType": "cloud.smarthq.device.plug",
  "serviceType": "cloud.smarthq.service.schedule.v1"
}

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.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.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

INTEGER

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

SCHEDULES

Value must be an array with a maximum of 15 JSON objects. Each object must have the following attributes: - scheduleIndex: integer value between 1 and 15 - enabled: boolean value - onActionEnabled: boolean value - offActionEnabled: boolean value - onTime: integer minute value between 0 and 1440 - offTime: integer minute value between 0 and 1440 - daysActive: array of strings