在 Android 上支持 Automation API trait

Android 版 Automation API 支持大多数特征,但对某些特征中的属性、事件和命令的支持可能有限。

如需验证 Automation API 是否支持您的使用情形,请在下表中搜索。

一般来说:

  • 您打算在应用中通过 Automation API 使用的任何特征和类型都必须在初始化时注册。请参阅创建 Home 实例
  • 任何属性都可用于启动方式或条件。
  • 不报告状态的 Cloud-to-cloud 设备无法用作自动化操作中的触发器,无论是手动创建的自动化操作还是通过发现创建的自动化操作。
  • 即使设备支持此处列出的特征,也可能因报告状态质量阈值而无法在 Automation API 中用作启动器或操作:

    • 如果设备的“报告状态”成功率低于 90%,则无法用作启动器。
    • 如果设备的命令执行成功率低于 95%,则无法用作操作。

    请参阅此设备型号列表,了解这些设备型号支持的特定启动器和操作(适用于 Automations API)。

  • 命令只能用作操作。

  • 某些特征(例如 AssistantBroadcast)仅适用于 Automation API。

  • okGoogle 命令是结构级命令,可用于自动执行结构中的任何设备。不过,Home API 应用可能无法访问所有设备。请参阅 OkGoogle 权限,了解在各种情况下如何强制执行权限。

  • 部分特质有前提条件:

    • 如需使用 Time.ScheduledTimeEvent,自动化操作运行的结构必须具有在 Google Home app (GHA) 中设置的街道地址。更改 Google 家庭住址一文介绍了用户如何输入结构化地址。如果未在 GHA 中设置地址,自动化操作将无法创建,并抛出一条错误消息:“structure 不支持 ScheduledTimeEvent。”
    • 如需使用 AreaPresenceStateAreaAttendanceState 特征,用户必须在 GHA 中设置在家/外出感知功能。
    • 如需使用 ObjectDetection 特征,用户必须拥有有效的 Nest Aware 订阅。

某些特征的简化版本也可用于自动化操作。 如需了解详情,请参阅 Android 上的简化特征

禁止表示相应命令不支持在自动化操作中用于一种或多种设备类型。如需了解详情,请参阅 Android 自动化中的受限操作

