Smart Home LightEffects Trait Schema

action.devices.traits.LightEffects - This trait belongs to devices that can support complex lighting commands to change state, such as looping through various colors.

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
defaultSleepDuration Integer

(Default: 1800)

The default duration, in seconds, for the effect triggered by the action.devices.commands.Sleep command.

defaultWakeDuration Integer

(Default: 1800)

The default duration, in seconds, for the effect triggered by the action.devices.commands.Wake command.

supportedEffects Array

Required.

List of the effects that the device supports.

[item, ...] String

Supported effect.

Supported values:

colorLoop
Loops through various colors randomly.
sleep
Gradually lowers brightness and, optionally, adjusts the color temperature over a period of time.
wake
Gradually increases brightness and, optionally, adjusts the color temperature over a period of time.

Examples

Device supporting color loop effect.

{
  "supportedEffects": [
    "colorLoop"
  ]
}

Device supporting sleep/wake effects.

{
  "defaultSleepDuration": 300,
  "defaultWakeDuration": 600,
  "supportedEffects": [
    "sleep",
    "wake"
  ]
}

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
activeLightEffect String

Required.

Currently active light effect. One of supportedEffects.

Supported values:

colorLoop
sleep
wake

Examples

What is the current effect on my device?

{
  "activeLightEffect": "colorLoop"
}

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

Request the device to cycle through a set of colors.

This command requires the following attributes:
{
  "supportedEffects": [
    "colorLoop"
  ]
}

Parameters

Parameters Type Description
duration Integer

Duration for the color loop command, in seconds.

Examples

Colorloop my lights for 60 minutes.

{
  "command": "action.devices.commands.ColorLoop",
  "params": {
    "duration": 3600
  }
}

action.devices.commands.Sleep

Gradually lower the device's brightness and, optionally, adjusts the color temperature over a duration of time.

This command requires the following attributes:
{
  "supportedEffects": [
    "sleep"
  ]
}

Parameters

Parameters Type Description
duration Integer

Duration for the sleep command, in seconds.

Examples

Make my lights sleep for 60 minutes.

{
  "command": "action.devices.commands.Sleep",
  "params": {
    "duration": 3600
  }
}

action.devices.commands.StopEffect

Stop the current light effect.

Parameters

Parameters Type Description

No properties

Examples

Stop the effect on my light.

{
  "command": "action.devices.commands.StopEffect",
  "params": {}
}

action.devices.commands.Wake

Gradually increase the device's brightness and, optionally, adjusts the color temperature over a duration of time.

This command requires the following attributes:
{
  "supportedEffects": [
    "wake"
  ]
}

Parameters

Parameters Type Description
duration Integer

Duration for the wake command, in seconds.

Examples

Make my lights wake for 60 minutes.

{
  "command": "action.devices.commands.Wake",
  "params": {
    "duration": 3600
  }
}

Light effects emulation

If your device implements the Brightness trait but not the LightEffects trait, the platform supports emulated "sleep" and "wake" effects, without the need for additional code. The platform emulates the effects by sending a series of EXECUTE intents.

Device ERRORS

See the full list of errors and exceptions.