Smart Home StartStop Trait Schema

action.devices.traits.StartStop - This trait covers starting and stopping the device.

Starting and stopping a device serves a similar function to turning it on and off. Devices that inherit this trait function differently when turned on and when started. Certain washing machines, for instance, are able to be turned on and have their settings modified before actually starting operation.

Unlike devices that simply have an on and off state, some devices that can start and stop are also able to pause while performing an operation. Devices that can pause will cease operation, but upon resume will continue in the same state as when they were paused. Unpausing differs from starting/restarting as regardless of the current state of the device, this will begin operation from the beginning.

Device ATTRIBUTES

Attribute Definition
pausable Boolean indicating whether the device can be paused during operation.

Sample SYNC Request and Response

Request
{
  "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
  "inputs": [{
    "intent": "action.devices.SYNC",
  }]
}
Response
{
  "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
  "payload": {
    "agentUserId": "1836.15267389",
    "devices": [{
      "id": "123",
      "type": "action.devices.types.WASHER",
      "traits": [
        "action.devices.traits.StartStop"
      ],
      "name": {
        "defaultNames": ["Sirius Cybernetics Corporation Washer 3421"],
        "name": "Washer",
        "nicknames": ["clothes washer"]
      },
      "willReportState": true,
      "attributes": {
        "pausable": true
      },
      "deviceInfo": {
        "manufacturer": "AAA Cybernetics Corporation",
        "model": "233451",
        "hwVersion": "3.2",
        "swVersion": "11.4"
      },
      "customData": {
        "fooValue": 74,
        "barValue": true,
        "bazValue": "lambtwirl"
      }
    }]
  }
}
Validator

Device STATES

State Definition
isRunning Whether the device is currently in operation.
isPaused Whether the device is explicitly paused. Note that paused implies isRunning is false but can be resumed.

Sample QUERY Request and Response

Request
{
  "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
  "inputs": [{
      "intent": "action.devices.QUERY",
      "payload": {
        "devices": [{
          "id": "123"
        }]
      }
  }]
}
Response
{
  "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
  "payload": {
    "devices": {
      "123": {
        "online": true,
        "isPaused": true,
        "isRunning": false
      }
    }
  }
}

Device COMMANDS

Command Parameters/Definition
action.devices.commands.StartStop start Boolean. True when command is to start, false to stop.
action.devices.commands.PauseUnpause pause Boolean. True when command is to pause, false to unpause.

Sample EXECUTE Request and Response

Start the washing machine.
Request
{
  "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
  "inputs": [{
    "intent": "action.devices.EXECUTE",
    "payload": {
      "commands": [{
        "devices": [{
          "id": "123",
          "customData": {
            "fooValue": 74,
            "barValue": true,
            "bazValue": "sheepdip"
          }
        }],
        "execution": [{
          "command": "action.devices.commands.StartStop",
          "params": {
            "start": true
            }
          }
        }]
      }]
    }
  }]
}
Response
{
  "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
  "payload": {
    "commands": [{
      "ids": ["123"],
      "status": "SUCCESS",
      "states": {
         "isRunning": true,
         "isPaused": false
      }
    }]
  }
}
Pause the vacuum.
Request
{
  "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
  "inputs": [{
    "intent": "action.devices.EXECUTE",
    "payload": {
      "commands": [{
        "devices": [{
          "id": "123",
          "customData": {
            "fooValue": 74,
            "barValue": true,
            "bazValue": "sheepdip"
          }
        }],
        "execution": [{
          "command": "action.devices.commands.PauseUnpause",
          "params": {
            "pause": true
            }
          }
        }]
      }]
    }
  }]
}
Response
{
  "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
  "payload": {
    "commands": [{
      "ids": ["123"],
      "status": "SUCCESS",
      "states": {
         "isRunning": true,
         "isPaused": true
      }
    }]
  }
}

Device ERRORS

The error codes extend the primary list in the DevGuide. Additional errors will be added as needed.

unpausableState - The user tried to pause a device with the pausable trait, but the device is in some state that it cannot be paused.