Smart Home Brightness Trait Schema

action.devices.traits.Brightness - This trait covers how to control the brightness of a device. Absolute brightness setting is in a normalized range from 0 to 100 (individual lights may not support every point in the range based on their LED configuration).

Device ATTRIBUTES

None

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.LIGHT",
      "traits": [
        "action.devices.traits.Brightness"
      ],
      "name": {
        "defaultNames": ["AAA bulb A19 color hyperglow"],
        "name": "lamp1",
        "nicknames": ["reading lamp"]
      },
      "willReportState": true,
      "deviceInfo": {
        "manufacturer": "AAA",
        "model": "hg11",
        "hwVersion": "1.2",
        "swVersion": "5.4"
      },
      "customData": {
        "fooValue": 12,
        "barValue": false,
        "bazValue": "dancing alpaca"
      }
    }]
  }
}
Validator

Device STATES

State Definition
brightness Integer. Current brightness level. Ideally, this is the number that was set versus the rounded point (for example, if the user sets it to 65%, but the device has to round to 10% increments, ideally this would still return 65%).

Sample QUERY Request and Response

What is the brightness level of my light?
Request
{
  "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
  "inputs": [{
    "intent": "action.devices.QUERY",
    "payload": {
      "devices": [{
        "id": "123",
        "customData": {
            "fooValue": 74,
            "barValue": true,
            "bazValue": "lambtwirl"
        }
      }]
    }
  }]
}
Response
{
  "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
  "payload": {
    "devices": {
      "123": {
        "online": true,
        "brightness": 65
      }
    }
  }
}

Device COMMANDS

Command Parameters/Definition
action.devices.commands.BrightnessAbsolute brightness Integer. Required. New absolute brightness, from 0 to 100.

Sample EXECUTE Request and Response

Adjust my light to 65% brightness.
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.BrightnessAbsolute",
          "params": {
            "brightness": 65
          }
        }]
      }]
    }
  }]
}
Response
{
  "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
  "payload": {
    "commands": [{
      "ids": ["123"],
      "status": "SUCCESS",
      "states": {
        "brightness": 65
      }
    }]
  }
}