スマートホーム掃除機ガイド
action.devices.types.VACUUM - 掃除機は、掃除の開始 / 停止 / 一時停止、ドッキング、現在の掃除サイクルの確認、掃除機の位置の確認、さまざまなモードの調整などの機能を備えています。また、屋内の特定の場所の掃除に対応した掃除機もあります。
このタイプは、デバイスに掃除機のアイコンと、関連する 同義語とエイリアスが表示されることを示します。
デバイスの機能
サービスでサポートする必要がある属性や状態、EXECUTE レスポンスと QUERY レスポンスの作成方法など、実装の詳細については、対応するトレイトのドキュメントをご覧ください。
必須トレイト
これらのトレイトとコマンドは、デバイスに適用される場合は必須です。デバイスがこれらのトレイトをサポートしていない場合は、QUERY レスポンスまたは EXECUTE レスポンスにエラーコード functionNotSupported を入力します。詳しくは、
エラーと例外をご覧ください。
推奨トレイト
これらのトレイトは、デバイスに適用される場合は推奨されます。 ただし、利用可能なすべてのトレイトの中から、既存の製品機能に最適な組み合わせを自由に選択できます。
-
action.devices.traits.Dock -
action.devices.traits.EnergyStorage -
action.devices.traits.Locator -
action.devices.traits.OnOff -
action.devices.traits.RunCycle
デバイスの例: シンプルな掃除機
このセクションでは、上記のデバイスタイプとトレイトに基づく一般的な「掃除機」 を表すインテント ペイロードの例を示します。実装でトレイトを追加または削除した場合は、 それらの変更を反映するようにレスポンスを変更してください。
SYNC レスポンスの例
{
"requestId": "6894439706274654512",
"inputs": [
{
"intent": "action.devices.SYNC"
}
]
}{ "requestId": "6894439706274654512", "payload": { "agentUserId": "user123", "devices": [ { "id": "123", "type": "action.devices.types.VACUUM", "traits": [ "action.devices.traits.Dock", "action.devices.traits.EnergyStorage", "action.devices.traits.StartStop" ], "name": { "name": "Simple vacuum" }, "willReportState": true, "attributes": { "queryOnlyEnergyStorage": true, "pausable": true }, "deviceInfo": { "manufacturer": "smart-home-inc", "model": "hs1234", "hwVersion": "3.2", "swVersion": "11.4" } } ] } }
QUERY レスポンスの例
{ "requestId": "6894439706274654514", "inputs": [ { "intent": "action.devices.QUERY", "payload": { "devices": [ { "id": "123" } ] } } ] }
{ "requestId": "6894439706274654514", "payload": { "devices": { "123": { "status": "SUCCESS", "online": true, "isRunning": false, "isPaused": false, "isDocked": true, "descriptiveCapacityRemaining": "HIGH", "capacityRemaining": [ { "unit": "SECONDS", "rawValue": 36000 }, { "unit": "PERCENTAGE", "rawValue": 90 } ] } } } }
EXECUTE コマンドの例
ドッキング
コマンド パラメータの詳細については、
action.devices.traits.Dock
リファレンスをご覧ください。
{ "requestId": "6894439706274654516", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.Dock" } ] } ] } } ] }
{ "requestId": "6894439706274654516", "payload": { "commands": [ { "ids": [ "123" ], "status": "PENDING", "states": { "online": true, "isDocked": true } } ] } }
StartStop
コマンド パラメータの詳細については、
action.devices.traits.StartStop
リファレンスをご覧ください。
{ "requestId": "6894439706274654518", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.StartStop", "params": { "start": true } } ] } ] } } ] }
{ "requestId": "6894439706274654518", "payload": { "commands": [ { "ids": [ "123" ], "status": "PENDING", "states": { "online": true, "isRunning": true, "isPaused": false } } ] } }
PauseUnpause
コマンド パラメータの詳細については、
action.devices.traits.StartStop
リファレンスをご覧ください。
{ "requestId": "6894439706274654520", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.PauseUnpause", "params": { "pause": true } } ] } ] } } ] }
{ "requestId": "6894439706274654520", "payload": { "commands": [ { "ids": [ "123" ], "status": "PENDING", "states": { "online": true, "isRunning": false, "isPaused": true } } ] } }