智慧型住宅 FanSpeed Trait 結構定義
action.devices.traits.FanSpeed
- 這項特性代表裝置支援風扇速度,
裝置屬性
具此特性的裝置可能會在 SYNC
作業中回報下列屬性。如要進一步瞭解如何處理 SYNC
意圖,請參閱意圖執行要求。
屬性 | 類型 | 說明 |
---|---|---|
reversible |
布林 |
(預設值: 如果設為 true,此裝置會支援同時朝前風扇的風扇,並接受對調反向方向的指令。 |
commandOnlyFanSpeed |
布林 |
(預設值: 指出裝置是否支援單向 (true) 或雙向 (false) 通訊。如果裝置無法針對此特性回應 QUERY 意圖或報告狀態,請將這項屬性設為 true。 |
包含下列任何項目: | ||
0
|
物件 |
支援速度設定。 |
availableFanSpeeds |
物件 |
必要。 裝置支援的速度設定。 |
speeds |
陣列 |
必要。 速度設定清單。 |
[item, ...] |
物件 |
速度設定。 |
speed_name |
字串 |
必要。 速度設定的內部名稱。這項機制不容易使用,而且會由所有語言共用。 |
speed_values |
陣列 |
必要。 每種支援的語言支援的語言速度同義詞。 |
[item, ...] |
物件 |
特定語言的速度設定同義詞。 |
speed_synonym |
陣列 |
必要。 速度設定的同義詞,最好包含單數與複數形式 (如適用)。系統會將清單中第一個同義詞視為速度設定的標準名稱。 |
[item, ...] |
字串 |
同義詞。 |
lang |
字串 |
必要。 語言代碼 (ISO 639-1)。請參閱「支援的語言」。 |
ordered |
布林 |
必要。 如果設為 true,則會套用速度陣列增加或減少的文法 (遞增)。 |
1
|
物件 |
支援速度百分比。 |
supportsFanSpeedPercent |
布林 |
必要。 (預設值: 如果設為 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 |
字串 |
代表 |
currentFanSpeedPercent |
Number |
以目前百分比表示目前風扇速度。如果 |
範例
客廳中的粉絲速度多快?
{ "currentFanSpeedSetting": "speed_low", "currentFanSpeedPercent": 10 }
裝置指令
具有此特性的裝置可能會回應 EXECUTE
作業中的下列指令。如要進一步瞭解如何處理 EXECUTE
意圖,請參閱意圖執行要求。
action.devices.commands.SetFanSpeed
設定速度。
參數
酬載包含下列內容:
依設定調整速度。
參數 | 類型 | 說明 |
---|---|---|
fanSpeed |
字串 |
必要。 風扇的速度要求。 |
依百分比設定速度。
參數 | 類型 | 說明 |
---|---|---|
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 på medel
裝置 ERRORS
請參閱錯誤和例外狀況的完整清單。maxSpeedReached
:裝置已設為最高速度。minSpeedReached
:裝置已設為最低速。