特征 特征类型 元素类型 元素
AssistantBroadcast google 命令 广播
AssistantFulfillment google 命令 OkGoogle
通知 google 命令 SendNotifications
时间 google 事件 ScheduledTimeEvent
时间 google 属性 currentTime
时间 google 属性 missingStructureLocation
时间 google 属性 sunriseTime
时间 google 属性 sunsetTime
VoiceStarter google 事件 OkGoogleEvent
AirQuality 事宜 属性 airQuality
ApplicationLauncher 事宜 命令 LaunchApp
ApplicationLauncher 事宜 命令 StopApp
ApplicationLauncher 事宜 属性 currentApp
AudioOutput 事宜 属性 currentOutput
BooleanState 事宜 事件 StateChange
BooleanState 事宜 属性 stateValue
CarbonDioxideConcentrationMeasurement 事宜 属性 levelValue
CarbonDioxideConcentrationMeasurement 事宜 属性 measuredValue
CarbonMonoxideConcentrationMeasurement 事宜 属性 levelValue
CarbonMonoxideConcentrationMeasurement 事宜 属性 maxMeasuredValue
CarbonMonoxideConcentrationMeasurement 事宜 属性 measuredValue
CarbonMonoxideConcentrationMeasurement 事宜 属性 measurementUnit
CarbonMonoxideConcentrationMeasurement 事宜 属性 minMeasuredValue
CarbonMonoxideConcentrationMeasurement 事宜 属性 不确定性
渠道 事宜 命令 ChangeChannelByNumber
渠道 事宜 命令 SkipChannel
ColorControl 事宜 命令 ColorLoopSet
ColorControl 事宜 命令 MoveColor
ColorControl 事宜 命令 MoveColorTemperature
ColorControl 事宜 命令 MoveToColor
ColorControl 事宜 命令 MoveToColorTemperature
ColorControl 事宜 命令 MoveToHue
ColorControl 事宜 命令 MoveToHueAndSaturation
ColorControl 事宜 命令 MoveToSaturation
ColorControl 事宜 命令 StepColor
ColorControl 事宜 命令 StepColorTemperature
ColorControl 事宜 属性 colorTemperatureMireds
ColorControl 事宜 属性 currentHue
ColorControl 事宜 属性 currentX
ColorControl 事宜 属性 currentY
DishwasherMode 事宜 命令 ChangeToMode
DishwasherMode 事宜 属性 currentMode
DishwasherMode 事宜 属性 onMode
DoorLock 事宜 事件 DoorLockAlarm
DoorLock 事宜 事件 DoorStateChange
DoorLock 事宜 命令 LockDoor
DoorLock 事宜 事件 LockOperation
DoorLock 事宜 事件 LockOperationError
DoorLock 事宜 命令 UnlockDoor
DoorLock 事宜 属性 doorClosedEvents
DoorLock 事宜 属性 doorOpenEvents
DoorLock 事宜 属性 doorState
DoorLock 事宜 属性 lockState
FanControl 事宜 命令 步骤
FanControl 事宜 属性 airflowDirection
FanControl 事宜 属性 fanMode
FanControl 事宜 属性 percentCurrent
FanControl 事宜 属性 percentSetting
FanControl 事宜 属性 speedCurrent
FanControl 事宜 属性 speedSetting
FanControl 事宜 属性 windSetting
甲醛浓度测量 事宜 属性 levelValue
甲醛浓度测量 事宜 属性 measuredValue
IlluminanceMeasurement 事宜 属性 measuredValue
LaundryWasherMode 事宜 命令 ChangeToMode
LaundryWasherMode 事宜 属性 currentMode
LaundryWasherMode 事宜 属性 onMode
LevelControl 事宜 命令 移动
LevelControl 事宜 命令 MoveToLevel
LevelControl 事宜 命令 MoveToLevelWithOnOff
LevelControl 事宜 命令 MoveWithOnOff
LevelControl 事宜 命令 步骤
LevelControl 事宜 命令 StepWithOnOff
LevelControl 事宜 命令 停止
LevelControl 事宜 命令 StopWithOnOff
LevelControl 事宜 属性 currentLevel
LevelControl 事宜 属性 maxLevel
LevelControl 事宜 属性 startUpCurrentLevel
MediaInput 事宜 命令 RenameInput
MediaInput 事宜 命令 SelectInput
MediaInput 事宜 属性 currentInput
MediaPlayback 事宜 命令 FastForward
MediaPlayback 事宜 命令 下一步
MediaPlayback 事宜 命令 暂停
MediaPlayback 事宜 命令 Play
MediaPlayback 事宜 命令 上一个
MediaPlayback 事宜 命令 快退
MediaPlayback 事宜 命令 SkipBackward
MediaPlayback 事宜 命令 SkipForward
MediaPlayback 事宜 事件 StateChanged
MediaPlayback 事宜 命令 停止
MediaPlayback 事宜 属性 currentState
ModeSelect 事宜 命令 ChangeToMode block
ModeSelect 事宜 属性 currentMode
ModeSelect 事宜 属性 onMode
NitrogenDioxideConcentrationMeasurement 事宜 属性 levelValue
NitrogenDioxideConcentrationMeasurement 事宜 属性 measuredValue
OccupancySensing 事宜 属性 入住情况
OnOff 事宜 命令 关闭 屏蔽
OnOff 事宜 命令 开启 屏蔽
OnOff 事宜 属性 onOff
OperationalState 事宜 事件 OperationCompletion
OperationalState 事宜 命令 暂停 block
OperationalState 事宜 命令 恢复
OperationalState 事宜 命令 开始
OperationalState 事宜 命令 停止
OperationalState 事宜 属性 currentPhase
OperationalState 事宜 属性 operationalState
OzoneConcentrationMeasurement 事宜 属性 levelValue
OzoneConcentrationMeasurement 事宜 属性 measuredValue
Pm10ConcentrationMeasurement 事宜 属性 levelValue
Pm10ConcentrationMeasurement 事宜 属性 measuredValue
Pm25ConcentrationMeasurement 事宜 属性 levelValue
Pm25ConcentrationMeasurement 事宜 属性 measuredValue
PowerSource 事宜 属性 batChargeState
PowerSource 事宜 属性 batChargingCurrent
PowerSource 事宜 属性 batTimeToFullCharge
RadonConcentrationMeasurement 事宜 属性 levelValue
RadonConcentrationMeasurement 事宜 属性 measuredValue
RelativeHumidityMeasurement 事宜 属性 measuredValue
RvcCleanMode 事宜 命令 ChangeToMode
RvcOperationalState 事宜 命令 GoHome
RvcOperationalState 事宜 命令 暂停
RvcOperationalState 事宜 命令 恢复
RvcOperationalState 事宜 属性 currentPhase
RvcOperationalState 事宜 属性 operationalError
RvcOperationalState 事宜 属性 operationalState
RvcRunMode 事宜 命令 ChangeToMode
RvcRunMode 事宜 属性 currentMode
切换 事宜 事件 InitialPress
切换 事宜 事件 LongPress
切换 事宜 事件 LongRelease
切换 事宜 事件 MultiPressComplete
切换 事宜 事件 MultiPressOngoing
切换 事宜 事件 ShortRelease
切换 事宜 事件 SwitchLatched
切换 事宜 属性 currentPosition
TemperatureControl 事宜 命令 SetTemperature block
TemperatureControl 事宜 属性 maxTemperature
TemperatureControl 事宜 属性 minTemperature
TemperatureControl 事宜 属性 selectedTemperatureLevel
TemperatureControl 事宜 属性 temperatureSetpoint
TemperatureMeasurement 事宜 属性 measuredValue
温控器 事宜 命令 SetpointRaiseLower
温控器 事宜 属性 activePresetHandle
温控器 事宜 属性 localTemperature
温控器 事宜 属性 入住情况
温控器 事宜 属性 occupiedCoolingSetpoint
温控器 事宜 属性 occupiedHeatingSetpoint
温控器 事宜 属性 outdoorTemperature
温控器 事宜 属性 setpointChangeSource
温控器 事宜 属性 systemMode
温控器 事宜 属性 temperatureSetpointHold
温控器 事宜 属性 temperatureSetpointHoldDuration
温控器 事宜 属性 thermostatRunningMode
温控器 事宜 属性 thermostatRunningState
温控器 事宜 属性 unoccupiedCoolingSetpoint
温控器 事宜 属性 unoccupiedHeatingSetpoint
TotalVolatileOrganicCompoundsConcentrationMeasurement 事宜 属性 levelValue
TotalVolatileOrganicCompoundsConcentrationMeasurement 事宜 属性 measuredValue
WindowCovering 事宜 命令 DownOrClose
WindowCovering 事宜 命令 GoToLiftPercentage
WindowCovering 事宜 命令 GoToLiftValue
WindowCovering 事宜 命令 GoToTiltPercentage
WindowCovering 事宜 命令 GoToTiltValue
WindowCovering 事宜 命令 StopMotion
WindowCovering 事宜 命令 UpOrOpen
WindowCovering 事宜 属性 currentPositionLift
WindowCovering 事宜 属性 currentPositionLiftPercent100ths
WindowCovering 事宜 属性 currentPositionLiftPercentage
WindowCovering 事宜 属性 currentPositionTilt
WindowCovering 事宜 属性 currentPositionTiltPercent100ths
WindowCovering 事宜 属性 currentPositionTiltPercentage
WindowCovering 事宜 属性 targetPositionLiftPercent100ths
WindowCovering 事宜 属性 targetPositionTiltPercent100ths
ArmDisarm google 命令 ArmDisarm
ArmDisarm google 事件 ArmDisarmArmState
ArmDisarm google 属性 armState
ArmDisarm google 属性 currentArmLevel
ArmDisarm google 属性 isArmed
Dock google 命令 Dock
Dock google 属性 isDocked
DoorbellPress google 事件 DoorbellPressed
ExtendedAirQuality google 事件 AirQuality
ExtendedAirQuality google 属性 indoorAirQuality
ExtendedAirQuality google 属性 indoorMeasuredValue
ExtendedAirQuality google 属性 measuredValue
ExtendedAirQuality google 属性 outdoorAirQuality
ExtendedAirQuality google 属性 outdoorMeasuredValue
ExtendedColorControl google 命令 MoveToColorHSV
ExtendedColorControl google 命令 MoveToColorName
ExtendedColorControl google 命令 MoveToColorRGB
ExtendedColorControl google 属性 currentBlue
ExtendedColorControl google 属性 currentGreen
ExtendedColorControl google 属性 currentHue
ExtendedColorControl google 属性 currentName
ExtendedColorControl google 属性 currentRed
ExtendedColorControl google 属性 currentSaturation
ExtendedColorControl google 属性 currentValue
ExtendedFanControl google 命令 ToggleAirflowDirection
ExtendedFanControl google 属性 customFanMode
ExtendedFanControl google 属性 customFanModes
ExtendedMediaInput google 命令 NextInput
ExtendedMediaInput google 命令 PreviousInput
ExtendedMediaInput google 命令 SelectCustomInput
ExtendedMediaInput google 属性 currentCustomInput
ExtendedMediaInput google 属性 customInputsList
ExtendedMediaInput google 属性 customInputsOrdered
ExtendedOperationalState google 事件 PauseUnpauseFollowUp
ExtendedOperationalState google 事件 StartStopFollowUp
ExtendedPowerSource google 命令 StartCharging
ExtendedPowerSource google 命令 StopCharging
ExtendedThermostat google 属性 activePresetHandle
ExtendedThermostat google 属性 activeRemoteTemperatureSensorIds
ExtendedThermostat google 属性 averageLocalTemperature
ExtendedThermostat google 属性 extendedRunningMode
ExtendedThermostat google 属性 extendedSystemMode
LightEffects google 命令 PulseEffectSet
LightEffects google 命令 SleepEffectSet
LightEffects google 命令 StopEffect
LightEffects google 命令 WakeEffectSet
LightEffects google 属性 pulseEffectSet
LightEffects google 属性 sleepEffectSet
LightEffects google 属性 wakeEffectSet
LockUnlock google 命令 锁定
LockUnlock google 命令 解锁
LockUnlock google 属性 lockState
MotionDetection google 事件 MotionDetected
MotionDetection google 属性 motionDetectionEventInProgress
ObjectDetection google 事件 ObjectDetected
OpenClose google 命令 关闭 屏蔽
OpenClose google 命令 GoToOpenPercentage block
OpenClose google 命令 打开 屏蔽
OpenClose google 命令 步骤
OpenClose google 属性 openPercent
OpenClose google 属性 openState
OpenClose google 属性 targetOpenPercent
切换开关 google 命令 ChangeToggleSettings block
切换开关 google 属性 currentToggleSettings
亮度 google 命令 BrightnessStep
亮度 google 命令 MoveToBrightness
亮度 google 属性 currentBrightnessPercent
SimplifiedOnOff google 属性 onOff
SimplifiedThermostat google 命令 SetSystemMode
SimplifiedThermostat google 属性 systemMode
Volume google 命令 MoveToVolume
Volume google 命令 静音
Volume google 命令 取消静音
Volume google 命令 VolumeStep
Volume google 属性 currentVolumePercent
Volume google 属性 isMuted
AreaAttendanceState google 属性 attendanceState
AreaPresenceState google 属性 presenceState