Panduan Lemari Smart Home
action.devices.types.CLOSET
- Lemari dapat dibuka dan ditutup, yang berpotensi berada di lebih dari satu arah.
Jenis ini menunjukkan bahwa perangkat mendapatkan ikon Lemari serta beberapa sinonim dan alias yang terkait.
Kemampuan perangkat
Lihat dokumentasi karakteristik yang sesuai untuk detail implementasi, seperti atribut dan status yang harus didukung oleh layanan Anda, serta cara membuat respons EXECUTE dan QUERY.
Sifat yang diperlukan
Sifat dan perintah ini diperlukan, jika berlaku untuk perangkat Anda.
Persyaratan kualitas
- Latensi: harus kurang dari atau sama dengan 2500ms.
- Keandalan: harus lebih dari atau sama dengan 97%.
Contoh perangkat: Lemari pakaian sederhana
Bagian ini berisi contoh payload intent yang mewakili "Tutup" umum berdasarkan jenis dan karakteristik perangkat di atas. Jika Anda menambahkan atau menghapus karakteristik dalam implementasi, ubah respons agar sesuai dengan perubahan tersebut.
Contoh respons SYNC
{ "requestId": "6894439706274654512", "inputs": [ { "intent": "action.devices.SYNC" } ] }
{ "requestId": "6894439706274654512", "payload": { "agentUserId": "user123", "devices": [ { "id": "123", "type": "action.devices.types.CLOSET", "traits": [ "action.devices.traits.OpenClose" ], "name": { "name": "Simple closet" }, "willReportState": true, "attributes": { "openDirection": [ "LEFT", "RIGHT" ] }, "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, "openState": [ { "openPercent": 30, "openDirection": "LEFT" }, { "openPercent": 50, "openDirection": "RIGHT" } ] } } } }
Contoh perintah EXECUTE
BukaTutup
Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.OpenClose
.
{ "requestId": "6894439706274654516", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.OpenClose", "params": { "openPercent": 10, "openDirection": "LEFT" } } ] } ] } } ] }
{ "requestId": "6894439706274654516", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "openState": [ { "openPercent": 10, "openDirection": "LEFT" }, { "openPercent": 50, "openDirection": "RIGHT" } ] } } ] } }