智能家居 LightEffects 特征架构

action.devices.traits.LightEffects - 此特征属于可支持通过复杂的照明命令更改状态(例如循环遍历各种颜色)的设备。

设备属性

具有此特征的设备可能会在 SYNC 操作过程中报告以下属性。如需详细了解如何处理 SYNC intent,请参阅 intent 执行方式

属性 类型 说明
defaultColorLoopDuration 整数

(默认值:1800

action.devices.commands.ColorLoop 命令触发的效果的默认时长(以秒为单位)。

defaultSleepDuration 整数

(默认值:1800

action.devices.commands.Sleep 命令触发的效果的默认时长(以秒为单位)。

defaultWakeDuration 整数

(默认值:1800

action.devices.commands.Wake 命令触发的效果的默认时长(以秒为单位)。

supportedEffects 数组

必填。

设备支持的效果列表。

[item, ...] String

支持的效果。

支持的值:

colorLoop
随机循环遍历各种颜色。
sleep
逐步降低亮度,并根据需要调整色温。
wake
逐步提高亮度,并且可以选择性地调整一段时间的色温。

示例

设备支持色彩循环效果

{
  "supportedEffects": [
    "colorLoop"
  ]
}

支持睡眠/唤醒效果的设备。

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

设备状态

具有此特征的实体可能会在 QUERY 操作过程中报告以下状态。如需详细了解如何处理 QUERY intent,请参阅 intent 执行方式

类型 说明
activeLightEffect String

当前的活跃灯光效果(如果有)。supportedEffects 中的一个。

支持的值:

colorLoop
sleep
wake
lightEffectEndUnixTimestampSec 整数

效果预计结束时的 Unix 时间戳(如果效果自行结束)。

示例

我的设备目前有什么影响?

{
  "activeLightEffect": "colorLoop"
}

我的设备目前有什么影响?

{
  "activeLightEffect": "sleep",
  "lightEffectEndUnixTimestampSec": 1595286869
}

目前没有启用光线效果。

{}

设备命令

具有此特征的设备可能会在 EXECUTE 操作过程中响应以下命令。如需详细了解如何处理 EXECUTE intent,请参阅 intent 执行方式

action.devices.commands.ColorLoop

请求设备循环切换一组颜色。

此命令需要以下特性:
{
  "supportedEffects": [
    "colorLoop"
  ]
}

参数

参数 类型 说明
duration 整数

颜色循环命令的时长(以秒为单位)。

示例

将我的灯具彩色循环 60 分钟。

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

action.devices.commands.Sleep

逐渐降低设备的亮度,并根据需要调整色温。

此命令需要以下特性:
{
  "supportedEffects": [
    "sleep"
  ]
}

参数

参数 类型 说明
duration 整数

休眠命令的持续时间,以秒为单位。

示例

把我的灯设为休眠 60 分钟。

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

action.devices.commands.StopEffect

停止当前的灯光效果。

参数

参数 类型 说明

没有属性

示例

停止对灯具效果。

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

action.devices.commands.Wake

逐渐提高设备的亮度,并且可以选择在一段时间内调整色温。

此命令需要以下特性:
{
  "supportedEffects": [
    "wake"
  ]
}

参数

参数 类型 说明
duration 整数

唤醒命令的持续时间(以秒为单位)。

示例

让我的灯亮起 60 分钟。

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

灯光效果模拟

如果您的设备实现了 Brightness 特征,但未实现 LightEffects 特征,平台支持模拟的“睡眠”和“唤醒”效果,而无需额外的代码。 平台通过发送一系列 EXECUTE intent 来模拟这些效果。

示例话语

de-DE

  • Den Aufwacheffekt der Lampen starten.
  • Einschlafmodus im Schlafzimmer aktivieren.
  • synchronisiere meine Geräte

en-US

  • Begin the sleep effect on my lights .
  • I want you to start wake effect on the lights

es-ES

  • pon la luz de despertarse lentamente durante 45 minutos
  • pon las luces de dormir

fr-FR

  • Allume doucement les lumières .
  • Éteins progressivement les lumières .

hi-IN

  • बेडरूम में धीरे-धीरे रोशनी बढ़ाओ
  • लाइट को स्लीप मोड में डाल दो

it-IT

  • Accendi le luci gradualmente
  • Avvia le luci per dormire

ja-JP

  • ライト を徐々に明るくなる設定にして
  • 照明 を少しずつ暗くして

ko-KR

  • 안방 전등 기상 모드 시작해
  • 조명 에서 수면 모드 실행

nl-NL

  • Dim de lichten langzaam.
  • Laat mijn lamp langzaam feller worden.

pt-BR

  • Acenda lentamente as luzes do quarto por 1 hora .
  • Ativa as luzes de despertar no quarto dos miudos .
  • Iniciar o modo dormir por 1 hora nas luzes do quarto .
  • Liga a função adormecer das luzes .

sv-SE

  • Starta insomningsläge på lamporna
  • Tänd lamporna långsamt

设备出错

查看错误和异常的完整列表。