Panduan Pembuat Kopi Smart Home
action.devices.types.COFFEE_MAKER - Interaksi dengan pembuat kopi dapat mencakup mengaktifkan dan menonaktifkannya, menyesuaikan mode memasak dan preset makanan, menyesuaikan suhu target, dan menyesuaikan berbagai setelan mode non-memasak.
Jenis ini menunjukkan bahwa perangkat mendapatkan ikon Pembuat Kopi dan beberapa sinonim dan alias terkait.
Kemampuan perangkat
Lihat dokumentasi karakteristik yang sesuai untuk mengetahui detail penerapan, seperti atribut dan status yang harus didukung layanan Anda, serta cara membuat respons EXECUTE dan QUERY.
Ciri-ciri yang diperlukan
Perintah dan ciri ini diperlukan, jika berlaku untuk perangkat Anda. Jika perangkat Anda tidak mendukung karakteristik ini, masukkan kode error
functionNotSupported dalam respons QUERY atau EXECUTE. Lihat
Error dan pengecualian untuk mengetahui info selengkapnya.
Ciri-ciri yang direkomendasikan
Karakteristik ini direkomendasikan, jika berlaku untuk perangkat Anda. Namun, Anda bebas mencampur dan mencocokkan semua sifat yang tersedia agar paling sesuai dengan fungsi produk yang ada.
Contoh perangkat: Mesin pembuat kopi sederhana
Bagian ini berisi contoh payload intent yang merepresentasikan "Pembuat Kopi" umum berdasarkan jenis dan karakteristik perangkat di atas. Jika Anda menambahkan atau menghapus ciri dalam penerapan, ubah respons Anda dengan tepat untuk mencerminkan perubahan tersebut.
Contoh respons SYNC
{
"requestId": "6894439706274654512",
"inputs": [
{
"intent": "action.devices.SYNC"
}
]
}{ "requestId": "6894439706274654512", "payload": { "agentUserId": "user123", "devices": [ { "id": "123", "type": "action.devices.types.COFFEE_MAKER", "traits": [ "action.devices.traits.Cook", "action.devices.traits.TemperatureControl", "action.devices.traits.OnOff" ], "name": { "name": "Simple coffee maker" }, "willReportState": true, "attributes": { "temperatureRange": { "minThresholdCelsius": 0, "maxThresholdCelsius": 100 }, "temperatureUnitForUX": "F", "supportedCookingModes": [ "BREW" ], "foodPresets": [ { "food_preset_name": "coffee_key", "supported_units": [ "NO_UNITS", "CUPS" ], "food_synonyms": [ { "synonym": [ "Coffee" ], "lang": "en" } ] } ] }, "deviceInfo": { "manufacturer": "smart-home-inc", "model": "hs1234", "hwVersion": "3.2", "swVersion": "11.4" } } ] } }
Contoh respons QUERY
{ "requestId": "6894439706274654514", "inputs": [ { "intent": "action.devices.QUERY", "payload": { "devices": [ { "id": "123" } ] } } ] }
{ "requestId": "6894439706274654514", "payload": { "devices": { "123": { "status": "SUCCESS", "online": true, "on": true, "temperatureSetpointCelsius": 70, "currentCookingMode": "BREW", "currentFoodPreset": "coffee_key", "currentFoodQuantity": 2, "currentFoodUnit": "CUPS" } } } }
Contoh perintah EXECUTE
Inspirasi Memasak
Untuk mengetahui detail tambahan tentang parameter perintah,
lihat referensi
action.devices.traits.Cook.
{ "requestId": "6894439706274654516", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.Cook", "params": { "start": false, "cookingMode": "BREW" } } ] } ] } } ] }
{ "requestId": "6894439706274654516", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "currentCookingMode": "NONE", "currentFoodPreset": "NONE" } } ] } }
SetTemperature
Untuk mengetahui detail tambahan tentang parameter perintah,
lihat referensi
action.devices.traits.TemperatureControl.
{ "requestId": "6894439706274654518", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.SetTemperature", "params": { "temperature": 85 } } ] } ] } } ] }
{ "requestId": "6894439706274654518", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "temperatureSetpointCelsius": 85 } } ] } }
OnOff
Untuk mengetahui detail tambahan tentang parameter perintah,
lihat referensi
action.devices.traits.OnOff.
{ "requestId": "6894439706274654520", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.OnOff", "params": { "on": true } } ] } ] } } ] }
{ "requestId": "6894439706274654520", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "on": true } } ] } }