Smart Home Brightness Trait Schema

action.devices.traits.Brightness - This trait covers how to control the brightness of a device.

Device ATTRIBUTES

Devices with this trait may report the following attributes as part of the SYNC operation. To learn more about handling SYNC intents, see Intent fulfillment.

Attributes Type Description
commandOnlyBrightness Boolean

(Default: false)

Indicates if the device supports using one-way (true) or two-way (false) communication. Set this attribute to true if the device cannot respond to a QUERY intent or Report State for this trait.

Examples

Device that supports for brightness commands, states query and reporting.

Device that only support for brightness commands.

{
  "commandOnlyBrightness": true
}

Device STATES

Devices with this trait may report the following states as part of the QUERY operation. To learn more about handling QUERY intents, see Intent fulfillment.

States Type Description
brightness Integer

Current brightness level of the device.

Examples

What is the brightness level of my light?

{
  "brightness": 65
}

Device COMMANDS

Devices with this trait may respond to the following commands as part of the EXECUTE operation. To learn more about handling EXECUTE intents, see Intent fulfillment.

action.devices.commands.BrightnessAbsolute

Adjust device absolute brightness.

Parameters

Parameters Type Description
brightness Integer

Required.

New absolute brightness percentage.

Examples

Adjust my light to 65% brightness.

{
  "command": "action.devices.commands.BrightnessAbsolute",
  "params": {
    "brightness": 65
  }
}

action.devices.commands.BrightnessRelative

Adjust device relative brightness.

This command requires the following attributes:
{
  "commandOnlyBrightness": true
}

Parameters

The payload contains one of the following:

Percentage relative adjustment.

Parameters Type Description
brightnessRelativePercent Integer

Required.

The exact percentage of brightness to change.

Weight relative adjustment.

Parameters Type Description
brightnessRelativeWeight Integer

Required.

This indicates the ambiguous amount of the brightness change. From small amount to large amount, this param will be scaled to integer 0 to 5, with the sign to indicate direction.

Examples

Brighten my light by 20%.

{
  "command": "action.devices.commands.BrightnessRelative",
  "params": {
    "brightnessRelativePercent": 20
  }
}

Dim my light a little.

{
  "command": "action.devices.commands.BrightnessRelative",
  "params": {
    "brightnessRelativeWeight": -1
  }
}

Device ERRORS

See the full list of errors and exceptions.