Smart Home FanSpeed 特徵結構定義

action.devices.traits.FanSpeed:這個特性屬於支援設定風扇速度的裝置。

風風

裝置屬性

具備這個特性的裝置可能會在 SYNC 作業中回報下列屬性。如要進一步瞭解如何處理 SYNC 意圖,請參閱「意圖執行要求」。

屬性 類型 說明
reversible 布林

(預設值:false)。

如果設為 True,此裝置可雙向支援風扇,並可接受轉向風扇方向的指令。

commandOnlyFanSpeed 布林

(預設值:false)。

指出裝置是否支援單向 (true) 或雙向 (false) 通訊。如果裝置無法回應此特性的 QUERY 意圖或報告狀態,請將此屬性設為 true。

包含下列任一項目:
0 物件

支援速度設定。

availableFanSpeeds 物件

必要。

裝置支援的速度設定。

speeds 陣列

必要。

速度設定清單。

[item, ...] 物件

速度設定。

speed_name String

必要。

速度設定的內部名稱。這項設定可能不宜使用,並開放所有語言的使用者使用。

speed_values 陣列

必要。

每種支援語言的速度設定的同義詞。

[item, ...] 物件

特定語言速度設定的同義詞。

speed_synonym 陣列

必要。

速度設定的同義詞,應同時包含單數和複數形式 (如適用)。系統會將清單中的第一個同義詞視為速度設定的標準名稱。

[item, ...] String

同義詞。

lang String

必要。

語言代碼 (ISO 639-1)。查看支援的語言

ordered 布林

必要。

如果設為 True,系統會按照速度陣列的順序 (遞增) 套用其他文法調整。

1 物件

支援速度百分比。

supportsFanSpeedPercent 布林

必要。

(預設值:false)。

如果設為 true,這部裝置會接受使用 0.0 到 100.0 之間的百分比調整速度的指令。

範例

有兩種速度設定的裝置,支援反向方向和百分比調整。

{
  "availableFanSpeeds": {
    "speeds": [
      {
        "speed_name": "speed_low",
        "speed_values": [
          {
            "speed_synonym": [
              "Low",
              "Slow"
            ],
            "lang": "en"
          }
        ]
      },
      {
        "speed_name": "speed_high",
        "speed_values": [
          {
            "speed_synonym": [
              "High",
              "Fast"
            ],
            "lang": "en"
          }
        ]
      }
    ],
    "ordered": true
  },
  "reversible": true,
  "supportsFanSpeedPercent": true
}

裝置狀態

具有這個特性的實體可能會在 QUERY 作業中回報下列狀態。如要進一步瞭解如何處理 QUERY 意圖,請參閱「意圖執行要求」。

狀態 類型 說明
currentFanSpeedSetting String

這代表 availableFanSpeeds 屬性中目前速度設定的內部名稱。

currentFanSpeedPercent Number

以百分比表示目前的風扇速度。如果 supportsFanSpeedPercent 屬性設為 true,則為必要欄位

範例

客廳的粉絲速度多快?

{
  "currentFanSpeedSetting": "speed_low",
  "currentFanSpeedPercent": 10
}

裝置指令

具有這個特性的裝置可能會在 EXECUTE 作業中回應下列指令。如要進一步瞭解如何處理 EXECUTE 意圖,請參閱「意圖執行要求」。

action.devices.commands.SetFanSpeed

設定速度。

參數

酬載包含下列其中一項:

依設定調整速度。

參數 類型 說明
fanSpeed String

必要。

風扇所要求的速度設定。

以百分比設定速度。

參數 類型 說明
fanSpeedPercent Number

必要。

要求的速度設定百分比。

範例

將風扇風速設為「高」。

{
  "command": "action.devices.commands.SetFanSpeed",
  "params": {
    "fanSpeed": "speed_high"
  }
}

將風扇調到 50%

{
  "command": "action.devices.commands.SetFanSpeed",
  "params": {
    "fanSpeedPercent": 50
  }
}

action.devices.commands.SetFanSpeedRelative

設定相對速度。

這個指令需要下列屬性:
{
  "commandOnlyFanSpeed": true
}

參數

酬載包含下列其中一項:

依重量設定相對速度。

參數 類型 說明
fanSpeedRelativeWeight 整數

必要。

這個值代表速度變化的相對量。絕對值代表按比例調整的金額,而數值符號則代表變化方向。

以百分比設定相對速度。

參數 類型 說明
fanSpeedRelativePercent Number

必要。

這個值代表速度變化的百分比。

範例

稍微降低風扇風速。

{
  "command": "action.devices.commands.SetFanSpeedRelative",
  "params": {
    "fanSpeedRelativeWeight": -1
  }
}

將風扇風速提高 10%。

{
  "command": "action.devices.commands.SetFanSpeedRelative",
  "params": {
    "fanSpeedRelativePercent": 10
  }
}

action.devices.commands.Reverse

反轉風扇方向。

這個指令需要下列屬性:
{
  "reversible": true
}

參數

參數 類型 說明

沒有任何資源

範例

反轉風扇方向。

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

語音範例

de-DE

  • stell die Geschwindigkeit vom Ventilator auf hoch

en-US

  • drop the AC fan speed to medium

es-ES

  • cambia la velocidad del ventilador a medio

fr-FR

  • mets la ventilation au maximum

hi-IN

  • बेडरूम में पंखे की गति मीडियम करें

it-IT

  • metti il condizionatore in salotto a velocità media

ja-JP

  • エアコン の風量を 高速 にセット

ko-KR

  • 선풍기 강풍 으로 틀어 줘

nl-NL

  • zet de snelheid van de ventilator op medium

pt-BR

  • definir a velocidade do ventilador para baixa
  • põe a ventoinha no máximo

sv-SE

  • Ställ in fläkten medel

裝置錯誤

請參閱錯誤和例外狀況的完整清單。
  • maxSpeedReached:裝置已設為最高速度。
  • minSpeedReached:裝置已設為最低速度。